public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] net: phy: Add PHY driver for mv88e61xx switches
Date: Wed, 27 Jan 2016 18:28:43 +0100	[thread overview]
Message-ID: <20160127182843.7f7c13a2@lilith> (raw)
In-Reply-To: <56A8F077.60308@elecsyscorp.com>

Hello Kevin,

On Wed, 27 Jan 2016 16:29:42 +0000, Kevin Smith
<kevin.smith@elecsyscorp.com> wrote:
> Hi Joe,

> On 01/26/2016 06:11 PM, Joe Hershberger wrote:

> >> +       /* Replace the bus with the fake device */
> > Fake how? This is a confusing comment to me as written.
> The genphy functions assume that they can write to the PHY directly 
> using the MII bus, and the address it uses is the address of a 
> register.  This is not the case for this chip with multiple PHY 
> interfaces, which have to be accessed indirectly.  To handle this, I 
> have created a "fake" mii_dev whose read/write functions are the 
> indirection functions, and stored the actual mdio_bus in the private 
> data for the "fake" device, which is then used by the indirect 
> functions.  This allows this driver to make use of common genphy stuff 
> where appropriate.  Maybe "wrapper" or "indirect bus" is a better name 
> for it.  Let me know if you have a preference or better idea.

"Indirect bus" is better IMO, as it gives a clue about what actually
happens.

> >> +
> >> +       mac_addr = phydev->addr;
> >> +
> >> +       for (i = 0; i < PORT_COUNT; i++) {
> >> +               if ((1 << i) & CONFIG_MV88E61XX_PHY_PORTS) {
> >> +                       phydev->addr = i;
> >> +                       mv88e61xx_phy_enable(phydev, i);
> >> +                       mv88e61xx_phy_setup(phydev, i);
> >> +                       mv88e61xx_phy_config_port(phydev, i);
> > These all return status, but are ignored.
> Even if one fails, it seems appropriate to me to continue initializing 
> the others and not bail completely.  Should I catch the error, print a 
> warning and "continue" in the loop?  Or is completely bailing the right 
> thing to do?  If there are some errors, but other successes, what should 
> the function return?

Warn for each port switch initialization failure, bail out if no port
could be initialized?

> Thanks,
> Kevin

Amicalement,
-- 
Albert.

  reply	other threads:[~2016-01-27 17:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-21 21:45 [U-Boot] [PATCH 0/2] net: phy: mv88e61xx: Revise as a PHY driver Kevin Smith
2015-12-21 21:45 ` [U-Boot] [PATCH v2 " Kevin Smith
2016-01-26 16:09   ` Albert ARIBAUD
2016-01-26 16:13     ` Joe Hershberger
2016-01-26 16:56       ` Kevin Smith
2016-01-26 22:13         ` Albert ARIBAUD
2015-12-21 21:45 ` [U-Boot] [PATCH v2 1/2] net: Remove unused mv88e61xx switch driver Kevin Smith
2016-01-26 15:08   ` Joe Hershberger
2015-12-21 21:45 ` [U-Boot] [PATCH v2 2/2] net: phy: Add PHY driver for mv88e61xx switches Kevin Smith
2016-01-27  0:11   ` Joe Hershberger
2016-01-27 16:29     ` Kevin Smith
2016-01-27 17:28       ` Albert ARIBAUD [this message]
2016-01-27 20:11         ` Joe Hershberger
2016-03-31 19:33 ` [U-Boot] [PATCH v3 0/2] net: phy: mv88e61xx: Revise as a PHY driver Kevin Smith
2016-03-31 19:33   ` [U-Boot] [PATCH v3 1/2] net: Remove unused mv88e61xx switch driver Kevin Smith
2016-05-03 20:17     ` [U-Boot] " Joe Hershberger
2016-03-31 19:33   ` [U-Boot] [PATCH v3 2/2] net: phy: Add PHY driver for mv88e61xx switches Kevin Smith
2016-04-25 22:14     ` Joe Hershberger
2016-05-03 20:17     ` [U-Boot] " Joe Hershberger

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=20160127182843.7f7c13a2@lilith \
    --to=albert.u.boot@aribaud.net \
    --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