76e272a2c94b4c3dbc92903a7f803463c90b2cd5
[openwrt/staging/blogic.git] /
1 From patchwork Mon Mar 21 23:22:23 2022
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
6 X-Patchwork-Id: 1607954
7 Return-Path: <u-boot-bounces@lists.denx.de>
8 X-Original-To: incoming@patchwork.ozlabs.org
9 Delivered-To: patchwork-incoming@bilbo.ozlabs.org
10 Date: Mon, 21 Mar 2022 23:22:23 +0000
11 From: Daniel Golle <daniel@makrotopia.org>
12 To: u-boot@lists.denx.de
13 Cc: Simon Glass <sjg@chromium.org>, Alexandru Gagniuc <mr.nuke.me@gmail.com>,
14 Patrick Delaunay <patrick.delaunay@foss.st.com>,
15 Heinrich Schuchardt <xypron.glpk@gmx.de>
16 Subject: [PATCH] image-fdt: save name of FIT configuration in '/chosen' node
17 Message-ID: <YjkIr8wmz1XEOVNh@makrotopia.org>
18 MIME-Version: 1.0
19 Content-Disposition: inline
20 X-BeenThere: u-boot@lists.denx.de
21 X-Mailman-Version: 2.1.39
22 Precedence: list
23 List-Id: U-Boot discussion <u-boot.lists.denx.de>
24 List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
25 <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
26 List-Archive: <https://lists.denx.de/pipermail/u-boot/>
27 List-Post: <mailto:u-boot@lists.denx.de>
28 List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
29 List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
30 <mailto:u-boot-request@lists.denx.de?subject=subscribe>
31 Errors-To: u-boot-bounces@lists.denx.de
32 Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
33
34 It can be useful for the OS (Linux) to know which configuration has
35 been chosen by U-Boot when launching a FIT image.
36 Store the name of the FIT configuration node used in a new string
37 attribute called 'bootconf' in the '/chosen' node in device tree.
38
39 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
40 ---
41 boot/image-fdt.c | 6 ++++++
42 1 file changed, 6 insertions(+)
43
44 diff --git a/boot/image-fdt.c b/boot/image-fdt.c
45 index 692a9ad3e4..4017bc94a6 100644
46 --- a/boot/image-fdt.c
47 +++ b/boot/image-fdt.c
48 @@ -601,6 +601,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
49 goto err;
50 }
51
52 + /* Store name of configuration node as bootconf in /chosen node */
53 + if (images->fit_uname_cfg)
54 + fdt_find_and_setprop(blob, "/chosen", "bootconf",
55 + images->fit_uname_cfg,
56 + strlen(images->fit_uname_cfg) + 1, 1);
57 +
58 /* Update ethernet nodes */
59 fdt_fixup_ethernet(blob);
60 #if CONFIG_IS_ENABLED(CMD_PSTORE)