All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] PowerPC: mpc85xx: Update ft_verify_fdt
@ 2017-08-03 13:51 Tom Rini
  2017-08-03 14:05 ` Simon Glass
  2017-08-03 19:07 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Rini @ 2017-08-03 13:51 UTC (permalink / raw)
  To: u-boot

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>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/powerpc/cpu/mpc85xx/fdt.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c
index a9ea947305ff..caa0bf9bdc1d 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 "
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] PowerPC: mpc85xx: Update ft_verify_fdt
  2017-08-03 13:51 [U-Boot] [PATCH] PowerPC: mpc85xx: Update ft_verify_fdt Tom Rini
@ 2017-08-03 14:05 ` Simon Glass
  2017-08-03 19:07 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2017-08-03 14:05 UTC (permalink / raw)
  To: u-boot

On 3 August 2017 at 07:51, Tom Rini <trini@konsulko.com> wrote:
> 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>
> Cc: Simon Glass <sjg@chromium.org>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  arch/powerpc/cpu/mpc85xx/fdt.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] PowerPC: mpc85xx: Update ft_verify_fdt
  2017-08-03 13:51 [U-Boot] [PATCH] PowerPC: mpc85xx: Update ft_verify_fdt Tom Rini
  2017-08-03 14:05 ` Simon Glass
@ 2017-08-03 19:07 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2017-08-03 19:07 UTC (permalink / raw)
  To: u-boot

On Thu, Aug 03, 2017 at 09:51:53AM -0400, Tom Rini wrote:

> 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>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170803/f5e82e0e/attachment.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-03 19:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-03 13:51 [U-Boot] [PATCH] PowerPC: mpc85xx: Update ft_verify_fdt Tom Rini
2017-08-03 14:05 ` Simon Glass
2017-08-03 19:07 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.