public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] image-fdt: save name of FIT configuration in '/chosen' node
@ 2022-03-21 23:22 Daniel Golle
  2022-03-22  8:29 ` Heinrich Schuchardt
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Golle @ 2022-03-21 23:22 UTC (permalink / raw)
  To: u-boot
  Cc: Simon Glass, Alexandru Gagniuc, Patrick Delaunay,
	Heinrich Schuchardt

It can be useful for the OS (Linux) to know which configuration has
been chosen by U-Boot when launching a FIT image.
Store the name of the FIT configuration node used in a new string
attribute called 'bootconf' in the '/chosen' node in device tree.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 boot/image-fdt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/boot/image-fdt.c b/boot/image-fdt.c
index 692a9ad3e4..4017bc94a6 100644
--- a/boot/image-fdt.c
+++ b/boot/image-fdt.c
@@ -601,6 +601,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 		goto err;
 	}
 
+	/* Store name of configuration node as bootconf in /chosen node */
+	if (images->fit_uname_cfg)
+		fdt_find_and_setprop(blob, "/chosen", "bootconf",
+					images->fit_uname_cfg,
+					strlen(images->fit_uname_cfg) + 1, 1);
+
 	/* Update ethernet nodes */
 	fdt_fixup_ethernet(blob);
 #if CONFIG_IS_ENABLED(CMD_PSTORE)
-- 
2.35.1


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

end of thread, other threads:[~2022-03-22 22:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-21 23:22 [PATCH] image-fdt: save name of FIT configuration in '/chosen' node Daniel Golle
2022-03-22  8:29 ` Heinrich Schuchardt
2022-03-22 13:18   ` Daniel Golle
2022-03-22 21:09     ` Heinrich Schuchardt
2022-03-22 22:13       ` Daniel Golle

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