linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] QorIQ DPAA ARM RDBs need internal delay on RGMII
@ 2020-03-13 12:04 Madalin Bucur
  2020-03-13 12:04 ` [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link() Madalin Bucur
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Madalin Bucur @ 2020-03-13 12:04 UTC (permalink / raw)
  To: davem, netdev
  Cc: devicetree, shawnguo, leoyang.li, robh+dt, mark.rutland,
	linux-kernel, Madalin Bucur

The QorIQ DPAA 1 based RDB boards require internal delay on
both Tx and Rx to be set. The patch set ensures all RGMII
modes are treated correctly by the FMan driver and sets the
phy-connection-type to "rgmii-id" to restore functionality.
Previously Rx internal delay was set by board pull-ups and
was left untouched by the PHY driver. Since commit
1b3047b5208a80 ("net: phy: realtek: add support for
configuring the RX delay on RTL8211F") the Realtek 8211F PHY
driver has control over the RGMII RX delay and it is
disabling it for other modes than RGMII_RXID and RGMII_ID.

Please note that u-boot in particular performs a fix-up of
the PHY connection type and will overwrite the values from
the Linux device tree. Another patch set was sent for u-boot
and one needs to apply that [1] to the boot loader, to ensure
this fix is complete, unless a different bootloader is used.

[1] u-boot patches, Madalin Bucur (3):
  net: fman: add support for all RGMII delay modes
  armv8/ls1043ardb: RGMII ports require internal delay
  armv8/ls1046ardb: RGMII ports require internal delay

Madalin Bucur (3):
  net: fsl/fman: treat all RGMII modes in memac_adjust_link()
  arm64: dts: ls1043a-rdb: correct RGMII delay mode to rgmii-id
  arm64: dts: ls1046ardb: set RGMII interfaces to RGMII_ID mode

 arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts | 4 ++--
 arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts | 4 ++--
 drivers/net/ethernet/freescale/fman/fman_memac.c  | 5 ++++-
 3 files changed, 8 insertions(+), 5 deletions(-)

-- 
2.1.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link()
  2020-03-13 12:04 [PATCH net 0/3] QorIQ DPAA ARM RDBs need internal delay on RGMII Madalin Bucur
@ 2020-03-13 12:04 ` Madalin Bucur
  2020-03-14 21:16   ` Andrew Lunn
  2020-03-13 12:04 ` [PATCH net 2/3] arm64: dts: ls1043a-rdb: correct RGMII delay mode to rgmii-id Madalin Bucur
  2020-03-13 12:04 ` [PATCH net 3/3] arm64: dts: ls1046ardb: set RGMII interfaces to RGMII_ID mode Madalin Bucur
  2 siblings, 1 reply; 10+ messages in thread
From: Madalin Bucur @ 2020-03-13 12:04 UTC (permalink / raw)
  To: davem, netdev
  Cc: devicetree, shawnguo, leoyang.li, robh+dt, mark.rutland,
	linux-kernel, Madalin Bucur

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) {
 		/* Configure RGMII in manual mode */
 		tmp &= ~IF_MODE_RGMII_AUTO;
 		tmp &= ~IF_MODE_RGMII_SP_MASK;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net 2/3] arm64: dts: ls1043a-rdb: correct RGMII delay mode to rgmii-id
  2020-03-13 12:04 [PATCH net 0/3] QorIQ DPAA ARM RDBs need internal delay on RGMII Madalin Bucur
  2020-03-13 12:04 ` [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link() Madalin Bucur
@ 2020-03-13 12:04 ` Madalin Bucur
  2020-03-14 21:18   ` Andrew Lunn
  2020-03-13 12:04 ` [PATCH net 3/3] arm64: dts: ls1046ardb: set RGMII interfaces to RGMII_ID mode Madalin Bucur
  2 siblings, 1 reply; 10+ messages in thread
From: Madalin Bucur @ 2020-03-13 12:04 UTC (permalink / raw)
  To: davem, netdev
  Cc: devicetree, shawnguo, leoyang.li, robh+dt, mark.rutland,
	linux-kernel, Madalin Bucur

The correct setting for the RGMII ports on LS1043ARDB is to
enable delay on both Rx and Tx so the interface mode used must
be PHY_INTERFACE_MODE_RGMII_ID.

Since commit 1b3047b5208a80 ("net: phy: realtek: add support for
configuring the RX delay on RTL8211F") the Realtek 8211F PHY driver
has control over the RGMII RX delay and it is disabling it for
RGMII_TXID. The LS1043ARDB uses two such PHYs in RGMII_ID mode but
in the device tree the mode was described as "rgmii_txid".
This issue was not apparent at the time as the PHY driver took the
same action for RGMII_TXID and RGMII_ID back then but it became
visible (RX no longer working) after the above patch.

Changing the phy-connection-type to "rgmii-id" to address the issue.

Fixes: bf02f2ffe59c ("arm64: dts: add LS1043A DPAA FMan support")
Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts
index 4223a2352d45..dde50c88f5e3 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts
@@ -119,12 +119,12 @@
 
 	ethernet@e4000 {
 		phy-handle = <&rgmii_phy1>;
-		phy-connection-type = "rgmii-txid";
+		phy-connection-type = "rgmii-id";
 	};
 
 	ethernet@e6000 {
 		phy-handle = <&rgmii_phy2>;
-		phy-connection-type = "rgmii-txid";
+		phy-connection-type = "rgmii-id";
 	};
 
 	ethernet@e8000 {
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net 3/3] arm64: dts: ls1046ardb: set RGMII interfaces to RGMII_ID mode
  2020-03-13 12:04 [PATCH net 0/3] QorIQ DPAA ARM RDBs need internal delay on RGMII Madalin Bucur
  2020-03-13 12:04 ` [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link() Madalin Bucur
  2020-03-13 12:04 ` [PATCH net 2/3] arm64: dts: ls1043a-rdb: correct RGMII delay mode to rgmii-id Madalin Bucur
@ 2020-03-13 12:04 ` Madalin Bucur
  2020-03-14 21:19   ` Andrew Lunn
  2 siblings, 1 reply; 10+ messages in thread
From: Madalin Bucur @ 2020-03-13 12:04 UTC (permalink / raw)
  To: davem, netdev
  Cc: devicetree, shawnguo, leoyang.li, robh+dt, mark.rutland,
	linux-kernel, Madalin Bucur

The correct setting for the RGMII ports on LS1046ARDB is to
enable delay on both Rx and Tx so the interface mode used must
be PHY_INTERFACE_MODE_RGMII_ID.

Since commit 1b3047b5208a80 ("net: phy: realtek: add support for
configuring the RX delay on RTL8211F") the Realtek 8211F PHY driver
has control over the RGMII RX delay and it is disabling it for
RGMII_TXID. The LS1046ARDB uses two such PHYs in RGMII_ID mode but
in the device tree the mode was described as "rgmii".

Changing the phy-connection-type to "rgmii-id" to address the issue.

Fixes: 3fa395d2c48a ("arm64: dts: add LS1046A DPAA FMan nodes")
Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts
index dbc23d6cd3b4..d53ccc56bb63 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts
@@ -131,12 +131,12 @@
 &fman0 {
 	ethernet@e4000 {
 		phy-handle = <&rgmii_phy1>;
-		phy-connection-type = "rgmii";
+		phy-connection-type = "rgmii-id";
 	};
 
 	ethernet@e6000 {
 		phy-handle = <&rgmii_phy2>;
-		phy-connection-type = "rgmii";
+		phy-connection-type = "rgmii-id";
 	};
 
 	ethernet@e8000 {
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link()
  2020-03-13 12:04 ` [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link() Madalin Bucur
@ 2020-03-14 21:16   ` Andrew Lunn
  2020-03-16  7:49     ` Madalin Bucur (OSS)
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Lunn @ 2020-03-14 21:16 UTC (permalink / raw)
  To: Madalin Bucur
  Cc: davem, netdev, devicetree, shawnguo, leoyang.li, robh+dt,
	mark.rutland, linux-kernel

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net 2/3] arm64: dts: ls1043a-rdb: correct RGMII delay mode to rgmii-id
  2020-03-13 12:04 ` [PATCH net 2/3] arm64: dts: ls1043a-rdb: correct RGMII delay mode to rgmii-id Madalin Bucur
@ 2020-03-14 21:18   ` Andrew Lunn
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Lunn @ 2020-03-14 21:18 UTC (permalink / raw)
  To: Madalin Bucur
  Cc: davem, netdev, devicetree, shawnguo, leoyang.li, robh+dt,
	mark.rutland, linux-kernel

On Fri, Mar 13, 2020 at 02:04:24PM +0200, Madalin Bucur wrote:
> The correct setting for the RGMII ports on LS1043ARDB is to
> enable delay on both Rx and Tx so the interface mode used must
> be PHY_INTERFACE_MODE_RGMII_ID.
> 
> Since commit 1b3047b5208a80 ("net: phy: realtek: add support for
> configuring the RX delay on RTL8211F") the Realtek 8211F PHY driver
> has control over the RGMII RX delay and it is disabling it for
> RGMII_TXID. The LS1043ARDB uses two such PHYs in RGMII_ID mode but
> in the device tree the mode was described as "rgmii_txid".
> This issue was not apparent at the time as the PHY driver took the
> same action for RGMII_TXID and RGMII_ID back then but it became
> visible (RX no longer working) after the above patch.
> 
> Changing the phy-connection-type to "rgmii-id" to address the issue.
> 
> Fixes: bf02f2ffe59c ("arm64: dts: add LS1043A DPAA FMan support")
> Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net 3/3] arm64: dts: ls1046ardb: set RGMII interfaces to RGMII_ID mode
  2020-03-13 12:04 ` [PATCH net 3/3] arm64: dts: ls1046ardb: set RGMII interfaces to RGMII_ID mode Madalin Bucur
@ 2020-03-14 21:19   ` Andrew Lunn
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Lunn @ 2020-03-14 21:19 UTC (permalink / raw)
  To: Madalin Bucur
  Cc: davem, netdev, devicetree, shawnguo, leoyang.li, robh+dt,
	mark.rutland, linux-kernel

On Fri, Mar 13, 2020 at 02:04:25PM +0200, Madalin Bucur wrote:
> The correct setting for the RGMII ports on LS1046ARDB is to
> enable delay on both Rx and Tx so the interface mode used must
> be PHY_INTERFACE_MODE_RGMII_ID.
> 
> Since commit 1b3047b5208a80 ("net: phy: realtek: add support for
> configuring the RX delay on RTL8211F") the Realtek 8211F PHY driver
> has control over the RGMII RX delay and it is disabling it for
> RGMII_TXID. The LS1046ARDB uses two such PHYs in RGMII_ID mode but
> in the device tree the mode was described as "rgmii".
> 
> Changing the phy-connection-type to "rgmii-id" to address the issue.
> 
> Fixes: 3fa395d2c48a ("arm64: dts: add LS1046A DPAA FMan nodes")
> Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link()
  2020-03-14 21:16   ` Andrew Lunn
@ 2020-03-16  7:49     ` Madalin Bucur (OSS)
  2020-03-16  8:39       ` Andrew Lunn
  0 siblings, 1 reply; 10+ messages in thread
From: Madalin Bucur (OSS) @ 2020-03-16  7:49 UTC (permalink / raw)
  To: Andrew Lunn, Madalin Bucur (OSS)
  Cc: davem, netdev, devicetree, shawnguo, Leo Li, robh+dt,
	mark.rutland, linux-kernel

> -----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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link()
  2020-03-16  7:49     ` Madalin Bucur (OSS)
@ 2020-03-16  8:39       ` Andrew Lunn
  2020-03-16  9:00         ` Madalin Bucur (OSS)
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Lunn @ 2020-03-16  8:39 UTC (permalink / raw)
  To: Madalin Bucur (OSS)
  Cc: davem, netdev, devicetree, shawnguo, Leo Li, robh+dt,
	mark.rutland, linux-kernel

> > 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link()
  2020-03-16  8:39       ` Andrew Lunn
@ 2020-03-16  9:00         ` Madalin Bucur (OSS)
  0 siblings, 0 replies; 10+ messages in thread
From: Madalin Bucur (OSS) @ 2020-03-16  9:00 UTC (permalink / raw)
  To: Andrew Lunn, Madalin Bucur (OSS)
  Cc: davem, netdev, devicetree, shawnguo, Leo Li, robh+dt,
	mark.rutland, linux-kernel

> -----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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-03-16  9:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 12:04 [PATCH net 0/3] QorIQ DPAA ARM RDBs need internal delay on RGMII Madalin Bucur
2020-03-13 12:04 ` [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link() Madalin Bucur
2020-03-14 21:16   ` Andrew Lunn
2020-03-16  7:49     ` Madalin Bucur (OSS)
2020-03-16  8:39       ` Andrew Lunn
2020-03-16  9:00         ` Madalin Bucur (OSS)
2020-03-13 12:04 ` [PATCH net 2/3] arm64: dts: ls1043a-rdb: correct RGMII delay mode to rgmii-id Madalin Bucur
2020-03-14 21:18   ` Andrew Lunn
2020-03-13 12:04 ` [PATCH net 3/3] arm64: dts: ls1046ardb: set RGMII interfaces to RGMII_ID mode Madalin Bucur
2020-03-14 21:19   ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).