From patchwork Mon Aug 21 07:29:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 715362 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp1698771wrs; Mon, 21 Aug 2023 00:29:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFi190Xz/5K5YB8AnwI9ogBg+j6igqxgjeFJLAGd8W/K/uT0x8iTPpbkABdIb8YDLAUS0XD X-Received: by 2002:adf:f7c9:0:b0:313:eaf5:515 with SMTP id a9-20020adff7c9000000b00313eaf50515mr3726333wrq.6.1692602982976; Mon, 21 Aug 2023 00:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692602982; cv=none; d=google.com; s=arc-20160816; b=aQvwx80AMIu0uqYVIFy8xPnYWF6haIFn+QSvp9/pW/01ippgnZwZbS+qeUUADCUmVT 92O6F45wzFheVA8cJkSCJuGSYbt8kF9yiUoPxSDRvBdjzgzDBXnDV6CbSdf/1bmVLusS V8fQKZXMXW8DCkFTTJMkK2UHs3Xupg0DiNv98bVSHnSnDMkEVz1NFhrHD1OqtwRFuDl7 lVQhfg9n/mSSwojSqMbFq+Cmm7Ka6kSDq0IchUSdfLDP/ztVO/BblKFFmYj5ClDGW0ed nYF0ryI/sakvKEy/MTlrHFSPOvgu393bJ11Zd/u9yiuQx1+tRdfBSp/T7nn3djmY49rK jupA== 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=6HlS/On3fR84RRCTNrzkZWV8AZlgc2+9LhIrAokn24Y=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=oHshLnighXjhSYt/BHeY8c8UV54ZEJvQt7fdAHPKHVd5t9nXzG3tfIycW2G30Zx4oS wRGPOF0yelVcxwZVDnZd4h6/jos84P1UH2qU4uA9hYn6v2X71jybfDF3WfTmooKWrJ9J GiRVZ9SpmpV0LZA/IfrtVs88W8VHWzLpuWj8TxqttwsLVtgXaQzS1Be21HgNxWR5wr8h dSosYlCZ3he2jFXcNn3fJ/D0PVoUX7yX7aVJVdQkwBdLqMrM/bEwAa6/HLxDL+GY33v4 xWCitx94eBsMmgiXfK+DMaSqlcE9yzw7q7oiNzJy1siRUXYnYN0/FPmwIRK9lJ+O9nBd cQUQ== 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 j8-20020adfe508000000b00317b3c71838si3480862wrm.55.2023.08.21.00.29.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 00:29:42 -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 F2BB08701B; Mon, 21 Aug 2023 09:29:33 +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 7600887015; Mon, 21 Aug 2023 09:29:32 +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 CADF18695F for ; Mon, 21 Aug 2023 09:29:29 +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 E93412F4; Mon, 21 Aug 2023 00:30:09 -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 EA81E3F740; Mon, 21 Aug 2023 00:29:26 -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 v3 1/6] scripts/Makefile.lib: Collate all dtsi files for inclusion Date: Mon, 21 Aug 2023 12:59:04 +0530 Message-Id: <20230821072909.2387400-2-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230821072909.2387400-1-sughosh.ganu@linaro.org> References: <20230821072909.2387400-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 V2: 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 Mon Aug 21 07:29:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 715363 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp1698836wrs; Mon, 21 Aug 2023 00:29:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTjzxxOJUbAb/w0zJRu8fWxEGup3rx7EmP6mUdBqlmqS3aS6aSguEZJor8lth3+628Sy98 X-Received: by 2002:a2e:8189:0:b0:2b9:5695:d10d with SMTP id e9-20020a2e8189000000b002b95695d10dmr4097987ljg.36.1692602993254; Mon, 21 Aug 2023 00:29:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692602993; cv=none; d=google.com; s=arc-20160816; b=Y7H3LRI7B5LMn42xdikR0KfmzYtDVzF3Pi8/ch7IuFcvXpVhLB7bxweYlu1rZWJVaX xL64WiBiVficWxRhMx4k9vWuvEqykPMfexPlO16qyf1PO3pQH1pjXOrzZ3307FqVI6+e YFcScQyQ5v2E+QF+2W3N+7d0m/cRGe+HtpXoWdFu9lZrpVeJYF5wJc5SsFzgI95l6x3U Jm4yn/eYghrV+gfPJ+Hu1Sr5gaMlxiLZvGhumjY98shnzM94vANrwFWVb02T6fszcSM8 4gGKgfiH4nloAl6hGaX7IOUszEq1IiSV39Ps3ohT8vs0AAWwCmKT5vEZ1hxG9AmVcI4W AEJA== 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=WD26qllDa4aiU232KsJQ4x4SVlNrGh6oJflQ23/JyIg=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=f5ahqw1Q0tFBuWHeheZGvm7UK8XHnw528AnjJWqoFgTcDPgu0vTwOSbrZQY1VYr083 +GbYVeUtPIw782wikAqaRrQA3180zB8OFPtQs6brPSsq42i2gnbRv2t7JXe2gcZXQt2Y RPCbpmnpsAkhB5CbVmniif46DIn1QxCQAk6ZitnX/7zPch9+Ggi+KQWFOVLpIn3EneaR n5SmjbQE4SiFqZFZoKS9nd/Tn8Pj1Us/OeO+NSKwmmyjaIjOgr617u4wm+jIpyxvBHv+ yPwSzhXleBrkOCVcV42GxI1s1ZqWpyym2MHZKlGTGJbpyeUcuEzkxG7GrK04+YxWmxrD H+DA== 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 o11-20020a5d684b000000b00317e6f756casi3637726wrw.148.2023.08.21.00.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 00:29:53 -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 412C487042; Mon, 21 Aug 2023 09:29:36 +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 1C6EE8702E; Mon, 21 Aug 2023 09:29:35 +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 7B0248695F for ; Mon, 21 Aug 2023 09:29:32 +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 B58312F4; Mon, 21 Aug 2023 00:30:12 -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 B63A83F740; Mon, 21 Aug 2023 00:29:29 -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 v3 2/6] scripts/Makefile.lib: Add dtsi include files as deps for building DTB Date: Mon, 21 Aug 2023 12:59:05 +0530 Message-Id: <20230821072909.2387400-3-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230821072909.2387400-1-sughosh.ganu@linaro.org> References: <20230821072909.2387400-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 V2: None 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 Mon Aug 21 07:29:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 715364 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp1698882wrs; Mon, 21 Aug 2023 00:30:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeOaV5bXlpGImby27IZxit4F5WizE2Ezi7dlITt/eWIuGPpEL4vd6DIGqhfmnU8ImtC9ym X-Received: by 2002:a7b:ce91:0:b0:3fe:2624:484e with SMTP id q17-20020a7bce91000000b003fe2624484emr4531975wmj.38.1692603002679; Mon, 21 Aug 2023 00:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692603002; cv=none; d=google.com; s=arc-20160816; b=e93RnzFw2AS3GyMrG77rWl/SuUkD+JggdgrU4WArAn8W3n0i7bkhFP5BucuRmm6fcc IqIO5XuqaDcdT6D+OAdpbBXKjg5/kEwruIy/6p9WX7T7tHPIVzenWI/Q4AquvXYcNogm YvF6ClCZCUaKQk6HVTOrPx0sJJZKuUnBqpkxbcltFnaKXSy4VLv44ovpRSKkmmFGH/3E H5aanmRsd3TLr3qQr2Xvnjz8qa4zl2zvTcHOUbBH8t0QCa6vT0D484kSn3xGY9A3RJhQ BLZNw2Mjn8LqclvvSd0svgFaOocvKRg/4TfItJHGTg+ihrAjgIg2kuAlMKPRCWypg6ul sgqw== 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=eBikWC47RzZrw9SL9lHHFlE3ShZiM8BocIMLFslp+Fk=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=fVBlz/TQqoVcdwvW7zcW3wosDAwcnSNgP/YP+BLrGfu9bBYlwmJXuU1NDnhYZp2kjN fwFTjZb2BBtXTK37VFZZuKfVNyAYXrMykJrxMRBRHGmbzyv9I9Vrxvr7uCU6UtUpUza3 D38xUMuSafnuXVbqTVQHKsdFadbCPGJtYwLzylmSX6xXjFusOqpEvAyZBKXRsYseqJBX 4y45qi75GpTiD4ZCiV9JAQmdliqce3E/VIyBY6+0EHgKqliryVUeWNYxx6d4R654Tmmr pxT5Mvrmxa6SyIZXvo4me/ovMpRU6mkz1936MnR3hw1K0SLEI9uSUjCqy0ad1qJvAf5G k4OA== 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 e21-20020a05600c439500b003fee8f84f98si1619780wmn.229.2023.08.21.00.30.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 00:30:02 -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 8626A8702E; Mon, 21 Aug 2023 09:29:39 +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 29F2987048; Mon, 21 Aug 2023 09:29:38 +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 51ADA8695F for ; Mon, 21 Aug 2023 09:29:35 +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 81A8B2F4; Mon, 21 Aug 2023 00:30:15 -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 8298C3F740; Mon, 21 Aug 2023 00:29:32 -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 v3 3/6] scripts/Makefile.lib: Embed capsule public key in platform's dtb Date: Mon, 21 Aug 2023 12:59:06 +0530 Message-Id: <20230821072909.2387400-4-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230821072909.2387400-1-sughosh.ganu@linaro.org> References: <20230821072909.2387400-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 Reviewed-by: Ilias Apalodimas --- Changes since V2: None 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 Mon Aug 21 07:29:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 715365 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp1698939wrs; Mon, 21 Aug 2023 00:30:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5YryDlyoz4Gg+5D0M9/5NE63DQ3gcwf8vAHP0XJQquJXW0+/nnKDaFJQqyC3S5OBtm/hF X-Received: by 2002:adf:f9c4:0:b0:314:1270:8fc with SMTP id w4-20020adff9c4000000b00314127008fcmr4611516wrr.0.1692603013973; Mon, 21 Aug 2023 00:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692603013; cv=none; d=google.com; s=arc-20160816; b=p6KEr01GEo8IoGHbjca0/3KTUryAtxNgurKXAELwtiKAoZMocCSj6Uac2DmGpEUQgt tKU2fZFFCr3l7Rl2HGD0GsJj63sSomSD82Wnd1+/AejV4EUeASfaMSVaufNuF27Kk2PL QCyKD/+cxDAe9c+6FMv1ldJNFgj0eJlpnS52mINxsjpSnTFpKeGf/Izah1jo18Z5DK24 lI6POuqgkRkV9uGlaFQnxRzqBwx8BO/Oat3DvPQhrO+JSNv7FCLhAQp5ikXdZIq4QCcm bIRWRE4JH3FJTG1gX+0m+2R1tywvjF1gWkcdKX7tTsMgyLyOeLoSY1dIT0jARW0DWUF1 CCkw== 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=jGkdiQFE64bqE3tjeTxEX9Q2EAMMWAUBWpnnZQdfj5Q=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=Ul3npGg8bNqkvTyLy7oX1hUXC4LIR1d1T8J8RBb/JcPgiGhEVsz//XTyP1Hf0qfN+Y +7c95wSOy0nzZl85/LgbtwUD0hfq6cA3qVcF8AOfrwwpA2mT6y+PBnyUQtOWnWromoEf txi17MCx4uY+yPOsKm6V3D8ZdVXaBw//wysqFG9CMXXVym9v6O+zm2LNRN3KgFIk/DEt Rsv5S64SjxQN8l5eG+5PdegcS/og9Rb1UdaDiXb94GcsYyW3WhZTrYsLysgpe8HoIikH tpEk4xcgf8gR2ZKPEnzmlmUZwzx9SFsPI4b6eK16snfItMIeONBRB+fsbF9Lj/KsCfgj ZkSA== 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 x10-20020adfdd8a000000b0031ad112953csi3521508wrl.837.2023.08.21.00.30.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 00:30:13 -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 CB46487040; Mon, 21 Aug 2023 09:29:41 +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 B22F58704B; Mon, 21 Aug 2023 09:29:40 +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 155C287015 for ; Mon, 21 Aug 2023 09:29:38 +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 4D1F62F4; Mon, 21 Aug 2023 00:30:18 -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 4E7113F740; Mon, 21 Aug 2023 00:29:35 -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 v3 4/6] sandbox: capsule: Add path to the public key ESL file Date: Mon, 21 Aug 2023 12:59:07 +0530 Message-Id: <20230821072909.2387400-5-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230821072909.2387400-1-sughosh.ganu@linaro.org> References: <20230821072909.2387400-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 V2: 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 Mon Aug 21 07:29:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 715366 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp1699019wrs; Mon, 21 Aug 2023 00:30:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH80P1+yRkxMreIi/gWD8GACcjqL3LhSywHZ3uK3C6xBgKBkpclzWIvRxDZL34rVg4GxDeC X-Received: by 2002:a1c:7303:0:b0:3fe:3004:1ffd with SMTP id d3-20020a1c7303000000b003fe30041ffdmr4318232wmb.4.1692603026126; Mon, 21 Aug 2023 00:30:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692603026; cv=none; d=google.com; s=arc-20160816; b=IVRozRy2F40NEjmjskCCk4d+apojnDdzHeVGRlJ2Z/zoEmTONxrMq0eviqhMTQf68n OzLJEIKcPr+61wJtBKBISEoNbmNf3gRlZq0noW2vJ5MeaBu9+9DnQHE6zjM4Krjtbz8E Ia/eFV+4d1PvQ1d2qsR3rzaQ8+Vq1FpJd49/BBlQWt4tVcBis/CzfoVS303Qf9LAdUVi ksDmvUzxnxs6DRORBVj+lKa/orv1N/wwW/K21Xa9xIdTvF7XKaIPpZwZC0mhjMOng0WM M33x4RmYz2sXa7EMObWEVjF7ALfKWoC2oVvksPjrd7KNh7j32aJQHnN/baTM3cS5AK+j kXPw== 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=0jvhUPM7d72gn/nFpFvWKTxCB9CbXtyp2MtkgeRQUVU=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=JlFiA9oNgRB7IyKqFtSAMrLrMYHzR/Lvhn8R2xYL+Fb2PqKNSfT7CRgve71HB1Ux9i 0ZKNxR+jj/A+RtEjcBUVbbBf4MnMlsaTqgHkjBOcF+CQAyQvVBN7ThT9J+xBQyvxTV6A sC301KfTZq/KVN76dp/wP4P3ZJrW7D58rxWCOx4yJ/uI1/rZj5mTi29d+p6cjzLCtgNi KonRfr+fObSBw6qb14aIqXhCVMa6CQFwyiGPFr+uuUowNBDgxn9hIMKd/6Bvv1h7dfuy puR8S5QFgFYSWMii3YCG5MJMIAsLAlGExFW/ZCScb+HtQjd8BCnAO/yxOvVIYG1IxED2 U34A== 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 l19-20020a1ced13000000b003fe1500f7edsi4503857wmh.110.2023.08.21.00.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 00:30:26 -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 1831B8703B; Mon, 21 Aug 2023 09:29:45 +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 B51C287049; Mon, 21 Aug 2023 09:29:43 +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 DEFE287015 for ; Mon, 21 Aug 2023 09:29:40 +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 187762F4; Mon, 21 Aug 2023 00:30:21 -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 19B913F740; Mon, 21 Aug 2023 00:29:37 -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 v3 5/6] test: capsule: Remove logic to add public key ESL Date: Mon, 21 Aug 2023 12:59:08 +0530 Message-Id: <20230821072909.2387400-6-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230821072909.2387400-1-sughosh.ganu@linaro.org> References: <20230821072909.2387400-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 V2: 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 Mon Aug 21 07:29:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 715367 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp1699090wrs; Mon, 21 Aug 2023 00:30:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFL6NbsSb6k6Z6HqQ0Ohqp31+KR0GlkT7pfctMoeSnVHYpUgLF58/AGs4rU/7lf2UYwaiT X-Received: by 2002:a05:600c:3781:b0:3fc:27:7e46 with SMTP id o1-20020a05600c378100b003fc00277e46mr4628055wmr.3.1692603037165; Mon, 21 Aug 2023 00:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692603037; cv=none; d=google.com; s=arc-20160816; b=hRMW+rNE9nXaxBNgsoEyqZgGfRC9jTMJEW7YMneTmG/tkmwfXpe7MGs/EFO9As3clU naml1pDhKrvJjTYyUaVLjh+N/e8uyiuKHRxFYbyLLScd8PbyiPCsCDWXpsSJZ4eFYSEP J2bIlAiDPPrNwXK2p8USenSOig4zymgE78/oV5iTGLV3gsBCXqxuEvshahrhEaTVfJD/ UKoTaglLQVlrJ10//Evq7aLPNIGRN5s/lj5UmdBVgRgusq3DEAXW4WPw/rhQPe5a1WIh K0mLzcR4nwbI3CdLliyrg3xVNJphSu3duN2/f8nZMuvtImvHYaHYxqystgxilgOSjwjc qVXA== 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=Ms9jlkdNP5fIPQQ63oAffefa6CDEk9qsZMi98qitmiw=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=EnhgcLoGWPsStpQpeP77dsgbnbHxrw1xZ6AIgal4qyzGcUOm1BAdawsTFTV0jtMO37 g6BuHcD4v88kaUpWxDvMKLyWZ4Uqq/a4rCcFFCqx1IOpiYTCbVtpK5khZlBQ6KQsbnWe rHEvxp1Q7PTY9bk3jcYoezPC3Hv9qzFlTbx4zU0X+YfL13kksPLNGA1XaWcjuPIRPlLD MAzCmQNzzgk4e9bquSZ9cuYPxL4+PLVd+Af/wYKX0aSeUxCkULFGV/tTeplRBXHoRtR3 hmLkbCfKqsRnlCfUbeFhXCAGYh1sMQt1QpVzkefvDHUpv+Br2v5Pl1hDmJnESfZSSr3D Uv6g== 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 ay4-20020a05600c1e0400b003fef4ec1500si30266wmb.54.2023.08.21.00.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 00:30:37 -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 5C9A18704E; Mon, 21 Aug 2023 09:29:47 +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 434328704E; Mon, 21 Aug 2023 09:29:46 +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 A0CC386932 for ; Mon, 21 Aug 2023 09:29:43 +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 D8BDD2F4; Mon, 21 Aug 2023 00:30:23 -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 D94F73F740; Mon, 21 Aug 2023 00:29:40 -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 v3 6/6] doc: capsule: Document the new mechanism to embed ESL file into dtb Date: Mon, 21 Aug 2023 12:59:09 +0530 Message-Id: <20230821072909.2387400-7-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230821072909.2387400-1-sughosh.ganu@linaro.org> References: <20230821072909.2387400-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 Reviewed-by: Ilias Apalodimas --- Changes since V2: * Rephrase the statements in a couple of places as suggested by Ilias. 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..f422915ef5 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 through the Kconfig symbol +CONFIG_EFI_CAPSULE_ESL_FILE. This symbol points to the esl file +generated in step-2. Once the symbol has been populated with the path +to the esl file, it will automatically get embedded into the +platform's dtb as part of U-Boot build. Anti-rollback Protection ************************