1 From 5f2d5915f8ea4785bc2b8a26955e176a7898c15b Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel@makrotopia.org>
3 Date: Tue, 12 Apr 2022 21:00:43 +0100
4 Subject: [PATCH] image-fdt: save name of FIT configuration in '/chosen' node
6 It can be useful for the OS (Linux) to know which configuration has
7 been chosen by U-Boot when launching a FIT image.
8 Store the name of the FIT configuration node used in a new string
9 property called 'u-boot,bootconf' in the '/chosen' node in device tree.
11 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
12 Reviewed-by: Tom Rini <trini@konsulko.com>
14 boot/image-fdt.c | 6 ++++++
15 1 file changed, 6 insertions(+)
17 --- a/boot/image-fdt.c
18 +++ b/boot/image-fdt.c
19 @@ -639,6 +639,12 @@ int image_setup_libfdt(bootm_headers_t *
20 images->fit_uname_cfg,
21 strlen(images->fit_uname_cfg) + 1, 1);
23 + /* Store name of configuration node as u-boot,bootconf in /chosen node */
24 + if (images->fit_uname_cfg)
25 + fdt_find_and_setprop(blob, "/chosen", "u-boot,bootconf",
26 + images->fit_uname_cfg,
27 + strlen(images->fit_uname_cfg) + 1, 1);
29 /* Update ethernet nodes */
30 fdt_fixup_ethernet(blob);
31 #if CONFIG_IS_ENABLED(CMD_PSTORE)