[U-Boot] [PATCH] ARM: Consolidate bootcount_{store|load}

Anatolij Gustschin agust at denx.de
Tue Sep 14 11:42:28 CEST 2010


Dear Reinhard,

On Tue, 14 Sep 2010 03:11:50 +0200
Reinhard Meyer <u-boot at emk-elektronik.de> wrote:
...
> > This patch consolidates bootcount_{store|load} for ARM by
> > implementing a common version in arch/arm/lib/bootcount.c. This
> > code is now used by all ARM variants that currently have these
> > functions implemented.
> >
> > Also supports two different bootcount versions:
> >
> >      a) Use 2 separate words (2 * 32bit) to store the bootcounter
> >      b) Use only 1 word (2 * 16bit) to store the bootcounter
> >
> > The latter was already used by AT91.
> 
> More specific: only AT91SAM9260. There are many more AT91 SoCs
> that might want to use bootcount in the future!

Ok, I can fix this description.
 
> The more I think about it, the less sense it makes to move
> bootcount access to arm/lib:
> 
> Handling bootcount is very SoC (maybe even board, if the SoC has no
> nonvolatile storage) and definitely not ARM specific.

SoC header or board config file can just define the nonvolatile
storage address. We do not need to add the same load/store
functions for each SoC.

> Moving it from ARM-SoC specific files to a common ARM-lib file will
> cause many conditional compiles there.
> 
> The arch/powerpc/lib/bootcount.c is an example how the arm/lib/bootcount.c
> is going to look like in the long run.

We do not need to add storage address definition in common code.
The SoC header or board config file could define the address.
If the load/store functions need to be more complicated, we can
provide weak default functions in the common ARM-lib code and
let the board code define board specific functions.

...
> PS: your bootcount.c misses the GPL header...

Ok.

Thanks,
Anatolij

--
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de


More information about the U-Boot mailing list