mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@kymetacorp.com>
To: Guillermo Rodriguez Garcia <guille.rodriguez@gmail.com>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>,
	Philipp Zabel <pza@pengutronix.de>
Subject: Re: Fwd: Micrel KSZ9031RN PHY problem
Date: Thu, 28 Apr 2016 21:09:43 +0000	[thread overview]
Message-ID: <1461877838.9103.173.camel@rtred1test09.kymeta.local> (raw)
In-Reply-To: <CABDcavbGbWKK=Arp8pth09LeohgnLd3zE4penEHZT41a_X2NPg@mail.gmail.com>

On Thu, 2016-04-28 at 11:51 +0200, Guillermo Rodriguez Garcia wrote:
> >
> > The code you are referring to seems to be the first phy access after the
> > network device opens. Maybe the hardware is not yet ready for some
> > reason. Could you add the same delay in macb_open() right before the
> > call to phy_device_connect()?
> 
> Tried this, but doesn't help. Here's the call sequence, for example
> when you run 'dhcp' from the command line prompt:
> 
> macb_open
> phy_device_connect
> phy_device_attach
> phy_init_hw
> ksz9031_config_init
> ksz9031_center_flp_timing
> genphy_restart_aneg
> genphy_config_advert -> fails (adv = 0xffff)
> 
> I can verify that:
> - Any delay happening before the call to genphy_restart_aneg (which
> itself is called at the end of ksz9031_center_flp_timing) does not fix
> the problem.
> - Any delay happening after the phy_read(phydev, MII_ADVERTISE) insde
> genphy_config_advert does not fix the problem.
> - A delay of 1ms at any point after genphy_restart_aneg and before the
> phy_read call in genphy_config_advert fixes the problem

So the same problem appears if you take out the FLP call out entirely,
if there is an aneg restart done immediately before trying to read from
MII_ADVERTISE?

Does only MII_ADVERTISE fail to read, or does reading any PHY register
fail?  Specifically, does reading MII_BMSR fail?

Reading PHY register after restarting aneg isn't unusual.  Especially
polling MII_BMSR to check for BMSR_ANEGCOMPLETE.  It would be odd if one
couldn't do that.

The first anreg start call will also un-powerdown the PHY if BMCR_PDOWN
was set.  I wonder if that is happening?
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-04-28 21:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABDcavZr1PCpFrHVJFFayRQZ6vninf-xFS0H9QKSdA8u53OkDg@mail.gmail.com>
2016-04-18 14:49 ` Guillermo Rodriguez Garcia
2016-04-19  7:11   ` Sascha Hauer
2016-04-20 15:58     ` Guillermo Rodriguez Garcia
2016-04-21  7:32       ` Sascha Hauer
2016-04-21 11:04         ` Guillermo Rodriguez Garcia
2016-04-26  9:55         ` Guillermo Rodriguez Garcia
2016-04-26 11:10           ` Guillermo Rodriguez Garcia
2016-04-27  5:59           ` Sascha Hauer
2016-04-28  9:51             ` Guillermo Rodriguez Garcia
2016-04-28 21:09               ` Trent Piepho [this message]
2016-04-29 11:00                 ` Guillermo Rodriguez Garcia
2016-04-29 18:18                   ` Trent Piepho
2016-05-03 14:40                     ` Guillermo Rodriguez Garcia
2016-05-04  7:43                       ` Sascha Hauer
2016-05-04 10:39                         ` Guillermo Rodriguez Garcia
2016-06-13 17:29                         ` [PATCH] Fix genphy_restart_aneg() for Micrel's ksz9031 Guillermo Rodriguez Garcia
2016-06-14  6:39                           ` Sascha Hauer
2016-06-14  7:39                             ` Guillermo Rodriguez Garcia
2016-06-15  5:49                               ` Sascha Hauer
2016-06-15  7:44                                 ` Guillermo Rodriguez Garcia

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=1461877838.9103.173.camel@rtred1test09.kymeta.local \
    --to=tpiepho@kymetacorp.com \
    --cc=barebox@lists.infradead.org \
    --cc=guille.rodriguez@gmail.com \
    --cc=pza@pengutronix.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