[PATCH] fdt: Fix dt memreserve entry

Sascha Hauer s.hauer at pengutronix.de
Mon May 13 10:05:32 EDT 2013


The fdt reserve map needs address/size values, not address/end values
like accidently done for generating the reserve entry for the dt.

Reported-by: Jürgen Beisert <j.beisert at pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/of/fdt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index db422a4..a3ec576 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -489,8 +489,7 @@ void fdt_add_reserve_map(void *__fdt)
 	}
 
 	of_write_number(&fdt_res->address, (unsigned long)__fdt, 2);
-	of_write_number(&fdt_res->size, (unsigned long)__fdt +
-			be32_to_cpu(fdt->totalsize), 2);
+	of_write_number(&fdt_res->size, be32_to_cpu(fdt->totalsize), 2);
 	fdt_res++;
 
 	of_write_number(&fdt_res->address, 0, 2);
-- 
1.8.2.rc2




More information about the barebox mailing list