2020-03-13 12:05:16

by Madalin Bucur (OSS)

[permalink] [raw]
Subject: [PATCH net 0/3] QorIQ DPAA ARM RDBs need internal delay on RGMII

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


2020-03-13 12:05:20

by Madalin Bucur (OSS)

[permalink] [raw]
Subject: [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link()

Treat all internal delay variants the same as RGMII.

Signed-off-by: Madalin Bucur <[email protected]>
---
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

2020-03-13 12:05:27

by Madalin Bucur (OSS)

[permalink] [raw]
Subject: [PATCH net 2/3] arm64: dts: ls1043a-rdb: correct RGMII delay mode to rgmii-id

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 <[email protected]>
---
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

2020-03-13 12:05:32

by Madalin Bucur (OSS)

[permalink] [raw]
Subject: [PATCH net 3/3] arm64: dts: ls1046ardb: set RGMII interfaces to RGMII_ID mode

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 <[email protected]>
---
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

2020-03-15 01:54:56

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH net 3/3] arm64: dts: ls1046ardb: set RGMII interfaces to RGMII_ID mode

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 <[email protected]>

Reviewed-by: Andrew Lunn <[email protected]>

Andrew

2020-03-15 01:55:02

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH net 2/3] arm64: dts: ls1043a-rdb: correct RGMII delay mode to rgmii-id

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 <[email protected]>

Reviewed-by: Andrew Lunn <[email protected]>

Andrew

2020-03-15 01:56:05

by Andrew Lunn

[permalink] [raw]
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 <[email protected]>
> ---
> 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

2020-03-16 07:51:51

by Madalin Bucur (OSS)

[permalink] [raw]
Subject: RE: [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link()

> -----Original Message-----
> From: Andrew Lunn <[email protected]>
> Sent: Saturday, March 14, 2020 11:16 PM
> To: Madalin Bucur (OSS) <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]; [email protected]; Leo Li
> <[email protected]>; [email protected]; [email protected]; linux-
> [email protected]
> 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 <[email protected]>
> > ---
> > 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

2020-03-16 08:39:55

by Andrew Lunn

[permalink] [raw]
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

2020-03-16 09:01:33

by Madalin Bucur (OSS)

[permalink] [raw]
Subject: RE: [PATCH net 1/3] net: fsl/fman: treat all RGMII modes in memac_adjust_link()

> -----Original Message-----
> From: Andrew Lunn <[email protected]>
> Sent: Monday, March 16, 2020 10:39 AM
> To: Madalin Bucur (OSS) <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]; [email protected]; Leo Li
> <[email protected]>; [email protected]; [email protected]; linux-
> [email protected]
> 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.