[U-Boot] [PATCH v2 1/9] fdt_support: fdt reservations on the sandbox
Heinrich Schuchardt
xypron.glpk at gmx.de
Mon Nov 12 17:55:20 UTC 2018
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 <xypron.glpk at gmx.de>
---
v2:
no change
---
common/fdt_support.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/common/fdt_support.c b/common/fdt_support.c
index e6daa67990d..ec6af92dbba 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <mapmem.h>
#include <stdio_dev.h>
#include <linux/ctype.h>
#include <linux/types.h>
@@ -240,7 +241,8 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end)
}
}
- err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - initrd_start);
+ err = fdt_add_mem_rsv((void *)(uintptr_t)map_to_sysmem(fdt),
+ initrd_start, initrd_end - initrd_start);
if (err < 0) {
printf("fdt_initrd: %s\n", fdt_strerror(err));
return err;
@@ -633,7 +635,8 @@ 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((void *)(uintptr_t)map_to_sysmem(blob),
+ (uintptr_t)blob, actualsize);
if (ret < 0)
return ret;
--
2.19.1
More information about the U-Boot
mailing list