public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sedji Gaouaou <sedji.gaouaou@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] at91sam9260/9263: add back up fot the rst(reset	controller).
Date: Wed, 24 Jun 2009 08:24:42 +0200	[thread overview]
Message-ID: <4A41C6AA.3040509@atmel.com> (raw)
In-Reply-To: <20090623203727.GA4904@galileo>

Stelian Pop a ?crit :
> On Tue, Jun 23, 2009 at 12:46:50PM +0200, Sedji Gaouaou wrote:
> 
>> On the boards at91sam9260ek, at91sam9263ek and afed9260, the rstc register was
>> set to 0 after being set to 500 ms for the PHY reset.
>> Now if back up is enable it will be set to the saved value.
> 
> The changelog message is not very clear. What means "if backup is enabled" ?
> I don't see anything in the patch which can be enabled or disabled...
> 
To enable the back up you need to put a battery, so if there is no 
battery there is no back up...that is why I said if back up is enable :)
> I think you meant something like: "Do backup the old reset length and restore
> it after the MACB initialisation".
> 
But you comment is better, so I will change it.
>> +	rstc = at91_sys_read(AT91_RSTC_MR);
> [...]
>>  	/* Restore NRST value */
>>  	at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
>> -				     AT91_RSTC_ERSTL | (0x0 << 8) |
>> +				     (rstc) |
>>  				     AT91_RSTC_URSTEN);
> 
> Also, I don't like this: you backup in 'rstc' the _whole_ contents
> of the MR register (including for example the URSTEN bit), but on
> restore you still construct a bit mask...
> 
> In order to be consistent, I would do either:
> 
> rstc = at91_sys_read(AT91_RSTC_MR);
> ...
> at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY | rstc);
> 
> or
> 
> rstc = at91_sys_read(AT91_RSTC_MR) & AT91_RSTC_ERSTL;
> ...
> at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY | rstc | AT91_RSTC_URSTEN);
> 
I will change that to then.

Regards,
Sedji

  reply	other threads:[~2009-06-24  6:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-23 10:46 [U-Boot] [PATCH] at91sam9260/9263: add back up fot the rst(reset controller) Sedji Gaouaou
2009-06-23 12:38 ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-23 20:37 ` Stelian Pop
2009-06-24  6:24   ` Sedji Gaouaou [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-06-24  8:32 Sedji Gaouaou
2009-06-26 12:35 ` Stelian Pop
2009-06-27 15:21 ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-04 23:06   ` Wolfgang Denk
2009-07-05  9:59     ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-05 15:17       ` Wolfgang Denk

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=4A41C6AA.3040509@atmel.com \
    --to=sedji.gaouaou@atmel.com \
    --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