All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ARM: Consolidate bootcount_{store|load}
Date: Tue, 14 Sep 2010 11:42:28 +0200	[thread overview]
Message-ID: <20100914114228.63816997@wker> (raw)
In-Reply-To: <4C8ECBD6.3060004@emk-elektronik.de>

Dear Reinhard,

On Tue, 14 Sep 2010 03:11:50 +0200
Reinhard Meyer <u-boot@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

      reply	other threads:[~2010-09-14  9:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13 19:31 [U-Boot] [PATCH] ARM: Consolidate bootcount_{store|load} Anatolij Gustschin
2010-09-14  0:33 ` Reinhard Meyer
2010-09-14  1:11 ` Reinhard Meyer
2010-09-14  9:42   ` Anatolij Gustschin [this message]

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=20100914114228.63816997@wker \
    --to=agust@denx.de \
    --cc=u-boot@lists.denx.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.