[PATCH] image-fdt: save name of FIT configuration in '/chosen' node
Heinrich Schuchardt
xypron.glpk at gmx.de
Tue Mar 22 09:29:54 CET 2022
On 3/22/22 00:22, Daniel Golle wrote:
> 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.
Please, point out where you want to use that information. I cannot see
that the Linux kernel will make any use of it.
>
> Signed-off-by: Daniel Golle <daniel at 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);
> +
We should not inject arbitrary properties into the device-tree. Where is
the property /chosen/bootconf defined in the Linux documentation or in
the device-tree specification?
Best regards
Heinrich
> /* Update ethernet nodes */
> fdt_fixup_ethernet(blob);
> #if CONFIG_IS_ENABLED(CMD_PSTORE)
More information about the U-Boot
mailing list