mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/4] fdt: Do not reserve device tree blob
@ 2023-10-19 11:27 Sascha Hauer
  2023-10-19 11:27 ` [PATCH 2/4] bootm: print memreserve map in verbose mode Sascha Hauer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sascha Hauer @ 2023-10-19 11:27 UTC (permalink / raw)
  To: Barebox List

As a matter of fact the reservation is buggy. fdt_add_reserve_map()
added the reservation for the address the fdt currently is placed,
but the fdt is relocated in bootm_load_devicetree() later. This means
we just add a reserve region for some arbitrary piece of memory which
can equally well be removed.

Linux doesn't require reserving the device tree blob. Some architectures
use early_init_fdt_reserve_self() to mark the fdt as reserved, some like
arm64 use architecture code to reserve the region, others like arm move
the fdt away.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/of/fdt.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 9d72fafd36..734dbfc92a 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -554,9 +554,7 @@ void of_clean_reserve_map(void)
  * @__fdt: The devicetree blob
  *
  * This adds the reservemap entries previously collected in
- * of_add_reserve_entry() to a devicetree binary blob. This also
- * adds the devicetree itself to the reserved list, so after calling
- * this function the tree should not be relocated anymore.
+ * of_add_reserve_entry() to a devicetree binary blob.
  */
 void fdt_add_reserve_map(void *__fdt)
 {
@@ -584,10 +582,6 @@ void fdt_add_reserve_map(void *__fdt)
 		fdt_res++;
 	}
 
-	of_write_number(&fdt_res->address, (unsigned long)__fdt, 2);
-	of_write_number(&fdt_res->size, be32_to_cpu(fdt->totalsize), 2);
-	fdt_res++;
-
 	of_write_number(&fdt_res->address, 0, 2);
 	of_write_number(&fdt_res->size, 0, 2);
 }
-- 
2.39.2




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

end of thread, other threads:[~2023-10-19 11:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-19 11:27 [PATCH 1/4] fdt: Do not reserve device tree blob Sascha Hauer
2023-10-19 11:27 ` [PATCH 2/4] bootm: print memreserve map in verbose mode Sascha Hauer
2023-10-19 11:27 ` [PATCH 3/4] arm: layerscape: ppa: reserve SDRAM region for PPA Sascha Hauer
2023-10-19 11:27 ` [PATCH 4/4] arm: layerscape: ppa: Add PPA as /reserved-memory/ppa node Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox