All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shengzhou.Liu at freescale.com <Shengzhou.Liu@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net/phy: refactor RTL8211F initialization
Date: Fri, 24 Apr 2015 08:19:58 +0000	[thread overview]
Message-ID: <DM2PR03MB398546BF1FF5D6129191A30F8EC0@DM2PR03MB398.namprd03.prod.outlook.com> (raw)
In-Reply-To: <CANr=Z=ZaN+RL=Gr_FFc+sfZ+pSubOHs9Kae_+CL5qYashWFh9Q@mail.gmail.com>


> -----Original Message-----
> From: Joe Hershberger [mailto:joe.hershberger at gmail.com]
> Sent: Thursday, April 23, 2015 10:42 PM
> To: Liu Shengzhou-B36685
> Cc: u-boot
> Subject: Re: [PATCH] net/phy: refactor RTL8211F initialization
> 
> Hi Shengzhou Liu,
> 
> On Wed, Apr 22, 2015 at 5:22 AM, Shengzhou Liu <Shengzhou.Liu@freescale.com>
> wrote:
> > RTL8211F needs to enalbe TXDLY for RGMII during phy initialization, so
> > move it to rtl8211f_config for early initialization.
> >
> > Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> > cc: Joe Hershberger <joe.hershberger@gmail.com>
> > ---
> >  drivers/net/phy/realtek.c | 25 +++++++++++++++++--------
> >  1 file changed, 17 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
> > index 3917c82..d48095b 100644
> > --- a/drivers/net/phy/realtek.c
> > +++ b/drivers/net/phy/realtek.c
> > @@ -43,6 +43,22 @@ static int rtl8211x_config(struct phy_device *phydev)
> >         return 0;
> >  }
> >
> > +static int rtl8211f_config(struct phy_device *phydev) {
> > +       phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET);
> 
> Do you not need to disable the phy interrupt here?
No need, It's disabled by default.

> > +
> > +       if (phydev->interface == PHY_INTERFACE_MODE_RGMII) {
> > +               /* enable TXDLY */
> > +               phy_write(phydev, MDIO_DEVAD_NONE,
> > +                         MIIM_RTL8211F_PAGE_SELECT, 0xd08);
> 
> Why do you not need to change the page back to default? Does it only apply to
> one following command or something? I haven't read the data sheet for this
> phy to understand its behavior, but want to make sure it's clear here.
> Please at least add a comment describing why the page need not be changed
> back.
There is no other command, so it's working without back to default. 
To avoid potential problem if one not set expected page, will have the page back to default 0 in v2.
 
> > +               phy_write(phydev, MDIO_DEVAD_NONE, 0x11, 0x109);
> 
> Is this TX delay board specific? Seems like it would be. Should it be
> parameterized to come from a board CONFIG_? If not, at least add a comment
> describing these magic numbers.

It is not board specific. Will replace the magic number.

      reply	other threads:[~2015-04-24  8:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22 10:22 [PATCH] net/phy: refactor RTL8211F initialization Shengzhou Liu
2015-04-22 16:57 ` Florian Fainelli
2015-04-23  3:53   ` Shengzhou.Liu
2015-04-23  4:39     ` Florian Fainelli
2015-04-23  5:58       ` Shengzhou.Liu
2015-04-23 14:42         ` [U-Boot] " Joe Hershberger
2015-04-23 14:42 ` Joe Hershberger
2015-04-24  8:19   ` Shengzhou.Liu at freescale.com [this message]

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=DM2PR03MB398546BF1FF5D6129191A30F8EC0@DM2PR03MB398.namprd03.prod.outlook.com \
    --to=shengzhou.liu@freescale.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.