uboot-mediatek: replace patch with accepted commit
[openwrt/staging/mkresin.git] / package / boot / uboot-mediatek / patches / 280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch
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
5
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.
10
11 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
12 Reviewed-by: Tom Rini <trini@konsulko.com>
13 ---
14 boot/image-fdt.c | 6 ++++++
15 1 file changed, 6 insertions(+)
16
17 diff --git a/boot/image-fdt.c b/boot/image-fdt.c
18 index 692a9ad3e4..fdb69926a2 100644
19 --- a/boot/image-fdt.c
20 +++ b/boot/image-fdt.c
21 @@ -601,6 +601,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
22 goto err;
23 }
24
25 + /* Store name of configuration node as u-boot,bootconf in /chosen node */
26 + if (images->fit_uname_cfg)
27 + fdt_find_and_setprop(blob, "/chosen", "u-boot,bootconf",
28 + images->fit_uname_cfg,
29 + strlen(images->fit_uname_cfg) + 1, 1);
30 +
31 /* Update ethernet nodes */
32 fdt_fixup_ethernet(blob);
33 #if CONFIG_IS_ENABLED(CMD_PSTORE)
34 --
35 2.35.3
36