public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] phy ic isn't reset
Date: Thu, 18 Apr 2013 09:23:48 +0800	[thread overview]
Message-ID: <516F4B24.5060809@atmel.com> (raw)
In-Reply-To: <1cdeaab7.eb01.13e178acf19.Coremail.laub923@163.com>

Hi Alex,

On 4/17/2013 18:29, alex wrote:
> Hi:
>    I work on one board based on at9g25evk board now. I find one issue
> that phy IC isn't reset, so network can't work. Only the different
> crystal with evk board is connected to PHY IC. I copy the phy-reset part
> of at9260 to at9g25. It can work now. Please the maintainer of at9gx5
> check this. The modification I do is as below:

As you mentioned, you use different crystal, please specify this in detail.

> +
> +#ifdef CONFIG_MACB
> +int at91sam9x5ek_macb_hw_init(void)
> +{
> +        struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
> +        struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
> +       struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
> +       unsigned long erstl;
> +
> +        /* Enable EMAC clock */
> +        writel(1 << ATMEL_ID_EMAC0, &pmc->pcer);
> +
> +       erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
> +
> +       /* Need to reset PHY -> 500ms reset */
> +       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);
> +
> +       /* Wait for end hardware reset */
> +       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
> +               ;
> +
> +       /* Restore NRST value */
> +       writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN,
> +                       &rstc->mr);
> +
> +       at91_macb_hw_init();
> +}
> +#endif

On at91sam9g25ek, it don't need this patch. The network work properly.

Btw, please help provide the log information for why not ethernet 
doesn't work.

Best Regards,
Bo Shen

>
> Best Regards,
> Alex
>
>

  reply	other threads:[~2013-04-18  1:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-17 10:29 [U-Boot] phy ic isn't reset alex
2013-04-18  1:23 ` Bo Shen [this message]
2013-04-18  5:27   ` alex
2013-04-18  6:32     ` Bo Shen
2013-04-18  7:07       ` alex
2013-04-18  7:50       ` Andreas Bießmann
2013-04-18  8:07         ` Bo Shen

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=516F4B24.5060809@atmel.com \
    --to=voice.shen@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