From patchwork Fri Apr 1 19:17:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 555591 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp1821496mag; Fri, 1 Apr 2022 12:20:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9r/eQ+GjcBUh4Wt56LvLmDu4+P4WNKZzoIj1oqrObyIdrYNAX/+vH4RVmuNXRk1E4FTpO X-Received: by 2002:a17:907:6092:b0:6db:ab31:96a2 with SMTP id ht18-20020a170907609200b006dbab3196a2mr1072764ejc.361.1648840812404; Fri, 01 Apr 2022 12:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648840812; cv=none; d=google.com; s=arc-20160816; b=0UFTRi9N5vJx3zgJfbiaNsY3vilgWXuGLEUva0SS8cM28gQRdYWB37wbnJy9bb6qsC m5qGAdIEvnU4sSbiKoUT7x0qIR3lOMSz7EY6UFEqZVTfkWz3YoLN3xcIJT+fahz10Dbg QLYvqZnz+wl5LaI+AF+nGyY/lD8e2mmHzfOlIkJx7ccbpoY/QESe+QvWD9ZFglOl0q9F Mox32yOLQI5UuXWEBw/if/ZGbyNEyXX9SlVDQSokAveBUQBk8ghQW83GB4qInukVCNBJ +/ZIznAPRqZ5nqz0kx3WBM8OlNgYvCRFi9ZrQDKrmRXAkhCFsZf+n40qXbdVxwg3S/Lu bAGQ== 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=enjwazhvVcpp5+w2ZMVsuMN9colj9LsP9Ny+igxDnmU=; b=M50jwGb15WA3LdTsNM71EoKVfAOhnlaGv0btI7z4up81OjZ/Px9pwRItMG42cNqsyK Jfi0hWH6kH15bNHXkF1+x8LvfPOQUEPiJOQkDC2UAEilrhpF79VdOn7Sk0S6uBgO0dMr feKyp6wWaN+dHPA3VXgwjVoe56uQm/LHZg3BgOMXrchwFjzNOKZhiBqn+pIiLm9ietBS AwXAbE0qzm0dUwrWNWxm9p1NYMOscKWGIacto2mDTBjslrAva4f2v/wNdHiaCYLh6yDm vNKhz8pvsnuafMVoBcVtBGIVTH+aImnVSixMXBECS/aSXVgZMJ21DWVjGbJu2o1bZYGT Ahhg== 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 f18-20020a056402355200b00418c2b5be78si2351977edd.346.2022.04.01.12.20.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Apr 2022 12:20:12 -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 2A7688434E; Fri, 1 Apr 2022 21:19:07 +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 BB8E78434E; Fri, 1 Apr 2022 21:19:02 +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,T_SCC_BODY_TEXT_LINE 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 BC29F8434B for ; Fri, 1 Apr 2022 21:18:56 +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 0E935139F; Fri, 1 Apr 2022 12:18:56 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.16.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4C88B3F73B; Fri, 1 Apr 2022 12:18:52 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , AKASHI Takahiro , Ying-Chun Liu , Tuomas Tynkkynen , Heiko Thiery , Frieder Schrempf , Michael Walle , Masami Hiramatsu , Jassi Brar , Michal Simek , Michal Simek , Sughosh Ganu Subject: [PATCH v5 8/8] doc: uefi: Update the capsule update related documentation Date: Sat, 2 Apr 2022 00:47:59 +0530 Message-Id: <20220401191759.1670812-9-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220401191759.1670812-1-sughosh.ganu@linaro.org> References: <20220401191759.1670812-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.5 at phobos.denx.de X-Virus-Status: Clean Update the capsule update functionality related documentation to refect the additional definitions that need to be made per platform for supporting the capsule update feature. Signed-off-by: Sughosh Ganu --- Changes since V4: * Change the description of the platform data based on the changes made in earlier patches doc/develop/uefi/uefi.rst | 51 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst index fe337c88bd..b766aecf67 100644 --- a/doc/develop/uefi/uefi.rst +++ b/doc/develop/uefi/uefi.rst @@ -312,8 +312,8 @@ Run the following command .. code-block:: console $ mkeficapsule \ - --index 1 --instance 0 \ - [--fit | --raw ] \ + --index --instance 0 \ + --guid \ Performing the update @@ -333,6 +333,53 @@ won't be taken over across the reboot. If this is the case, you can skip this feature check with the Kconfig option (CONFIG_EFI_IGNORE_OSINDICATIONS) set. +A few values need to be defined in the board file for performing the +capsule update. These values are defined in the board file by +initialisation of a structure which provides information needed for +capsule updates. The following structures have been defined for +containing the image related information + +.. code-block:: c + + struct efi_fw_images { + efi_guid_t image_type_id; + u16 *fw_name; + u8 image_index; + }; + + struct efi_capsule_update_info { + const char *dfu_string; + struct efi_fw_images *images; + }; + + +A string is defined which is to be used for populating the +dfu_alt_info variable. This string is used by the function +set_dfu_alt_info. Instead of taking the variable from the environment, +the capsule update feature requires that the variable be set through +the function, since that is more robust. Allowing the user to change +the location of the firmware updates is not a very secure +practice. Getting this information from the firmware itself is more +secure, assuming the firmware has been verified by a previous stage +boot loader. + +The firmware images structure defines the GUID values, image index +values and the name of the images that are to be updated through +the capsule update feature. These values are to be defined as part of +an array. These GUID values would be used by the Firmware Management +Protocol(FMP) to populate the image descriptor array and also +displayed as part of the ESRT table. The image index values defined in +the array should be one greater than the dfu alt number that +corresponds to the firmware image. So, if the dfu alt number for an +image is 2, the value of image index in the fw_images array for that +image should be 3. The dfu alt number can be obtained by running the +following command:: + + dfu list + +When using the FMP for FIT images, the image index value needs to be +set to 1. + Finally, the capsule update can be initiated by rebooting the board. Enabling Capsule Authentication