public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Takahiro Akashi <takahiro.akashi@linaro.org>
To: Sughosh Ganu <sughosh.ganu@linaro.org>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Patrick Delaunay <patrick.delaunay@foss.st.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Simon Glass <sjg@chromium.org>, Bin Meng <bmeng.cn@gmail.com>,
	Tom Rini <trini@konsulko.com>,
	Etienne Carriere <etienne.carriere@linaro.org>,
	Michal Simek <monstr@monstr.eu>,
	Jassi Brar <jaswinder.singh@linaro.org>
Subject: Re: [PATCH v11 05/15] stm32mp1: dk2: Add image information for capsule updates
Date: Tue, 4 Oct 2022 12:04:05 +0900	[thread overview]
Message-ID: <20221004030405.GC36861@laputa> (raw)
In-Reply-To: <CADg8p94GZ+Rn70GjckOLQ2gGFt7KF0tNP+syA8wEhnryw13fqA@mail.gmail.com>

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 <takahiro.akashi@linaro.org> 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 <sughosh.ganu@linaro.org>
> > > Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> > > Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> > > ---
> > > 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 <clk.h>
> > >  #include <config.h>
> > >  #include <dm.h>
> > > +#include <efi_loader.h>
> > >  #include <env.h>
> > >  #include <env_internal.h>
> > >  #include <fdt_simplefb.h>
> > > @@ -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
> > >

  reply	other threads:[~2022-10-04  3:04 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28  9:29 [PATCH v11 00/15] FWU: Add FWU Multi Bank Update feature support Sughosh Ganu
2022-09-28  9:29 ` [PATCH v11 01/15] dt/bindings: Add bindings for GPT based FWU Metadata storage device Sughosh Ganu
2022-09-28  9:29 ` [PATCH v11 02/15] FWU: Add FWU metadata structure and driver for accessing metadata Sughosh Ganu
2022-09-30  5:54   ` Etienne Carriere
2022-10-03  6:27     ` Sughosh Ganu
2022-09-28  9:29 ` [PATCH v11 03/15] FWU: Add FWU metadata access driver for GPT partitioned block devices Sughosh Ganu
2022-09-30  6:10   ` Etienne Carriere
2022-09-28  9:29 ` [PATCH v11 04/15] stm32mp1: dk2: Add a node for the FWU metadata device Sughosh Ganu
2022-09-28  9:29 ` [PATCH v11 05/15] stm32mp1: dk2: Add image information for capsule updates Sughosh Ganu
2022-09-30  5:51   ` Etienne Carriere
2022-10-03 10:56   ` Takahiro Akashi
2022-10-03 11:10     ` Sughosh Ganu
2022-10-04  3:04       ` Takahiro Akashi [this message]
2022-09-28  9:29 ` [PATCH v11 06/15] FWU: Add helper functions for accessing FWU metadata Sughosh Ganu
2022-10-03  9:51   ` Ilias Apalodimas
2022-09-28  9:29 ` [PATCH v11 07/15] FWU: STM32MP1: Add support to read boot index from backup register Sughosh Ganu
2022-09-28  9:29 ` [PATCH v11 08/15] event: Add an event for main_loop Sughosh Ganu
2022-09-28  9:29 ` [PATCH v11 09/15] FWU: Add boot time checks as highlighted by the FWU specification Sughosh Ganu
2022-10-03  9:56   ` Ilias Apalodimas
2022-10-03 10:31     ` Sughosh Ganu
2022-09-28  9:29 ` [PATCH v11 10/15] FWU: Add support for the FWU Multi Bank Update feature Sughosh Ganu
2022-09-28  9:29 ` [PATCH v11 11/15] FWU: cmd: Add a command to read FWU metadata Sughosh Ganu
2022-09-28  9:29 ` [PATCH v11 12/15] test: dm: Add test cases for FWU Metadata uclass Sughosh Ganu
2022-09-28  9:29 ` [PATCH v11 13/15] mkeficapsule: Add support for generating empty capsules Sughosh Ganu
2022-09-28  9:29 ` [PATCH v11 14/15] mkeficapsule: Add support for setting OEM flags in capsule header Sughosh Ganu
2022-09-28  9:29 ` [PATCH v11 15/15] FWU: doc: Add documentation for the FWU feature Sughosh Ganu
2022-09-30  6:27   ` Etienne Carriere
2022-09-30  8:23     ` Sughosh Ganu
2022-10-04  2:54   ` Takahiro Akashi
2022-10-04  6:40     ` Sughosh Ganu
2022-10-04  7:09       ` Takahiro Akashi
2022-10-04  7:46         ` Ilias Apalodimas
2022-10-02 23:50 ` [PATCHv2 0/5] FWU: Add support for mtd backed feature on DeveloperBox jassisinghbrar
2022-10-02 23:51   ` [PATCHv2 1/5] FWU: Add FWU metadata access driver for MTD storage regions jassisinghbrar
2022-10-14  7:07     ` Ilias Apalodimas
2022-10-31 23:37       ` Jassi Brar
2022-10-02 23:51   ` [PATCHv2 2/5] FWU: mtd: Add helper functions for accessing FWU metadata jassisinghbrar
2022-10-14  7:10     ` Ilias Apalodimas
2022-10-02 23:51   ` [PATCHv2 3/5] dt: fwu: developerbox: enable fwu banks and mdata regions jassisinghbrar
2022-10-14  7:33     ` Ilias Apalodimas
2022-10-02 23:52   ` [PATCHv2 4/5] fwu: DeveloperBox: add support for FWU jassisinghbrar
2022-10-03 11:04     ` AKASHI Takahiro
2022-10-03 13:40       ` Jassi Brar
2022-10-03 13:51         ` Ilias Apalodimas
2022-10-04  1:06           ` AKASHI Takahiro
2022-10-04  2:00             ` Jassi Brar
2022-10-04  2:44               ` AKASHI Takahiro
2022-10-04  2:53                 ` Jassi Brar
2022-10-02 23:52   ` [PATCHv2 5/5] tools: Add mkfwumdata tool for FWU metadata image jassisinghbrar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221004030405.GC36861@laputa \
    --to=takahiro.akashi@linaro.org \
    --cc=bmeng.cn@gmail.com \
    --cc=etienne.carriere@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jaswinder.singh@linaro.org \
    --cc=monstr@monstr.eu \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox