[PATCH v8 08/13] FWU: Add boot time checks as highlighted by the FWU specification

Simon Glass sjg at chromium.org
Thu Aug 18 19:49:33 CEST 2022


Hi Sughosh,

On Thu, 18 Aug 2022 at 05:42, Sughosh Ganu <sughosh.ganu at linaro.org> wrote:
>
> hi Simon,
>
> On Thu, 18 Aug 2022 at 08:51, Simon Glass <sjg at chromium.org> wrote:
> >
> > Hi Sughosh,
> >
> > On Wed, 17 Aug 2022 at 06:44, Sughosh Ganu <sughosh.ganu at linaro.org>
wrote:
> > >
> > > The FWU Multi Bank Update specification requires the Update Agent to
> > > carry out certain checks at the time of platform boot. The Update
> > > Agent is the component which is responsible for updating the firmware
> > > components and maintaining and keeping the metadata in sync.
> > >
> > > The spec requires that the Update Agent perform the following checks
> > > at the time of boot
> > > * Sanity check of both the metadata copies maintained by the platform.
> > > * Get the boot index passed to U-Boot by the prior stage bootloader
> > >   and use this value for metadata bookkeeping.
> > > * Check if the system is booting in Trial State. If the system boots
> > >   in the Trial State for more than a specified number of boot counts,
> > >   change the Active Bank to be booting the platform from.
> > >
> > > Add these checks in the board initialisation sequence, invoked after
> > > relocation.
> > >
> > > Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> > > ---
> > > Changes since V7:
> > > * Introduce trial_counter_update() to increment and delete the
> > >   TrialStateCtr variable.
> > > * Introduce in_trial_state() to check if the platform is booting in
> > >   Trial State.
> > >
> > >  common/board_r.c      |   5 ++
> > >  include/fwu.h         |   3 +
> > >  lib/fwu_updates/fwu.c | 175
++++++++++++++++++++++++++++++++++++++++++
> > >  3 files changed, 183 insertions(+)
> >
> > We should use the event system instead of adding another hook. We are
> > trying to get rid of them!
>
> Okay, I will check about this.
>
> >
> > Also, please separate out the fwu change from touching common code
> > (although you may not need to touch comment code with events).
>
> The FWU specification requires certain checks to be run at the
> platform boot time. Not sure how else will that be done(although this
> might not be relevant if I can use events).
>

You can have an 'fwu' command to handle this.

Regards,
Simon

> -sughosh


More information about the U-Boot mailing list