From patchwork Thu Aug 17 05:48:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 714383 Delivered-To: patch@linaro.org Received: by 2002:a5d:4012:0:b0:317:ecd7:513f with SMTP id n18csp2739762wrp; Wed, 16 Aug 2023 22:49:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyIme2FNm53aJ8iEqhvd5WWBWlUOz96FiZXRPx92tBrUdX/wcsFUOB8RP5f6t7NwYE7l2E X-Received: by 2002:adf:f2ca:0:b0:313:fe1b:f441 with SMTP id d10-20020adff2ca000000b00313fe1bf441mr2910139wrp.29.1692251364261; Wed, 16 Aug 2023 22:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692251364; cv=none; d=google.com; s=arc-20160816; b=B5Rce4joUf0rz92/IAOq4iJHJB90gAPbooaPsQ5jeUxNMB660tYT9G20FNeXM1FSwo vrAP3HQGcGq+64wn7CtBjq3d4osmcZwziXgEZr5GJHy1NazN/qurIh9vuGIjB7gk9TDp ir6SWhxlMOPgFlm7sBB1Q823AuTsjKJKRZmLRAlBzQXhTHI5NR68AcS6dTN66ghWr7Eb E216zlqXmvCX5GSfXQgj7c4oeXGzHnB9H/1LM1r7Vbm/de1VWQZ6/DBTxUWQsYuXfONn q91ubrTKFVASVJHoC6TR2r2z49leMWPWe7tgyt8cw4UzgwL3xE1TF3y2AyfDBzWQqxgM 5x+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=cX4LRKOPsFg0MGAXnFf/2wkQCA0XfY3FeRl7uIn+E5w=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=p/fXkubC25SA3C3acCtdqCqPxpC4CSvy2sJb1N+deeDMG1CpwDQ1FAuF6eSpn4TQPb JiyWte9dYscFs0dXDLMVxOILkCFNNzS2LLQl+LUGXEIceztdKGTapaXzjxX8eVFouymP ZJ4J+Oh7+U2fYTK026x2+uAb7DYRay2WNOHAY0mqLHqbAUHxEpaVIHwBfn9F91W7vFTA fF+iQAfd4bckxvi7O5A4IoCc0idAtxRM9pyL67ZBk+wIfmBGiDfhE6STi0680XDCJN7f 6zbFsyXwcdkTx9w4v2QctBoQFSy9HUqIYoD7mzbEI9akvvuKSUpvbmCSUbdcXJGbGdI8 AJNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id e15-20020a5d530f000000b00317df489cbcsi7509652wrv.158.2023.08.16.22.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 22:49:24 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9AA5386A5F; Thu, 17 Aug 2023 07:49:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.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 BD43086A5D; Thu, 17 Aug 2023 07:49:16 +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.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 21E6586979 for ; Thu, 17 Aug 2023 07:49:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 53C97D75; Wed, 16 Aug 2023 22:49:54 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.46.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2837E3F762; Wed, 16 Aug 2023 22:49:10 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Tom Rini , Sughosh Ganu Subject: [PATCH v2 1/6] scripts/Makefile.lib: Collate all dtsi files for inclusion Date: Thu, 17 Aug 2023 11:18:51 +0530 Message-Id: <20230817054856.2019253-2-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230817054856.2019253-1-sughosh.ganu@linaro.org> References: <20230817054856.2019253-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean At the time of building a device-tree file, all the *u-boot.dtsi files are looked for, in a particular order, and the first file found is included. Then, the list of files specified in the CONFIG_DEVICE_TREE_INCLUDES symbol are included. Combine these files that are to be included into a variable, and then include all these files in one go. Signed-off-by: Sughosh Ganu Reviewed-by: Tom Rini Acked-by: Ilias Apalodimas --- Changes since V1: None scripts/Makefile.lib | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index f5ab7af0f4..368b5a3e28 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -179,10 +179,13 @@ ifdef DEVICE_TREE_DEBUG u_boot_dtsi_options_debug = $(warning $(u_boot_dtsi_options_raw)) endif -# We use the first match -u_boot_dtsi = $(strip $(u_boot_dtsi_options_debug) \ +# We use the first match to be included +dtsi_include_list = $(strip $(u_boot_dtsi_options_debug) \ $(notdir $(firstword $(u_boot_dtsi_options)))) +# The CONFIG_DEVICE_TREE_INCLUDES also need to be included +dtsi_include_list += $(CONFIG_DEVICE_TREE_INCLUDES) + # Modified for U-Boot dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \ $(UBOOTINCLUDE) \ @@ -320,8 +323,8 @@ quiet_cmd_dtc = DTC $@ # Bring in any U-Boot-specific include at the end of the file # And finally any custom .dtsi fragments specified with CONFIG_DEVICE_TREE_INCLUDES cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ - (cat $<; $(if $(u_boot_dtsi),echo '$(pound)include "$(u_boot_dtsi)"')) > $(pre-tmp); \ - $(foreach f,$(subst $(quote),,$(CONFIG_DEVICE_TREE_INCLUDES)), \ + (cat $< > $(pre-tmp)); \ + $(foreach f,$(subst $(quote),,$(dtsi_include_list)), \ echo '$(pound)include "$(f)"' >> $(pre-tmp);) \ $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $(pre-tmp) ; \ $(DTC) -O dtb -o $@ -b 0 \ From patchwork Thu Aug 17 05:48:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 714384 Delivered-To: patch@linaro.org Received: by 2002:a5d:4012:0:b0:317:ecd7:513f with SMTP id n18csp2739793wrp; Wed, 16 Aug 2023 22:49:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXQswG3pwVBUej9P2JAS8WeXAFDu/q6ViJ7C8Ov86t5+mTWghHkOpB6MwfTT/FBnSBPtKD X-Received: by 2002:adf:ee84:0:b0:317:606d:c767 with SMTP id b4-20020adfee84000000b00317606dc767mr2865797wro.44.1692251372991; Wed, 16 Aug 2023 22:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692251372; cv=none; d=google.com; s=arc-20160816; b=wuYnNABp3vA8kX5fJHk70LPkEqf/SeAak28lDZAbUjDaOd9MB9+nh6IZXJuzUOelUt uS83d6RUj6h/IMOxJFDkagbvPuaPalviBL6OJQ7L1V0vKirOrJ4NGpHD4zJX6//dgVNs hNrE1YgOv4XrvT1scGzKDY5In9j5xdNqTux3he/i4eNYJ1D2RbivBVwfrUrREmK1yvoJ bIsN8HfzrZMS6t/7+G6zald/V805oM9SeOeS18AI6w1XmvaAcOPKHazI6LuouK5R1rfT TCRxfKba0E8ew0Ng1Vff95VNB5XwfN8vx1aSuDzimpkl1fb6UUquFWqBz7YSrIxnpw+U gODQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=eUd+5IbIEyhOxFgd84rZLX8d34d7ENmrPtyfTPhN8/c=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=mbmI9aDFpuSfNDPKkRJxhdOoo7sEJab/pdPu52zirCp2eWYVtBUxmamv460SAhG5N5 Jh10WtmrxloADv6IXRXQfA062FVkEl+xxRUOLcnXhIQJW4i2D1Hzt3kOkv55uWnd/vQ2 OAaZjbe73WUbA0zHvFHp+n6pfMKtQ4oPTgGuB7BRhpqYhzIVIdirR0GaV2ZVv8E3rtOt ihOEOPdVQooOkYY3NYL9lNYijV3PCqWqV/B84qCL0t0qcD6PN7XNuWujO8ulu5UiJc8X CB8Jrlfngx0ZDbUvRoxLaIiW/ZK710lJ9sZ3cy4hAenOAcEk038c/yNoutC1dL+oFIZk Yt8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id k5-20020a5d66c5000000b00317f3fd21b6si8006159wrw.477.2023.08.16.22.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 22:49:32 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD66F86A77; Thu, 17 Aug 2023 07:49:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.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 753DB86979; Thu, 17 Aug 2023 07:49:19 +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.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id D4B5386979 for ; Thu, 17 Aug 2023 07:49:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 34599D75; Wed, 16 Aug 2023 22:49:57 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.46.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 08D263F762; Wed, 16 Aug 2023 22:49:13 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Tom Rini , Sughosh Ganu Subject: [PATCH v2 2/6] scripts/Makefile.lib: Add dtsi include files as deps for building DTB Date: Thu, 17 Aug 2023 11:18:52 +0530 Message-Id: <20230817054856.2019253-3-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230817054856.2019253-1-sughosh.ganu@linaro.org> References: <20230817054856.2019253-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean At the time of building the DTB, some dtsi files can be selected for inclusion. Have these dtsi files as dependencies for the DTB target. This also ensures generation or updating the dtsi files if need be. Signed-off-by: Sughosh Ganu Acked-by: Ilias Apalodimas Reviewed-by: Tom Rini --- Changes since V1: * New patch which only sets the dependencies for the dtb build. scripts/Makefile.lib | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 368b5a3e28..8c5e25c31c 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -334,7 +334,9 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ ; \ sed "s:$(pre-tmp):$(<):" $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) -$(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE +dtsi_include_list_deps = $(addprefix $(obj)/,$(subst $(quote),,$(dtsi_include_list))) + +$(obj)/%.dtb: $(src)/%.dts $(DTC) $(dtsi_include_list_deps) FORCE $(call if_changed_dep,dtc) pre-tmp = $(subst $(comma),_,$(dot-target).pre.tmp) From patchwork Thu Aug 17 05:48:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 714385 Delivered-To: patch@linaro.org Received: by 2002:a5d:4012:0:b0:317:ecd7:513f with SMTP id n18csp2739823wrp; Wed, 16 Aug 2023 22:49:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCX1UXnckQ/eqqyHpQ+OF1+3rA9kHj4gAO0a2pC5N9v9z9+t0GIHjY8LxD0EoOyJT0OfGA X-Received: by 2002:adf:ed0c:0:b0:319:8444:939f with SMTP id a12-20020adfed0c000000b003198444939fmr3108125wro.32.1692251381713; Wed, 16 Aug 2023 22:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692251381; cv=none; d=google.com; s=arc-20160816; b=tJMaqyYHUXtAyu6oA+RD5HqGZiDmmQkAf3S3MqWwDThNXntTLIoWafepvySR4h/6R9 8zJb99leeQGPM7lbEE9+rqZQfGb/VKIjrFZSfYGsSOD3jyLnoVLYIP5kLZ1iXsv5XvT1 EURX9Opbkcfg4wRP1PXDWJEnmjx25eEkEs72Ik6TRC/AThji6vWyYMPBkV5pE3ZLEvgG 7oifuJNdu57fDn+Gr4Otn4WgickMJOOTuw59zzsgWUMMI9ac5IsaetajzDccv+uzR1HU c7afWsiew9E6OaIxdd96YcY/ywMek2BWQz/mPrUlMSdcDtpVLrAHjbrBQuPNwxIQ15qq uk9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=yEyF12UTXCNWjGN9LOMl96muwqZRU9y5+2EQvY87v/w=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=skhcXk2tVUSP4Pa7LeXB83eCMRbxvpluiA/fa6+hg0ZQ5YhRDXyh39NUSEDliSXFn2 KrtGOuECI8ovFnbJOgTLt0GLaT/ggvL75Sx5ctq466q+KrW9hQRUZrf7GXVXO9ZSyHai 5/mmiBKYrbf8tZFE/hqkqugfUQPfXFHxgrlTaEawPyCFvZiyF3nrITT3FSWdS9HU7MMm BgsR4SjLEHZrXR5I/k0sMAB1xNLuZQGCAGaiJHKtaLPvWPBvGfz0VXdZTmOLZR8WZdBH Nvo9uIDRuvSWiW8xXTmtRoGg6LdNSqWKtLbSoaEWK3u+XhtIUol6nEXEmMUVtMPlL8YQ 0Whw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id r4-20020adfce84000000b003180f5b89aesi5200815wrn.131.2023.08.16.22.49.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 22:49:41 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 28D7686A75; Thu, 17 Aug 2023 07:49:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.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 E8B2F86A6B; Thu, 17 Aug 2023 07:49:23 +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.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id BFB3086A75 for ; Thu, 17 Aug 2023 07:49:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 14DE8D75; Wed, 16 Aug 2023 22:50:00 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.46.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DD6A83F762; Wed, 16 Aug 2023 22:49:16 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Tom Rini , Sughosh Ganu Subject: [PATCH v2 3/6] scripts/Makefile.lib: Embed capsule public key in platform's dtb Date: Thu, 17 Aug 2023 11:18:53 +0530 Message-Id: <20230817054856.2019253-4-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230817054856.2019253-1-sughosh.ganu@linaro.org> References: <20230817054856.2019253-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean The EFI capsule authentication logic in u-boot expects the public key in the form of an EFI Signature List(ESL) to be provided as part of the platform's dtb. Currently, the embedding of the ESL file into the dtb needs to be done manually. Add a target for generating a dtsi file which contains the signature node with the ESL file included as a property under the signature node. Include the dtsi file in the dtb. This brings the embedding of the ESL in the dtb into the U-Boot build flow. The path to the ESL file is specified through the CONFIG_EFI_CAPSULE_ESL_FILE symbol. Signed-off-by: Sughosh Ganu Reviewed-by: Tom Rini --- Changes since V1: * Put only the setting of dtsi_include_list under the ifdef, moving the rest of the logic out of the ifdef. lib/efi_loader/Kconfig | 8 ++++++++ lib/efi_loader/capsule_esl.dtsi.in | 11 +++++++++++ scripts/Makefile.lib | 15 +++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 lib/efi_loader/capsule_esl.dtsi.in diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 9989e3f384..d20aaab6db 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -272,6 +272,14 @@ config EFI_CAPSULE_MAX Select the max capsule index value used for capsule report variables. This value is used to create CapsuleMax variable. +config EFI_CAPSULE_ESL_FILE + string "Path to the EFI Signature List File" + depends on EFI_CAPSULE_AUTHENTICATE + help + Provides the path to the EFI Signature List file which will + be embedded in the platform's device tree and used for + capsule authentication at the time of capsule update. + config EFI_DEVICE_PATH_TO_TEXT bool "Device path to text protocol" default y diff --git a/lib/efi_loader/capsule_esl.dtsi.in b/lib/efi_loader/capsule_esl.dtsi.in new file mode 100644 index 0000000000..61a9f2b25e --- /dev/null +++ b/lib/efi_loader/capsule_esl.dtsi.in @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0+ +/** + * Devicetree file with the public key EFI Signature List(ESL) + * node. This file is used to generate the dtsi file to be + * included into the DTB. +*/ +/ { + signature { + capsule-key = /incbin/("ESL_BIN_FILE"); + }; +}; diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 8c5e25c31c..3cec46bb15 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -334,6 +334,21 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ ; \ sed "s:$(pre-tmp):$(<):" $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) +quiet_cmd_capsule_esl_gen = CAPSULE_ESL_GEN $@ +cmd_capsule_esl_gen = \ + $(shell sed "s:ESL_BIN_FILE:$(capsule_esl_path):" $(capsule_esl_input_file) > $@) + +$(obj)/.capsule_esl.dtsi: + $(call cmd_capsule_esl_gen) + +capsule_esl_input_file=$(srctree)/lib/efi_loader/capsule_esl.dtsi.in +capsule_esl_dtsi = .capsule_esl.dtsi +capsule_esl_path=$(abspath $(srctree)/$(subst $(quote),,$(CONFIG_EFI_CAPSULE_ESL_FILE))) + +ifdef CONFIG_EFI_CAPSULE_AUTHENTICATE +dtsi_include_list += $(capsule_esl_dtsi) +endif + dtsi_include_list_deps = $(addprefix $(obj)/,$(subst $(quote),,$(dtsi_include_list))) $(obj)/%.dtb: $(src)/%.dts $(DTC) $(dtsi_include_list_deps) FORCE From patchwork Thu Aug 17 05:48:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 714386 Delivered-To: patch@linaro.org Received: by 2002:a5d:4012:0:b0:317:ecd7:513f with SMTP id n18csp2739863wrp; Wed, 16 Aug 2023 22:49:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFS+G7DdjOKnVRF4lVDCLhpgICZgBGxC3ckzUMbLW266QenETAK9TR9TDQgjh4NLUZlppp0 X-Received: by 2002:a5d:4b4f:0:b0:31a:dbe0:ca7d with SMTP id w15-20020a5d4b4f000000b0031adbe0ca7dmr23193wrs.8.1692251391219; Wed, 16 Aug 2023 22:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692251391; cv=none; d=google.com; s=arc-20160816; b=yrh1FhU75Du+JotEDjXIaGIWJPaPVAHe4+NMfSppgaKF08wJnJMHxXuPmJa3sdY69R hwMFpq9NJXHkqStP/SWtOqmsQrovkow9xolyDsdwPk2qnMbPWGDoIR9i4VpzQfzTGMtl nGD44huRi7+tD2cldzXXAR5pHNj/LrlCAhibX9D0TpCxHSx1993+dr0pHERZJtru4rqM zzPRp0v07/bM3Q/0/5Kbe/fafgtDQ2rtiYspaoqXf70cPQkqmRgDy43OurV801CwBqKL 1vExYP84UksjTsjOeYtPIFYYJaGG7EzXfWGRVeDns6KoDbE7XqQRbJtSmYYtievk6Cfp CHIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=tuGK+VcF85lYYNvby1UOnW1TKPrUN756t1aYXkm4uzk=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=HuDCN0Gu6Tfp27VJtPXL5SLn6LtzWnSyniRcA58N05PjwxndvnabyO5ZNF8GfNGiLK F2g5LSf4+uB+SNOz5UgxxpmJJZlHQ1hsy9YqExnU6TiHgq3TGZxZw57XQI3oP/QOP0Co rOuw2DynLWgpY6UNXGhm/0gOO/dcgR/ghx3t+hkMDIxsOjj7nRQpS4OwSlF3Dl64GyTy owyHYimzD1mqgC06nfPVVgM+l+3UV4rYNXL5+bQ8gywpC4ts8FxzJFi+91+2ANMyGIiA BzCl4ovpEcFeIdz1r3tqbM6BsBcu1Gd7A60qZzdkRueKtCP+Pbw1+mYO7I/BMLAcpXY4 Dobw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id b5-20020adfde05000000b00317ab757481si8299746wrm.880.2023.08.16.22.49.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 22:49:51 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6B8C286A83; Thu, 17 Aug 2023 07:49:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.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 5791B86A80; Thu, 17 Aug 2023 07:49:25 +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.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id B800186979 for ; Thu, 17 Aug 2023 07:49:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EA16AD75; Wed, 16 Aug 2023 22:50:02 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.46.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BDEF83F762; Wed, 16 Aug 2023 22:49:19 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Tom Rini , Sughosh Ganu Subject: [PATCH v2 4/6] sandbox: capsule: Add path to the public key ESL file Date: Thu, 17 Aug 2023 11:18:54 +0530 Message-Id: <20230817054856.2019253-5-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230817054856.2019253-1-sughosh.ganu@linaro.org> References: <20230817054856.2019253-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Add the path to the public key EFI Signature List(ESL) file for the sandbox variants which enable capsule authentication. This ESL file gets embedded into the platform's device-tree as part of the build. Signed-off-by: Sughosh Ganu --- Changes since V1: None configs/sandbox_defconfig | 1 + configs/sandbox_flattree_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 1cd1c2ed7c..9f349d482b 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -340,6 +340,7 @@ CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y CONFIG_EFI_CAPSULE_ON_DISK=y CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y CONFIG_EFI_CAPSULE_AUTHENTICATE=y +CONFIG_EFI_CAPSULE_ESL_FILE="board/sandbox/capsule_pub_esl_good.esl" CONFIG_EFI_SECURE_BOOT=y CONFIG_TEST_FDTDEC=y CONFIG_UNIT_TEST=y diff --git a/configs/sandbox_flattree_defconfig b/configs/sandbox_flattree_defconfig index 8aa295686d..2a24b38cfb 100644 --- a/configs/sandbox_flattree_defconfig +++ b/configs/sandbox_flattree_defconfig @@ -227,6 +227,7 @@ CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y CONFIG_EFI_CAPSULE_ON_DISK=y CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y CONFIG_EFI_CAPSULE_AUTHENTICATE=y +CONFIG_EFI_CAPSULE_ESL_FILE="board/sandbox/capsule_pub_esl_good.esl" CONFIG_UNIT_TEST=y CONFIG_UT_TIME=y CONFIG_UT_DM=y From patchwork Thu Aug 17 05:48:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 714387 Delivered-To: patch@linaro.org Received: by 2002:a5d:4012:0:b0:317:ecd7:513f with SMTP id n18csp2739924wrp; Wed, 16 Aug 2023 22:50:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFKzdJDVjfMsv/EvY8jRHlnUfbyM9p8B33t2Am/ihyhF/FjSY2x8bgc1oofyEAk7tswURib X-Received: by 2002:adf:ed05:0:b0:317:7362:3fe8 with SMTP id a5-20020adfed05000000b0031773623fe8mr3226225wro.9.1692251400783; Wed, 16 Aug 2023 22:50:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692251400; cv=none; d=google.com; s=arc-20160816; b=WhdkeEv1ylV8kZkv6j4QOYgj6Lv3LG7qb12LuvfFmYGJ1rT7ffyu6Plg/zOYqRlVR+ du3LWycf1qhX6DEMkuvlb6Lz/fR4NkhGqhHrPDNY99attTn6sfjQoHddoatmol4jbPwo FhkzYZHHnr3jje0Y2+wmMvgLd2wyFnkmJmvR1MRLSlvIzc1/v93uKILmLjpp8zPvT54U PaMEUz0G1WkgXsqewJfQ1w2wKL1ZNtM2KnEHyqo9/ob2QYxEF2pIiuCCqNjKkzdcZFai WF7Lh7r+eDq+IkLpWpTyqaKPakRDFo2urO1aTGOkNsNDTqZx/JEx2WAcyHc8+THroo/5 15lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=zuEGMyKBiQ6G27Wd+ypOZ6gJc1z6ThU9vLfLj2Wzx/E=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=JjtruL4D5x6lEQ8KeIoKUz4QMIURkFIfEV2wTIW8QiQvlHVzsHwzCCsX9dgioX35gT G5ELByrVLLsSnzaQBdjQXsq4SEhwTs+SbGyGj4vaW7+GepW4XMK5cHLSKVXuYaP8wpGt AzG4m5r7wuf91vQXKvrendC/TnqIq/tG929B89Dcr93aN+7GlXcojmZ6PuZiOMgoBcuQ EvrJG8hHGANCXcKrIZ6zC0BmCSF15al0hFo9RihR9nYXZ4BDL36I2XRXpGROSSnvYXZw SRreleK+/lG6KbwhiBKqThzP2GS0L/qngbK+pMOi1EmoHeCgIuKJizYMn5NXedjsLhVL hltw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id k11-20020adff28b000000b0031a2487a14esi1910929wro.994.2023.08.16.22.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 22:50:00 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ADC6486A68; Thu, 17 Aug 2023 07:49:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.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 5D2A686A8E; Thu, 17 Aug 2023 07:49:28 +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.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 89E8286979 for ; Thu, 17 Aug 2023 07:49:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C9E5AD75; Wed, 16 Aug 2023 22:50:05 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.46.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9E4BB3F762; Wed, 16 Aug 2023 22:49:22 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Tom Rini , Sughosh Ganu Subject: [PATCH v2 5/6] test: capsule: Remove logic to add public key ESL Date: Thu, 17 Aug 2023 11:18:55 +0530 Message-Id: <20230817054856.2019253-6-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230817054856.2019253-1-sughosh.ganu@linaro.org> References: <20230817054856.2019253-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean The public key EFI Signature List(ESL) needed for capsule authentication is now embedded into the platform's DTB as part of the build. Remove the superfluous logic from the test setup. Signed-off-by: Sughosh Ganu --- Changes since V1: None test/py/tests/test_efi_capsule/conftest.py | 28 +++++--------------- test/py/tests/test_efi_capsule/signature.dts | 10 ------- 2 files changed, 7 insertions(+), 31 deletions(-) delete mode 100644 test/py/tests/test_efi_capsule/signature.dts diff --git a/test/py/tests/test_efi_capsule/conftest.py b/test/py/tests/test_efi_capsule/conftest.py index 7eead9bc64..67761a9708 100644 --- a/test/py/tests/test_efi_capsule/conftest.py +++ b/test/py/tests/test_efi_capsule/conftest.py @@ -49,33 +49,19 @@ def efi_capsule_data(request, u_boot_config): check_call('cp %s/capsule_pub_key_bad.crt %s/SIGNER2.crt' % (key_dir, data_dir), shell=True) - # Update dtb adding capsule certificate - check_call('cd %s; ' - 'cp %s/test/py/tests/test_efi_capsule/signature.dts .' - % (data_dir, u_boot_config.source_dir), shell=True) + if capsule_auth_enabled: check_call('cd %s; ' - 'dtc -@ -I dts -O dtb -o signature.dtbo signature.dts; ' - 'fdtoverlay -i %s/arch/sandbox/dts/test.dtb ' - '-o test_sig.dtb signature.dtbo' + 'cp %s/arch/sandbox/dts/test.dtb test_sig.dtb' % (data_dir, u_boot_config.build_dir), shell=True) - # Update dtb to add the version information check_call('cd %s; ' 'cp %s/test/py/tests/test_efi_capsule/version.dts .' % (data_dir, u_boot_config.source_dir), shell=True) - if capsule_auth_enabled: - check_call('cd %s; ' - 'dtc -@ -I dts -O dtb -o version.dtbo version.dts; ' - 'fdtoverlay -i test_sig.dtb ' - '-o test_ver.dtb version.dtbo' - % (data_dir), shell=True) - else: - check_call('cd %s; ' - 'dtc -@ -I dts -O dtb -o version.dtbo version.dts; ' - 'fdtoverlay -i %s/arch/sandbox/dts/test.dtb ' - '-o test_ver.dtb version.dtbo' - % (data_dir, u_boot_config.build_dir), shell=True) - + check_call('cd %s; ' + 'dtc -@ -I dts -O dtb -o version.dtbo version.dts; ' + 'fdtoverlay -i %s/arch/sandbox/dts/test.dtb ' + '-o test_ver.dtb version.dtbo' + % (data_dir, u_boot_config.build_dir), shell=True) check_call('cp %s/u-boot_bin_env.itb %s ' % (u_boot_config.build_dir, data_dir), shell=True) check_call('cp %s/Test* %s ' % (u_boot_config.build_dir, data_dir), shell=True) diff --git a/test/py/tests/test_efi_capsule/signature.dts b/test/py/tests/test_efi_capsule/signature.dts deleted file mode 100644 index 078cfc76c9..0000000000 --- a/test/py/tests/test_efi_capsule/signature.dts +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/dts-v1/; -/plugin/; - -&{/} { - signature { - capsule-key = /incbin/("SIGNER.esl"); - }; -}; From patchwork Thu Aug 17 05:48:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 714388 Delivered-To: patch@linaro.org Received: by 2002:a5d:4012:0:b0:317:ecd7:513f with SMTP id n18csp2739980wrp; Wed, 16 Aug 2023 22:50:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6du5alp9P4d2nugcRcurzMT8Bkd8MLHHn4FzWyVgCXUSpOQWAa+Od9557iO87Ntma3j89 X-Received: by 2002:a05:6000:18a:b0:319:7295:311 with SMTP id p10-20020a056000018a00b0031972950311mr2860558wrx.10.1692251410576; Wed, 16 Aug 2023 22:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692251410; cv=none; d=google.com; s=arc-20160816; b=v/pXbxDMx9OUCCU2Vlwat0lfxlUZeVZhx2EeSnsQujNZIml6Md0edfYKAHtim5sBaS uimhd2+HQiZAp8hBczWDCAC09ZNCC5s6Ph/FVPVn14XVdAt2Vz/1H7XBX1U/7bBDbvmV 6hqDg4/5eXHxGj/4xIXoFKs3Kzf2oAo27EhfHWqw6owSg9jWoOE3ZgPHAbDVg3KnNi7f qt354MYo7RJB1oGzPSY36qsGZqPV8b3aektR9WQuHUN8HNZ/EQ5pUCwGUx+bFboaXhzC NifQ+qpS1obAiPRxfPqO3ReB6CYjbITwqjLfDPThkfNGXIxoxN6nAlJLmjTJHFup7odu 3vhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=ie0IwtLMPfp67F75ivmbwh4WfLO4cuVkDuGfj6Vwu9g=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=y4mg+sHj9O4Av1k/3KOqy0PNFtbrI6wJhilWX2HM1BKbR947ZsbvSXFt09Vnhz3UVi tx22tsU23+VVEmpt+K9IyDEgLV6NNkvgh2x72wm/NCOQX/E9EHGOnS9DHbWFGPM/s/Cb +hh35zEtS9ns4+Rhja0QFYp4gNnihhDbJ9uCIAW93hbI/qfl8UPBmDSyD1Eg0JgSc7zj o6vWNEcC1W93SnQe3bkWVXJ4z+iz3Wa2IKA0hyqIjsgB0ksZxCROZY28tq6aSzBGrclw 3dtVYkxTeKJ1bu6WX8zHbrJShf+4ruMdgNKMtQBs/MbP9xD9dXNzwSeNtP4ISpL+JcDa ZGqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id k12-20020a056000004c00b00319718e9515si4960556wrx.401.2023.08.16.22.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 22:50:10 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F389D86A18; Thu, 17 Aug 2023 07:49:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.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 2A32D86A5D; Thu, 17 Aug 2023 07:49:31 +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.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 790B386A18 for ; Thu, 17 Aug 2023 07:49:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AB0E9D75; Wed, 16 Aug 2023 22:50:08 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.46.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7EB6F3F762; Wed, 16 Aug 2023 22:49:25 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Tom Rini , Sughosh Ganu Subject: [PATCH v2 6/6] doc: capsule: Document the new mechanism to embed ESL file into dtb Date: Thu, 17 Aug 2023 11:18:56 +0530 Message-Id: <20230817054856.2019253-7-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230817054856.2019253-1-sughosh.ganu@linaro.org> References: <20230817054856.2019253-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Update the document to specify how the EFI Signature List(ESL) file can be embedded into the platform's dtb as part of the U-Boot build. Signed-off-by: Sughosh Ganu --- Changes since V1: None doc/develop/uefi/uefi.rst | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst index 3ce579d46e..950f4d1a5a 100644 --- a/doc/develop/uefi/uefi.rst +++ b/doc/develop/uefi/uefi.rst @@ -539,20 +539,11 @@ and used by the steps highlighted below. ... } -You can do step-4 manually with - -.. code-block:: console - - $ dtc -@ -I dts -O dtb -o signature.dtbo signature.dts - $ fdtoverlay -i orig.dtb -o new.dtb -v signature.dtbo - -where signature.dts looks like:: - - &{/} { - signature { - capsule-key = /incbin/("CRT.esl"); - }; - }; +You can perform step-4 by defining the Kconfig symbol +CONFIG_EFI_CAPSULE_ESL_FILE. This symbol defines the path to the esl +file generated in step-2. Once the symbol has been populated with the +path to the esl file, the esl file will automatically get embedded +into the platform's dtb as part of U-Boot build. Anti-rollback Protection ************************