diff options
author | Tom Rini <trini@konsulko.com> | 2017-08-03 16:33:07 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-08-03 21:48:53 +0300 |
commit | 217324b23c4a73420633068efcdc396682894b1b (patch) | |
tree | e0dbe14f7523572060f8693f49dbd3f1e47453a7 /arch/powerpc/cpu | |
parent | 9f841559a5ecfc1c860819a5b6b516568bc374d5 (diff) | |
download | u-boot-217324b23c4a73420633068efcdc396682894b1b.tar.xz |
PowerPC: mpc85xx: Update ft_verify_fdt
With the changes to fdt_get_base_address() we need to modify the logic
in ft_verify_fdt() for how we check the validity of the CCSR address.
Tested-on: qemu-ppce500 -M mpc8544ds
Fixes: 336a44877af8 ("fdt: Correct fdt_get_base_address()")
Cc: York Sun <york.sun@nxp.com>
Cc: Wolfgang Denk <wd@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/powerpc/cpu')
-rw-r--r-- | arch/powerpc/cpu/mpc85xx/fdt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c index a9ea947305..caa0bf9bdc 100644 --- a/arch/powerpc/cpu/mpc85xx/fdt.c +++ b/arch/powerpc/cpu/mpc85xx/fdt.c @@ -770,8 +770,15 @@ int ft_verify_fdt(void *fdt) /* First check the CCSR base address */ off = fdt_node_offset_by_prop_value(fdt, -1, "device_type", "soc", 4); - if (off > 0) - addr = fdt_get_base_address(fdt, off); + if (off > 0) { + int size; + u32 naddr; + const fdt32_t *prop; + + naddr = fdt_address_cells(fdt, off); + prop = fdt_getprop(fdt, off, "ranges", &size); + addr = fdt_translate_address(fdt, off, prop + naddr); + } if (!addr) { printf("Warning: could not determine base CCSR address in " |