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

Reinhard Meyer u-boot at emk-elektronik.de
Tue Sep 14 03:11:50 CEST 2010


Dear Anatolij Gustschin,
> 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!

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.

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.

Reinhard

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


More information about the U-Boot mailing list