All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] at91: Add support for taskit AT91SAM9G20 boards.
Date: Mon, 06 Aug 2012 14:18:18 +0200	[thread overview]
Message-ID: <501FB60A.4020200@gmail.com> (raw)
In-Reply-To: <20120803120533.GA29398@imko.de>

Dear Markus Hubig,

On 03.08.2012 14:05, Markus Hubig wrote:
> On Thu, Aug 02, 2012 at 03:28:30PM +0200, Markus Hubig wrote:
>> On Wed, Aug 01, 2012 at 10:21:04PM +0200, Andreas Bie?mann wrote:
>>> On 01.08.12 21:28, Markus Hubig wrote:
>>>> On Wed, Aug 01, 2012 at 11:58:22AM +0200, Andreas Bie?mann wrote:
>>>>>> +	/* Need to reset PHY -> 500ms reset */
>>>>>> +	writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13) |
>>>>>> +		AT91_RSTC_MR_URSTEN, &rstc->mr);
>>>>>
>>>>> Hmm ... is it OK to generate the user reset here? I know this is the
>>>>> same in at least at91sam9263ek, can you please check if we should
>>>>> instead delete that bit in MR?
>>>>
>>>> MR? Sorry I don't get this one. Please explain a bit ...
>>>
>>> I talked about URSTEN bit in RSTC_MR (Reset Controller Mode Register;
>>> p99 in at91sam9g20 datasheet). The URSTEN bit set to 1 means disable low
>>> level detection on NRST pin. Which in fact disables external reset with
>>> the reset key. One have to check if this is true or maybe I'm wrong here.
>>
>> Hmm ok I'll investigate this a bit further ...
> 
> OK I looked this up in the at91sam9g20 datasheet, but as fahr as I understand
> it, setting AT91_RSTC_MR_URSTEN enables the *detection* of a low level on NRST
> to trigger USER RESET, while in order to perform the PHY Reset, NRST just hast
> to get low. To get NRST low, one has to set EXTRST in RSTC_CR.

correct.

> 
> So to perform a PHY Reset, the correct code should be:
> 
> | /* Reset PHY for 500ms */
> | writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13)
> |	& ~AT91_RSTC_MR_URSTEN, &rstc->mr);
> | writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
> 
> I tested it with my PortuxG20 and Network is still working!
> 
> Unfortunatlie the Portux has no reset button, but I think for all at91sam9g20
> boards with a reset button the AT91_RSTC_MR_URSTEN has to be high by default,
> so somewhere in arch/arm/cpu/arm926ejs/at91/ there has to be some code like
> this:
> 
> |#ifdef CONFIG_AT91_RESET_BUTTON
> |struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
> |writel(AT91_RSTC_KEY | AT91_RSTC_MR_URSTEN, &rstc->mr);
> |#endif

Well, I think it is up to the board maintainer to verify the reset
switch is working.

Best regards

Andreas Bie?mann

  reply	other threads:[~2012-08-06 12:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30 18:01 [U-Boot] [PATCH] at91: Add support for taskit AT91SAM9G20 boards Markus Hubig
2012-08-01  9:58 ` Andreas Bießmann
2012-08-01 19:28   ` Markus Hubig
2012-08-01 20:21     ` Andreas Bießmann
2012-08-02 13:28       ` Markus Hubig
2012-08-02 13:59         ` [U-Boot] [PATCHv3] " Markus Hubig
2012-08-03 12:05         ` [U-Boot] [PATCH] " Markus Hubig
2012-08-06 12:18           ` Andreas Bießmann [this message]
2012-08-01 19:49   ` [U-Boot] [PATCH] Enable the EMAC clock in at91_macb_hw_init() Markus Hubig
2012-08-07 22:14     ` Andreas Bießmann
2012-08-01 19:57   ` [U-Boot] [PATCHv2] at91: Add support for taskit AT91SAM9G20 boards Markus Hubig
2012-08-01 20:59     ` Andreas Bießmann
2012-08-02 10:46       ` Markus Hubig
2012-08-06 12:22         ` Andreas Bießmann
2012-08-02 14:14   ` [U-Boot] [PATCH] " Markus Hubig
2012-08-06 12:49     ` Andreas Bießmann
2012-08-06 16:03       ` Markus Hubig
2012-08-06  9:05 ` Markus Hubig
2012-08-06  9:13   ` Markus Hubig

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=501FB60A.4020200@gmail.com \
    --to=andreas.devel@googlemail.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 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.