From f980c99985dda829f4300bfec32695dfe4731849 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 18 Nov 2018 17:58:50 +0100 Subject: fdt: sandbox: correct use of ${fdtcontroladdr} The sandbox uses a virtual address space that is neither the physical nor the virtual address space of the operating system. All address used on the command line live in this address space. So also the environment variable ${fdtcontroladdr} has to be in this address space. Commands like bootefi and booti receive the fdt address as parameter. Without the patch ${fdtcontroladdr} cannot be used as parameter value on the sandbox. Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- common/board_r.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/board_r.c b/common/board_r.c index c55e33eec2..745212be71 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -453,7 +453,8 @@ static int initr_env(void) else set_default_env(NULL, 0); #ifdef CONFIG_OF_CONTROL - env_set_addr("fdtcontroladdr", gd->fdt_blob); + env_set_hex("fdtcontroladdr", + (unsigned long)map_to_sysmem(gd->fdt_blob)); #endif /* Initialize from environment */ -- cgit v1.2.3 From 9ad0a799e55a55b23ebad26dbad5fcd0dbedecf6 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 18 Nov 2018 17:58:51 +0100 Subject: fdt_support: fdt reservations on the sandbox On the sandbox the memory addresses in the device tree refer to the virtual address space of the sandbox. This implies that the memory reservations for the fdt also have to be converted to this address space. Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- common/fdt_support.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/fdt_support.c b/common/fdt_support.c index e6daa67990..3440e42a25 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -633,7 +634,7 @@ int fdt_shrink_to_minimum(void *blob, uint extrasize) fdt_set_totalsize(blob, actualsize); /* Add the new reservation */ - ret = fdt_add_mem_rsv(blob, (uintptr_t)blob, actualsize); + ret = fdt_add_mem_rsv(blob, map_to_sysmem(blob), actualsize); if (ret < 0) return ret; -- cgit v1.2.3