From patchwork Tue Apr 12 20:00:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 1616442 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KdGn91b9tz9sBJ for ; Wed, 13 Apr 2022 06:01:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1A9F483E12; Tue, 12 Apr 2022 22:00:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 37E6B83E5C; Tue, 12 Apr 2022 22:00:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1A75C83DD7 for ; Tue, 12 Apr 2022 22:00:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=daniel@makrotopia.org Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.94.2) (envelope-from ) id 1neMh1-0001fB-5V; Tue, 12 Apr 2022 22:00:51 +0200 Date: Tue, 12 Apr 2022 21:00:43 +0100 From: Daniel Golle To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Tom Rini Subject: [PATCH v2] 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" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean 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 property called 'u-boot,bootconf' in the '/chosen' node in device tree. Signed-off-by: Daniel Golle Reviewed-by: Tom Rini --- v2: change node name to 'u-boot,bootconf' instead of just 'bootconf' Sibling PR to dt-schema: https://github.com/devicetree-org/dt-schema/pull/71 boot/image-fdt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/boot/image-fdt.c b/boot/image-fdt.c index 692a9ad3e4..fdb69926a2 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 u-boot,bootconf in /chosen node */ + if (images->fit_uname_cfg) + fdt_find_and_setprop(blob, "/chosen", "u-boot,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)