public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Reinhard Meyer <u-boot@emk-elektronik.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ARM: Consolidate bootcount_{store|load}
Date: Tue, 14 Sep 2010 02:33:58 +0200	[thread overview]
Message-ID: <4C8EC2F6.6090303@emk-elektronik.de> (raw)
In-Reply-To: <1284406319-9032-1-git-send-email-agust@denx.de>

Dear Anatolij Gustschin,
> The latter was already used by AT91.

Looking at your patch I just noticed that the AT91 version is not up to
date. It won't work for AT91SAM9XE. I had a better, struct access variant
in my tree but somehow due to rebasing I must have lost it...

I'll reconstruct it and send you the source snippets to access the bootcount
with struct and readl/writel using the defines in at91_gpbr.h ?

It was something like

at91_gpbr_t *gpbr = (at91_gpbr_t *) AT91_GPR_BASE;

value = readl(&gpbr->reg[AT91_GPBR_INDEX_BOOTCOUNT]);

writel(value, &gpbr->reg[AT91_GPBR_INDEX_BOOTCOUNT]);

I don't think we should keep using the *(volatile *) access methods here,
but if, the address calculation would have to be:

+#include <asm/arch/at91_gpbr.h>

-#define AT91_GPBR_BOOTCOUNT_REGISTER 3
-#define AT91_BOOTCOUNT_ADDRESS	(AT91_GPBR + 4 * AT91_GPBR_BOOTCOUNT_REGISTER)
-#define CONFIG_SYS_BOOTCOUNT_ADDR	(AT91_BASE_SYS + AT91_BOOTCOUNT_ADDRESS)
+#define CONFIG_SYS_BOOTCOUNT_ADDR	(AT91_GPBR_BASE + 4 * AT91_GPBR_INDEX_BOOTCOUNT)

Looking at this, I think its not really helpful to extract the bootcount access
from at91 / cpu.c ... to a common arm file.

Reinhard

  reply	other threads:[~2010-09-14  0:33 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 [this message]
2010-09-14  1:11 ` Reinhard Meyer
2010-09-14  9:42   ` Anatolij Gustschin

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=4C8EC2F6.6090303@emk-elektronik.de \
    --to=u-boot@emk-elektronik.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox