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 72808C433F5 for ; Tue, 4 Oct 2022 03:04:19 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 851EB84B20; Tue, 4 Oct 2022 05:04:17 +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="KjTDmP77"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C8AF28495E; Tue, 4 Oct 2022 05:04:15 +0200 (CEST) Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (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 9ACD58495E for ; Tue, 4 Oct 2022 05:04:12 +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-pj1-x102c.google.com with SMTP id gf8so9157532pjb.5 for ; Mon, 03 Oct 2022 20:04:12 -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=8CQH0EEfX8Rm7yIBTYIt2FEoUvWiKSfYW6uMCS5MG/Q=; b=KjTDmP77pWvpYeqfhGl4LaIjRsi94Wdsgx5y1TOPLYGq/qlS08yIj18LP+/f7LKWsn eyjzKJ4H1iVHntf00TzXg+A8G7OpQDrJOoLmehmi04QFyPkVp22xQdXTitqrOder9VMh 7BbtEF9FQor4PgjkQ/Coo+hCpDimZmEhGB0zq8hxnXw5hpnvWr2GBR1pdnrbeJXpDVR4 DYMfuOkKed8IQpwtJDgot//MEqZsxlhyLSO7RhQ40r9AGZuqR4ZK2yIuwVMeEprRVggu GC83RAhKcNEFI4yoHg+AquWWI0qELC9P7CSo+T97WiDvOJ0cWwNLnjTbbc9xdSI6devJ wfeQ== 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=8CQH0EEfX8Rm7yIBTYIt2FEoUvWiKSfYW6uMCS5MG/Q=; b=NYCHYg+aCK0PibZJXzw2ob8AHCGvxJGB3aFcWwHsiAminghLDadlN0JptZ0NZCj3WW B8LmRe4dBefJhnmhk497PDOnhHsomvoDZLGOxXUYvD2o+EN6CC2/9kRkbs5NuW0ctJ9E HMaV9yBQb8HbsMl4iADJnoHeI7HjaCuS0ZddtMqsXMHYGA/70Bnx4OW7XMX5/NEMQt26 uVVmLt4tWvANghHDnMVSdjc7HoKgCmaPpme7HW7w9S1t5/MzbSNCHbv0z99z62weoiqM 4p1RSRkTmvkojHHuH/5cFO+Q7Z7y2zNikSmI+MhRk5kMuzERmteX7hsnttIiWqN7A6AF sF4w== X-Gm-Message-State: ACrzQf0DkQTPOZHkeTb3z3TZtML3gFIt1NbDewLpYZa+nqSpP2aPQwU3 lJ6mDIhfPejcendb9cSqHFl1hg== X-Google-Smtp-Source: AMsMyM5jhUcFrJlb2JQGXQbz3CHA+qFFZ9L3W7epJp+afHfUSKvCU/5JRF7pZjGSL8/lnNvJRJFQJw== X-Received: by 2002:a17:902:e844:b0:17f:5ad3:279f with SMTP id t4-20020a170902e84400b0017f5ad3279fmr8436596plg.110.1664852650865; Mon, 03 Oct 2022 20:04:10 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:5205:befa:c3e8:6c20]) by smtp.gmail.com with ESMTPSA id 2-20020a621602000000b00561788b29aesm2597788pfw.191.2022.10.03.20.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 20:04:10 -0700 (PDT) Date: Tue, 4 Oct 2022 12:04:05 +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: <20221004030405.GC36861@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> <20221003105654.GA61078@laputa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Mon, Oct 03, 2022 at 04:40:04PM +0530, Sughosh Ganu wrote: > hi Takahiro, > > On Mon, 3 Oct 2022 at 16:27, Takahiro Akashi wrote: > > > > 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? > > Yes, but that is because at present every platform is declaring the > same variable name(fw_images) for the struct efi_fw_image. That's because fw_images is hard-coded in efi_firmware.c by your change. > That is not mandatory, In this sense, it is mandatory unless you want to write a new FMP driver from the scratch. > and a subsequent addition can declare a variable with a > different name. But in case there is consensus on using a fixed > variable name for the structure, I can make the change that you are > suggesting subsequently. I will work on it if needed after the FWU > patches upstreaming work is done. > > > > 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. > > Okay > > > (I hope that you add a sanity checker against it as well.) > > Yes, in the efi_fmp_find(), there is a check for the index value > passed through the capsule against the value returned by the > GetImageInfo(). I meant that the check takes place at some time in initialization, but yes, efi_fmp_find() works as a safe guard. -Takahiro Akashi > -sughosh > > > > > -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 > > >