[PATCH v2 17/21] tools: mkfwumdata: migrate to metadata version 2

Sughosh Ganu sughosh.ganu at linaro.org
Mon Feb 19 12:42:43 CET 2024


hi Michal,

On Thu, 15 Feb 2024 at 20:01, Michal Simek <michal.simek at amd.com> wrote:
>
> Hi,
>
> On 2/12/24 08:47, Sughosh Ganu wrote:
> > Migrate the metadata generation tool to generate the version 2
> > metadata.
> >
> > Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> > ---
> >
> > Changes since V1:
> > * Compute location of struct fwu_fw_store_desc using pointer
> >    arithmetic.
> >
> >   tools/mkfwumdata.c | 45 ++++++++++++++++++++++++++++++++++-----------
> >   1 file changed, 34 insertions(+), 11 deletions(-)
> >
> > diff --git a/tools/mkfwumdata.c b/tools/mkfwumdata.c
> > index 9732a8ddc5..fb847e3a78 100644
> > --- a/tools/mkfwumdata.c
> > +++ b/tools/mkfwumdata.c
> > @@ -14,12 +14,13 @@
> >   #include <unistd.h>
> >   #include <uuid/uuid.h>
> >
> > -/* This will dynamically allocate the fwu_mdata */
> > -#define CONFIG_FWU_NUM_BANKS         0
> > -#define CONFIG_FWU_NUM_IMAGES_PER_BANK       0
> > -
> >   /* Since we can not include fwu.h, redefine version here. */
> > -#define FWU_MDATA_VERSION            1
> > +#define FWU_MDATA_VERSION            2
> > +
> > +#define MAX_BANKS                    4
> > +
> > +#define BANK_INVALID                 0xFF
> > +#define BANK_ACCEPTED                        0xFC
>
> I think in previous version only active bank was accepted not others.
> I don't think it is wrong behavior but please consider to select it too.
> I was just surprised to see both banks in that state.

In the current version as well, we do accept all the images, for all
banks. This is happening in the fwu_parse_fill_image_uuid() function,
where on line 207 we are setting the accepted field to 1 for all banks
for a given image.

-sughosh


More information about the U-Boot mailing list