mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fixup! bootm: booti: make device tree optional
@ 2025-06-12  8:18 Ahmad Fatoum
  2025-06-12  9:13 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-06-12  8:18 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

bootm_get_devicetree returns the fixed up device tree, so it must be
called after bootm_load_initrd, so the properties indicating the initrd
location are included in the fixed DT.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 common/booti.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/common/booti.c b/common/booti.c
index 2d4cb3598737..6a87b84c0308 100644
--- a/common/booti.c
+++ b/common/booti.c
@@ -66,12 +66,6 @@ void *booti_load_image(struct image_data *data, phys_addr_t *oftree)
 		unsigned long devicetree;
 		const struct resource *initrd_res;
 
-		fdt = bootm_get_devicetree(data);
-		if (IS_ERR(fdt))
-			return fdt;
-		if (!fdt)
-			goto out;
-
 		initrd_res = bootm_load_initrd(data, image_end);
 		if (IS_ERR(initrd_res)) {
 			return ERR_CAST(initrd_res);
@@ -82,6 +76,15 @@ void *booti_load_image(struct image_data *data, phys_addr_t *oftree)
 
 		devicetree = image_end;
 
+		fdt = bootm_get_devicetree(data);
+		if (IS_ERR(fdt))
+			return fdt;
+		if (!fdt) {
+			if (initrd_res)
+				pr_warn("initrd discarded due to missing devicetree.\n");
+			goto out;
+		}
+
 		ret = bootm_load_devicetree(data, fdt, devicetree);
 		free(fdt);
 
-- 
2.39.5




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

end of thread, other threads:[~2025-06-12 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-12  8:18 [PATCH] fixup! bootm: booti: make device tree optional Ahmad Fatoum
2025-06-12  9:13 ` Sascha Hauer

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