diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/debug.c | 2 | ||||
| -rw-r--r-- | common/pmem.c | 20 |
2 files changed, 5 insertions, 17 deletions
diff --git a/common/debug.c b/common/debug.c index 7118733..ff9dc18 100644 --- a/common/debug.c +++ b/common/debug.c @@ -201,7 +201,7 @@ static struct dbg_info __dbg_from_fdt(const void *fdt) /* get serial device address */ struct cell_info ci = get_reginfo(fdt, stdout); void *reg_ptr = (void *)fdt_getprop(fdt, stdout_offset, "reg", NULL); - pm_t dbg_ptr = (pm_t)fdt_load_int_ptr(ci.addr_cells, reg_ptr); + pm_t dbg_ptr = (pm_t)fdt_load_reg_addr(ci, reg_ptr, 0); /* get serial device offset if present */ size_t shift = 0; diff --git a/common/pmem.c b/common/pmem.c index 83c6ca3..80599ef 100644 --- a/common/pmem.c +++ b/common/pmem.c @@ -534,17 +534,11 @@ static void __mark_reserved_mem(void *fdt) uint8_t *rmem_reg = (uint8_t *)fdt_getprop(fdt, node, "reg", NULL); - pm_t base = (pm_t)fdt_load_int_ptr(ci.addr_cells, rmem_reg); - - if (ci.addr_cells == 2) - rmem_reg += sizeof(fdt64_t); - else - rmem_reg += sizeof(fdt32_t); + pm_t base = (pm_t)fdt_load_reg_addr(ci, rmem_reg, 0); /** @todo make sure the top of a reserved memory area doesn't go * against our assumptions in FW_MAX_SIZE? */ - pm_t top = - (pm_t)fdt_load_int_ptr(ci.size_cells, rmem_reg) + base; + pm_t top = (pm_t)fdt_load_reg_size(ci, rmem_reg, 0) + base; __mark_area_used((pm_t)__va(base), (pm_t)__va(top)); info("marked [%lx - %lx] reserved\n", (pm_t)__va(base), (pm_t)__va(top)); @@ -563,14 +557,8 @@ static pm_t __get_ramtop(void *fdt) int mem_offset = fdt_path_offset(fdt, "/memory"); uint8_t *mem_reg = (uint8_t *)fdt_getprop(fdt, mem_offset, "reg", NULL); - pm_t base = (pm_t)fdt_load_int_ptr(ci.addr_cells, mem_reg); - - if (ci.addr_cells == 2) - mem_reg += sizeof(fdt64_t); - else - mem_reg += sizeof(fdt32_t); - - return (pm_t)fdt_load_int_ptr(ci.size_cells, mem_reg) + base; + pm_t base = (pm_t)fdt_load_reg_addr(ci, mem_reg, 0); + return (pm_t)fdt_load_reg_size(ci, mem_reg, 0) + base; } /** |
