From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C850C433FE for ; Wed, 13 Apr 2022 08:12:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B4C9A838AB; Wed, 13 Apr 2022 10:12:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="oWhtMYOC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D12C0831E0; Wed, 13 Apr 2022 10:12:00 +0200 (CEST) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E93A983953 for ; Wed, 13 Apr 2022 10:11:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-io1-xd36.google.com with SMTP id y65so1039134iof.1 for ; Wed, 13 Apr 2022 01:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=RdO8FqsPHrwgOYv3O7gXyuOa4WubxOXGmNrG1HdReas=; b=oWhtMYOCXEeYcvXrIi94ByRn+lJuISFD4xb/4L9H2UQ9xafJ8GMM84kwTGCpSIzutw Esfl/tzHyZNO8wCs8p9bKuNWy7XMANyO+GPvXSltx8w/qutbl9tygRUghOF8gVj2Bdf2 1JJVaYzjMWi3wYJ9xu2KLp240z3QcT84kcuw70RkziqAZZetCvY6jJ5w5tJpwNX0CA3G jbYBXazwXXCSF35w+TLaJ0FozOUT8il2n0QuzLFeNq4KfXBxSNjLdh2/Z+keXot1HDhG EReGafzNgtCeLpQt+fRjZByg362o8qMR95rQPVOP3Aen8fJovnv/mwvEuZilD0tbVe9k jnXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=RdO8FqsPHrwgOYv3O7gXyuOa4WubxOXGmNrG1HdReas=; b=SDeof2UiILbPiw49IdwZ29FRt530kudpH/4GhR45T5lpC4uabWxyx5rCogQKumVjM6 xEw+8+MkrwalJ9IeDAfwRk90dNkuFT15iFGsjN2C3+Cw4mYpze4nqmcJ0vLTzgm96O/i 3OmGe5wvbjWuAEc7hmlxpPREHbkf7H5IIG3ZgOA9KAtNUZXn7WhcOAOMBehjsT2+Oi3y zFoQIF64lLTuu8GqtiJbREokkTyVYQALKDOoztLxkExqmkO6OcpNaBSsElFivEHHLixp jjFGWy/FW3L5qaa+XLkKh3Dw3aB66XVESGiaJlyfwu2SgXGB2dtTWitd9t9HYGKTsISG IMpA== X-Gm-Message-State: AOAM532CW9zkvfxRq+ljHTK3v6IWif107shAWEjQe+FtmfoKr6gJQORH e68YbtTh7g/nDc71Ec+kmN2r5FTHyhAe+QUrWmoz0Q== X-Google-Smtp-Source: ABdhPJzqPyl8AsL3BByEJ0nvAnmr3FiF/K6rV0ZDVE1PPcU65FrULRu6J6nG3fQYkxhdq7F8z45YFzQLTAdkg8AnVzs= X-Received: by 2002:a05:6638:3a5:b0:324:1f1c:dd6 with SMTP id z5-20020a05663803a500b003241f1c0dd6mr15379426jap.106.1649837516692; Wed, 13 Apr 2022 01:11:56 -0700 (PDT) MIME-Version: 1.0 References: <20220412130447.300574-1-sughosh.ganu@linaro.org> <20220412130447.300574-9-sughosh.ganu@linaro.org> <20220413061833.GB87648@laputa> <20220413073303.GF87648@laputa> In-Reply-To: <20220413073303.GF87648@laputa> From: Masami Hiramatsu Date: Wed, 13 Apr 2022 17:11:45 +0900 Message-ID: Subject: Re: [PATCH v6 8/8] doc: uefi: Update the capsule update related documentation To: AKASHI Takahiro , Sughosh Ganu , u-boot@lists.denx.de, Heinrich Schuchardt , Ilias Apalodimas , Ying-Chun Liu , Tuomas Tynkkynen , Heiko Thiery , Frieder Schrempf , Michael Walle , Masami Hiramatsu , Jassi Brar , Michal Simek , Michal Simek Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hi 2022=E5=B9=B44=E6=9C=8813=E6=97=A5(=E6=B0=B4) 16:33 AKASHI Takahiro : > > On Wed, Apr 13, 2022 at 12:38:05PM +0530, Sughosh Ganu wrote: > > On Wed, 13 Apr 2022 at 11:48, AKASHI Takahiro > > wrote: > > > > > > On Tue, Apr 12, 2022 at 06:34:47PM +0530, Sughosh Ganu wrote: > > > > 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 V5: None > > > > > > > > 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_OSIN= DICATIONS) > > > > set. > > > > > > > > +A few values need to be defined in the board file for performing t= he > > > > +capsule update. These values are defined in the board file by > > > > +initialisation of a structure which provides information needed fo= r > > > > +capsule updates. The following structures have been defined for > > > > +containing the image related information > > > > + > > > > +.. code-block:: c > > > > + > > > > + struct efi_fw_images { > > > > > > Why "images" (in the plural)? > > > > Hmm, since this is to be an array of firmware images which should be > > handled by the capsule update code, I used a plural form. Do you > > prefer efi_fw_image instead? > > This structure (not a variable like struct efi_fw_image foo_images[]) > can only hold/represent one firmware image, right? > If so, efi_fw_image looks better. > > > > > > > > + efi_guid_t image_type_id; > > > > + u16 *fw_name; > > > > + u8 image_index; > > > > + }; > > > > > > Why not add "version" and "last_attempt_version" which is expected > > > to be easily implemented in this structure. > > > > It can be added to this structure, yes. But we will also need to add > > code in the capsule driver to update these fields accordingly. I can > > take this up as a follow up task once the FWU series upstreaming is > > done. > > > > > > > > > > > > + 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 environm= ent, > > > > +the capsule update feature requires that the variable be set throu= gh > > > > +the function, since that is more robust. Allowing the user to chan= ge > > > > +the location of the firmware updates is not a very secure > > > > +practice. Getting this information from the firmware itself is mor= e > > > > +secure, assuming the firmware has been verified by a previous stag= e > > > > +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 Manageme= nt > > > > +Protocol(FMP) to populate the image descriptor array and also > > > > +displayed as part of the ESRT table. The image index values define= d 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 a= n > > > > +image is 2, the value of image index in the fw_images array for th= at > > > > +image should be 3. The dfu alt number can be obtained by running t= he > > > > +following command:: > > > > + > > > > + dfu list > > > > + > > > > +When using the FMP for FIT images, the image index value needs to = be > > > > +set to 1. > > > > > > The explanation would be correct, but it's not quite easy to understa= nd, > > > in particular, index in case of raw. > > > You should add some examples here. > > > > I have added an example above for the raw images, as to how the image > > index corresponds with the dfu alt number. Does it not suffice? > > I hope that it will cover not only index, but example arrays of > struct efi_fw_image and struct efi_capsule_update_info > as well as an example "dfu_alto_info". +1. If there is an example of "dfu_alt_info", the platform setting of image-type and index list, and how to make a capsule file in that case, people can easily understand the relationship of them. Can we use Qemu case for example? Thank you, > > -Takahiro Akashi > > > -sughosh > > > > > > > > -Takahiro Akashi > > > > > > > + > > > > Finally, the capsule update can be initiated by rebooting the boar= d. > > > > > > > > Enabling Capsule Authentication > > > > -- > > > > 2.25.1 > > > > --=20 Masami Hiramatsu