All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sughosh Ganu <sughosh.ganu@linaro.org>
To: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Cc: u-boot@lists.denx.de,
	Patrick Delaunay <patrick.delaunay@foss.st.com>,
	 Patrice Chotard <patrice.chotard@foss.st.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	 Alexander Graf <agraf@csgraf.de>,
	AKASHI Takahiro <takahiro.akashi@linaro.org>,
	Simon Glass <sjg@chromium.org>, Bin Meng <bmeng.cn@gmail.com>,
	 Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Jose Marinho <jose.marinho@arm.com>,
	 Grant Likely <grant.likely@arm.com>,
	Jason Liu <jason.hui.liu@nxp.com>,  Tom Rini <trini@konsulko.com>,
	Etienne Carriere <etienne.carriere@linaro.org>
Subject: Re: [RFC PATCH v2 3/8] FWU: stm32mp1: Add helper functions for accessing FWU metadata
Date: Fri, 24 Dec 2021 15:37:50 +0530	[thread overview]
Message-ID: <CADg8p94XO2=+3TSk46FYgK3ndjNKUSBAoRF94MFhk=6tzHUPkQ@mail.gmail.com> (raw)
In-Reply-To: <CAA93ih1HhYzFjsPPH87faMdbK8ByYi1rQKEeUf5e59nCMBXFTw@mail.gmail.com>

hi Masami,

On Fri, 24 Dec 2021 at 11:19, Masami Hiramatsu
<masami.hiramatsu@linaro.org> wrote:
>
> () should Hi Sughosh and Ilias,
>
> I would like to confirm that what the plat_fill_gpt_partition_guids()
> should return.
>
> 2021年12月19日(日) 16:07 Sughosh Ganu <sughosh.ganu@linaro.org>:
>
> > +static int plat_fill_gpt_partition_guids(struct blk_desc *desc,
> > +                                        efi_guid_t **part_guid_arr)
> > +{
> > +       int i, ret = 0;
> > +       u32 part;
> > +       struct dfu_entity *dfu;
> > +       struct disk_partition info;
> > +       efi_guid_t part_type_guid;
> > +       int alt_num = dfu_get_alt_number();
> > +
> > +       dfu_init_env_entities(NULL, NULL);
> > +
> > +       for (i = 0, part = 1; i < alt_num; i++) {
> > +               dfu = dfu_get_entity(i);
> > +
> > +               if (!dfu)
> > +                       continue;
> > +
> > +               /*
> > +                * Currently, Multi Bank update
> > +                * feature is being supported
> > +                * only on GPT partitioned
> > +                * MMC/SD devices.
> > +                */
> > +               if (dfu->dev_type != DFU_DEV_MMC)
> > +                       continue;
> > +
> > +               if (part_get_info(desc, part, &info)) {
> > +                       part++;
> > +                       continue;
> > +               }
> > +
> > +               uuid_str_to_bin(info.type_guid, part_type_guid.b,
> > +                               UUID_STR_FORMAT_GUID);
> > +               guidcpy((*part_guid_arr + i), &part_type_guid);
> > +               part++;
> > +       }
> > +
> > +       dfu_free_entities();
> > +
> > +       return ret;
> > +}
>
> So on this platform which uses GPT partition for each bank, it stores
> the GUID for each partition.
> I think this information will be shown in the ESRT, but not used for
> specifying capsule image_type_uuid.
>
> This is strange.
> Without this FWU multi-bank update, the array will only have the
> image_type UUID.
> Thus,  user can use ESRT to confirm what UUID should be specified for
> the capsule file. (it has image-type UUID)
> (of course that is fixed value on one platform anyway)
>
> And when FWU multi-bank update is enabled, that changes to the
> partition GUIDs. But those GUIDs are NOT used when making the capsule
> file nor doing the update process, because we should not specify the
> bank index directly, right?

The partition GUIDs are the same as ImageTypeId field in the
EFI_FIRMWARE_IMAGE_DESCRIPTOR and the UpdateImageTypeId field in the
EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER. This value is the same
as the PartitionTypeGUID field in the GPT partition entry.

ImageTypeId  = UpdateImageTypeId = PartitionTypeGUID

This is the GUID value that is used when generating the capsule.

>
> We will set a unique image-type UUID on each image entry, and use it
> for making a capsule file,

