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 AA81BC433F5 for ; Mon, 3 Oct 2022 10:57:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0104F84DE5; Mon, 3 Oct 2022 12:57:08 +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="Nm0hMbEQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4010D84DEA; Mon, 3 Oct 2022 12:57:05 +0200 (CEST) Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (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 D574484DD9 for ; Mon, 3 Oct 2022 12:57:01 +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=takahiro.akashi@linaro.org Received: by mail-pf1-x42b.google.com with SMTP id a26so880550pfg.7 for ; Mon, 03 Oct 2022 03:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=aWvqJPD2pq11eqG6iVGgsPv1C7pbb+OYn4v4nS7vtXA=; b=Nm0hMbEQlVs9YAGmJu2c/8YkDIEW45yjq+ef+WPBxS7e322rYTGxg/t7ye9ARpa7bw 06mBCuRT7Nsv/q0+n6gi05wXMZ7lGnCklc1qB9GFGGl8Ipjso0+hrNv6bbeVLxkVDlVU +TxGPb9p06AEs6OUdldPg1/q3odI8Bo+99q1DOLdbvekWJIuPW1gqoEuwu5WfZFE4iDr w7KDUqoe42Q70lOfq7JbXwDfZASxe0Nm064k8GB/8OrnYLvZKLVUOOCMPnRB2IfunFM5 QWN7mo5RnRAl0NInCmCnbGZcp3x8Sksc2CUmCa8Lws2ZOW31Gi/Eb5CElITuwSCbHhL1 G7ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aWvqJPD2pq11eqG6iVGgsPv1C7pbb+OYn4v4nS7vtXA=; b=2IMYAdQaqH9nfKYSoQUpvcz5wIRtAWFphqfnb9ullWxlZ7LZ4FxnHO+Xh9wNYvN8Si AHofSapf8WmBZg//wpMXcaAp5h+EEuN3DW1611naM65yIhqOu42TC/CIktklFvfG/Qyo jMoCx2nmDB8LT7R5jbboAqy+ZyBZEuipqOEDR8g87GMS5us5M/curmoCSvye1yACSnCW rkrNVA3Q19lYvljwG5pII9q3K/4OqFPVYLTGp2n6oXvCRxCQ3AYArSBqiGF3ocFIa3KL Oh+nvs0tB9IYzXoZ51QprPgaJGjKunp7Q0BBjbMcCJwTCciAyr0InUPY55EW9yknDEIw sN0Q== X-Gm-Message-State: ACrzQf0X83xwBE1shSA2WKXNs6c4PD6/w/2COiOpyE+Cf9HvHwRq8FVf WzYiXhfbs2FgaxUpoY60sdF1iQ== X-Google-Smtp-Source: AMsMyM4i0QRCK7ZK+tQBQ7Xbtf4vJGCU77yVwyeNsGCIPpbyQ/H2qri9OYYyxZzsFgMenFPH1Ai1eg== X-Received: by 2002:a63:6b88:0:b0:453:3f5e:67d7 with SMTP id g130-20020a636b88000000b004533f5e67d7mr229075pgc.253.1664794620005; Mon, 03 Oct 2022 03:57:00 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:89e:d429:f30:41af]) by smtp.gmail.com with ESMTPSA id y67-20020a623246000000b00545f5046372sm7053744pfy.208.2022.10.03.03.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 03:56:59 -0700 (PDT) Date: Mon, 3 Oct 2022 19:56:54 +0900 From: Takahiro Akashi To: Sughosh Ganu Cc: u-boot@lists.denx.de, Heinrich Schuchardt , Ilias Apalodimas , Patrick Delaunay , Patrice Chotard , Simon Glass , Bin Meng , Tom Rini , Etienne Carriere , Michal Simek , Jassi Brar Subject: Re: [PATCH v11 05/15] stm32mp1: dk2: Add image information for capsule updates Message-ID: <20221003105654.GA61078@laputa> Mail-Followup-To: Takahiro Akashi , Sughosh Ganu , u-boot@lists.denx.de, Heinrich Schuchardt , Ilias Apalodimas , Patrick Delaunay , Patrice Chotard , Simon Glass , Bin Meng , Tom Rini , Etienne Carriere , Michal Simek , Jassi Brar References: <20220928092956.2535777-1-sughosh.ganu@linaro.org> <20220928092956.2535777-6-sughosh.ganu@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220928092956.2535777-6-sughosh.ganu@linaro.org> 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.6 at phobos.denx.de X-Virus-Status: Clean Hi Sughosh, On Wed, Sep 28, 2022 at 02:59:46PM +0530, Sughosh Ganu wrote: > Enabling capsule update functionality on the platform requires > populating information on the images that are to be updated using the > functionality. Do so for the DK2 board. > > Signed-off-by: Sughosh Ganu > Reviewed-by: Patrick Delaunay > Reviewed-by: Ilias Apalodimas > --- > Changes since V10: > * Use image_index value of 1 for the FIP image as it is now relevant > > board/st/stm32mp1/stm32mp1.c | 18 ++++++++++++++++++ > include/configs/stm32mp15_common.h | 4 ++++ > 2 files changed, 22 insertions(+) > > diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c > index 8c162b42a5..e43dab018f 100644 > --- a/board/st/stm32mp1/stm32mp1.c > +++ b/board/st/stm32mp1/stm32mp1.c > @@ -11,6 +11,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -87,6 +88,16 @@ > #define USB_START_LOW_THRESHOLD_UV 1230000 > #define USB_START_HIGH_THRESHOLD_UV 2150000 > > +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) > +struct efi_fw_image fw_images[1]; > + > +struct efi_capsule_update_info update_info = { > + .images = fw_images, > +}; > + > +u8 num_image_type_guids = ARRAY_SIZE(fw_images); The definition of num_image_type_guids is always the same across boards. Why do we need it for every platform? I believe that we can remove it. Anyhow it's not documented in doc/develop/uefi/uefi.rst. > +#endif /* EFI_HAVE_CAPSULE_SUPPORT */ > + > int board_early_init_f(void) > { > /* nothing to do, only used in SPL */ > @@ -666,6 +677,13 @@ int board_init(void) > > setup_led(LEDST_ON); > > +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) > + efi_guid_t image_type_guid = STM32MP_FIP_IMAGE_GUID; > + > + guidcpy(&fw_images[0].image_type_id, &image_type_guid); > + fw_images[0].fw_name = u"STM32MP-FIP"; > + fw_images[0].image_index = 1; Then, we should describe that image_index must be 1 to num_image_type_guids (or strictly, number of descriptors returned by GetImageInfo()) in the document above. (I hope that you add a sanity checker against it as well.) -Takahiro Akashi > +#endif > return 0; > } > > diff --git a/include/configs/stm32mp15_common.h b/include/configs/stm32mp15_common.h > index c5412ffeb3..bb19dae945 100644 > --- a/include/configs/stm32mp15_common.h > +++ b/include/configs/stm32mp15_common.h > @@ -34,6 +34,10 @@ > #define CONFIG_SERVERIP 192.168.1.1 > #endif > > +#define STM32MP_FIP_IMAGE_GUID \ > + EFI_GUID(0x19d5df83, 0x11b0, 0x457b, 0xbe, 0x2c, \ > + 0x75, 0x59, 0xc1, 0x31, 0x42, 0xa5) > + > /*****************************************************************************/ > #ifdef CONFIG_DISTRO_DEFAULTS > /*****************************************************************************/ > -- > 2.34.1 >