diff mbox series

[net,1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link()

Message ID 1584101065-3482-2-git-send-email-madalin.bucur@oss.nxp.com
State Changes Requested
Delegated to: David Miller
Headers show
Series QorIQ DPAA ARM RDBs need internal delay on RGMII | expand

Commit Message

Madalin Bucur (OSS) March 13, 2020, 12:04 p.m. UTC
Treat all internal delay variants the same as RGMII.

Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
---
 drivers/net/ethernet/freescale/fman/fman_memac.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Andrew Lunn March 14, 2020, 9:16 p.m. UTC | #1
On Fri, Mar 13, 2020 at 02:04:23PM +0200, Madalin Bucur wrote:
> Treat all internal delay variants the same as RGMII.
> 
> Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
> ---
>  drivers/net/ethernet/freescale/fman/fman_memac.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c
> index e1901874c19f..0fc98584974a 100644
> --- a/drivers/net/ethernet/freescale/fman/fman_memac.c
> +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c
> @@ -782,7 +782,10 @@ int memac_adjust_link(struct fman_mac *memac, u16 speed)
>  	/* Set full duplex */
>  	tmp &= ~IF_MODE_HD;
>  
> -	if (memac->phy_if == PHY_INTERFACE_MODE_RGMII) {
> +	if (memac->phy_if == PHY_INTERFACE_MODE_RGMII ||
> +	    memac->phy_if == PHY_INTERFACE_MODE_RGMII_ID ||
> +	    memac->phy_if == PHY_INTERFACE_MODE_RGMII_RXID ||
> +	    memac->phy_if == PHY_INTERFACE_MODE_RGMII_TXID) {

Hi Madalin

You can use phy_interface_mode_is_rgmii()

    Andrew
Madalin Bucur (OSS) March 16, 2020, 7:49 a.m. UTC | #2
> -----Original Message-----
> From: Andrew Lunn <andrew@lunn.ch>
> Sent: Saturday, March 14, 2020 11:16 PM
> To: Madalin Bucur (OSS) <madalin.bucur@oss.nxp.com>
> Cc: davem@davemloft.net; netdev@vger.kernel.org;
> devicetree@vger.kernel.org; shawnguo@kernel.org; Leo Li
> <leoyang.li@nxp.com>; robh+dt@kernel.org; mark.rutland@arm.com; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in
> memac_adjust_link()
> 
> On Fri, Mar 13, 2020 at 02:04:23PM +0200, Madalin Bucur wrote:
> > Treat all internal delay variants the same as RGMII.
> >
> > Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
> > ---
> >  drivers/net/ethernet/freescale/fman/fman_memac.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c
> b/drivers/net/ethernet/freescale/fman/fman_memac.c
> > index e1901874c19f..0fc98584974a 100644
> > --- a/drivers/net/ethernet/freescale/fman/fman_memac.c
> > +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c
> > @@ -782,7 +782,10 @@ int memac_adjust_link(struct fman_mac *memac, u16
> speed)
> >  	/* Set full duplex */
> >  	tmp &= ~IF_MODE_HD;
> >
> > -	if (memac->phy_if == PHY_INTERFACE_MODE_RGMII) {
> > +	if (memac->phy_if == PHY_INTERFACE_MODE_RGMII ||
> > +	    memac->phy_if == PHY_INTERFACE_MODE_RGMII_ID ||
> > +	    memac->phy_if == PHY_INTERFACE_MODE_RGMII_RXID ||
> > +	    memac->phy_if == PHY_INTERFACE_MODE_RGMII_TXID) {
> 
> Hi Madalin
> 
> You can use phy_interface_mode_is_rgmii()
> 
>     Andrew

I have that on the todo list for all the places in the code, but that's
net-next material.

Thanks,
Madalin
Andrew Lunn March 16, 2020, 8:39 a.m. UTC | #3
> > Hi Madalin
> > 
> > You can use phy_interface_mode_is_rgmii()
> > 
> >     Andrew
> 
> I have that on the todo list for all the places in the code, but that's
> net-next material.

I don't see why it cannot be used here, for this case, now.

  Andrew
Madalin Bucur (OSS) March 16, 2020, 9 a.m. UTC | #4
> -----Original Message-----
> From: Andrew Lunn <andrew@lunn.ch>
> Sent: Monday, March 16, 2020 10:39 AM
> To: Madalin Bucur (OSS) <madalin.bucur@oss.nxp.com>
> Cc: davem@davemloft.net; netdev@vger.kernel.org;
> devicetree@vger.kernel.org; shawnguo@kernel.org; Leo Li
> <leoyang.li@nxp.com>; robh+dt@kernel.org; mark.rutland@arm.com; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in
> memac_adjust_link()
> 
> > > Hi Madalin
> > >
> > > You can use phy_interface_mode_is_rgmii()
> > >
> > >     Andrew
> >
> > I have that on the todo list for all the places in the code, but that's
> > net-next material.
> 
> I don't see why it cannot be used here, for this case, now.
> 
>   Andrew

I'll send a v2 with this, I was referring to the rest of them.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c
index e1901874c19f..0fc98584974a 100644
--- a/drivers/net/ethernet/freescale/fman/fman_memac.c
+++ b/drivers/net/ethernet/freescale/fman/fman_memac.c
@@ -782,7 +782,10 @@  int memac_adjust_link(struct fman_mac *memac, u16 speed)
 	/* Set full duplex */
 	tmp &= ~IF_MODE_HD;
 
-	if (memac->phy_if == PHY_INTERFACE_MODE_RGMII) {
+	if (memac->phy_if == PHY_INTERFACE_MODE_RGMII ||
+	    memac->phy_if == PHY_INTERFACE_MODE_RGMII_ID ||
+	    memac->phy_if == PHY_INTERFACE_MODE_RGMII_RXID ||
+	    memac->phy_if == PHY_INTERFACE_MODE_RGMII_TXID) {
 		/* Configure RGMII in manual mode */
 		tmp &= ~IF_MODE_RGMII_AUTO;
 		tmp &= ~IF_MODE_RGMII_SP_MASK;