Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1681080

Re: [PATCH] net: axienet: add of_phy_connect call for XAE_PHY_TYPE_MII case

From Florian Fainelli <f.fainelli@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] net: axienet: add of_phy_connect call for XAE_PHY_TYPE_MII case
Date 2017-07-04 18:30 +0200
Message-ID <tZyS6-2nd-1@gated-at.bofh.it> (permalink)
References <tY0ps-3C8-3@gated-at.bofh.it> <tY83E-8nx-17@gated-at.bofh.it> <tYKiC-su-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On July 2, 2017 3:19:14 AM PDT, Alvaro Gamez Machado <alvaro.gamez@hazent.com> wrote:
>On Fri, Jun 30, 2017 at 10:30:38AM -0700, Florian Fainelli wrote:
>> On 06/30/2017 02:25 AM, Alvaro Gamez Machado wrote:
>> >  	if (lp->phy_node) {
>> > -		if (lp->phy_type == XAE_PHY_TYPE_GMII) {
>> > +		if (lp->phy_type == XAE_PHY_TYPE_MII) {
>> > +			phydev = of_phy_connect(lp->ndev, lp->phy_node,
>> > +						axienet_adjust_link, 0,
>> > +						PHY_INTERFACE_MODE_MII);
>> > +		} else if (lp->phy_type == XAE_PHY_TYPE_GMII) {
>> >  			phydev = of_phy_connect(lp->ndev, lp->phy_node,
>> >  						axienet_adjust_link, 0,
>> >  						PHY_INTERFACE_MODE_GMII);
>> 
>> Seems like this could be simplified even further if the values of
>> lp->phy_type directly mapped to those of phy_interface_t.
>
>Sadly, that's not the case. PHY_INTERFACE_MODE_* belong to a enum of
>twenty
>different values, of which only _MII and _GMII overlap with XAW_PHY_*
>values, but XAE_PHY_TYPE_RGMII_2_0 doesn't match
>PHY_INTERFACE_MODE_RGMII_ID.

There are four different rgmii types to account for rx or tx delay, is not there one that really matches? If the driver is using of_get_phy_mode() to retrieve the standard 'phy-mode' / 'phy-connection-type' values then this internal representation is not needed anymore.

-- 
Florian

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] net: axienet: add of_phy_connect call for XAE_PHY_TYPE_MII case Florian Fainelli <f.fainelli@gmail.com> - 2017-07-04 18:30 +0200
  Re: [PATCH] net: axienet: add of_phy_connect call for  XAE_PHY_TYPE_MII case Alvaro Gamez Machado <alvaro.gamez@hazent.com> - 2017-07-05 12:20 +0200
    Re: [PATCH] net: axienet: add of_phy_connect call for  XAE_PHY_TYPE_MII case Andrew Lunn <andrew@lunn.ch> - 2017-07-05 16:40 +0200
      Re: [PATCH] net: axienet: add of_phy_connect call for  XAE_PHY_TYPE_MII case Alvaro Gamez Machado <alvaro.gamez@hazent.com> - 2017-07-05 16:50 +0200
        Re: [PATCH] net: axienet: add of_phy_connect call for  XAE_PHY_TYPE_MII case Andrew Lunn <andrew@lunn.ch> - 2017-07-05 17:30 +0200

csiph-web