Even with the FWU feature enabled, the PartitionTypeGUID/ImageTypeId
is used for making the capsule. What changes for the FWU feature is
that the value of UpdateImageIndex/ImageIndex that is passed to the
capsule generation tool becomes irrelevant. When the FWU feature is
not enabled, the ImageIndex value that is passed to the capsule
generation tool is important, since this is supposed to correspond to
the DFU alt number -- this ImageIndex value is then used to identify
the partition/address to which the capsule payload is to be written.
With the FWU feature enabled, this value is not obtained from the
capsule, since the partition/address to write the image to is
identified at runtime based on the value of the update bank.

> but the capsule file itself doesn't specify
> the banks. And acceptance/revert capsule file also doesn't specify it.
> Acceptance file will also uses image_type UUID, but not the partition
> UUID for the bank.

The image acceptance capsule will also contain the ImageTypeId. The
Accept bit will be set for the active bank image of the image type
specified in the acceptance capsule.

-sughosh

>
> Maybe I'm wrong, but I'm confusing. And this is important for the
> platform which doesn't use GPT.
>
> Thank you,
>
>
> --
> Masami Hiramatsu

  reply	other threads:[~2021-12-24 10:08 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-19  7:05 [RFC PATCH v2 0/8] FWU: Add support for FWU Multi Bank Update feature Sughosh Ganu
2021-12-19  7:05 ` [RFC PATCH v2 1/8] FWU: Add FWU metadata structure and functions for accessing metadata Sughosh Ganu
2021-12-21  0:10   ` Masami Hiramatsu
2021-12-21  4:35     ` Sughosh Ganu
2021-12-21  5:03       ` AKASHI Takahiro
2021-12-21  5:47         ` Sughosh Ganu
2021-12-21  6:01           ` Masami Hiramatsu
2021-12-21  6:08             ` Sughosh Ganu
2021-12-21  6:16           ` AKASHI Takahiro
2021-12-21  6:24             ` Sughosh Ganu
2021-12-19  7:05 ` [RFC PATCH v2 2/8] FWU: Add FWU metadata access functions for GPT partitioned block devices Sughosh Ganu
2021-12-24  9:59   ` Masami Hiramatsu
2021-12-24 17:08     ` Sughosh Ganu
2021-12-25  6:57       ` Masami Hiramatsu
2021-12-19  7:06 ` [RFC PATCH v2 3/8] FWU: stm32mp1: Add helper functions for accessing FWU metadata Sughosh Ganu
2021-12-24  5:49   ` Masami Hiramatsu
2021-12-24 10:07     ` Sughosh Ganu [this message]
2021-12-24 10:18       ` Masami Hiramatsu
2021-12-24 16:59         ` Sughosh Ganu
2021-12-19  7:06 ` [RFC PATCH v2 4/8] FWU: STM32MP1: Add support to read boot index from backup register Sughosh Ganu
2021-12-19  7:06 ` [RFC PATCH v2 5/8] EFI: FMP: Add provision to update image's ImageTypeId in image descriptor Sughosh Ganu
2021-12-21  4:53   ` AKASHI Takahiro
2021-12-21  5:34     ` Sughosh Ganu
2021-12-19  7:06 ` [RFC PATCH v2 6/8] FWU: Add boot time checks as highlighted by the FWU specification Sughosh Ganu
2021-12-20  6:09   ` AKASHI Takahiro
2021-12-20 10:06     ` Sughosh Ganu
2021-12-20 10:25       ` AKASHI Takahiro
2021-12-23 10:45         ` Sughosh Ganu
2021-12-19  7:06 ` [RFC PATCH v2 7/8] FWU: Add support for FWU Multi Bank Update feature Sughosh Ganu
2021-12-20  6:14   ` AKASHI Takahiro
2021-12-20  9:48     ` Sughosh Ganu
2021-12-20 13:13       ` Masami Hiramatsu
2021-12-20 16:36         ` Tom Rini
2021-12-20 23:30           ` Masami Hiramatsu
2021-12-20 23:57             ` Tom Rini
2021-12-23  0:53   ` Masami Hiramatsu
2021-12-23 10:39     ` Sughosh Ganu
2021-12-19  7:06 ` [RFC PATCH v2 8/8] FWU: cmd: Add a command to read FWU metadata Sughosh Ganu

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='CADg8p94XO2=+3TSk46FYgK3ndjNKUSBAoRF94MFhk=6tzHUPkQ@mail.gmail.com' \
    --to=sughosh.ganu@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=bmeng.cn@gmail.com \
    --cc=etienne.carriere@linaro.org \
    --cc=grant.likely@arm.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jason.hui.liu@nxp.com \
    --cc=jose.marinho@arm.com \
    --cc=masami.hiramatsu@linaro.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=sjg@chromium.org \
    --cc=takahiro.akashi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.