From patchwork Mon Mar 21 23:22:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 1607954 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Date: Mon, 21 Mar 2022 23:22:23 +0000 From: Daniel Golle To: u-boot@lists.denx.de Cc: Simon Glass , Alexandru Gagniuc , Patrick Delaunay , Heinrich Schuchardt Subject: [PATCH] image-fdt: save name of FIT configuration in '/chosen' node Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- 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)