2020-03-16 12:06:42

by Madalin Bucur (OSS)

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

v2: used phy_interface_mode_is_rgmii() to identify 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.

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 | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)

--
2.1.0


2020-03-16 12:07:08

by Madalin Bucur (OSS)

[permalink] [raw]
Subject: [PATCH net v2 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]>
---

v2: used phy_interface_mode_is_rgmii() to identify RGMII

drivers/net/ethernet/freescale/fman/fman_memac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c
index e1901874c19f..0d2b4ab01f24 100644
--- a/drivers/net/ethernet/freescale/fman/fman_memac.c
+++ b/drivers/net/ethernet/freescale/fman/fman_memac.c
@@ -782,7 +782,7 @@ 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 (phy_interface_mode_is_rgmii(memac->phy_if)) {
/* Configure RGMII in manual mode */
tmp &= ~IF_MODE_RGMII_AUTO;
tmp &= ~IF_MODE_RGMII_SP_MASK;
--
2.1.0

2020-03-16 12:08:24

by Madalin Bucur (OSS)

[permalink] [raw]
Subject: [PATCH net v2 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-16 12:08:53

by Madalin Bucur (OSS)

[permalink] [raw]
Subject: [PATCH net v2 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-16 16:10:16

by Andrew Lunn

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

On Mon, Mar 16, 2020 at 02:05:56PM +0200, Madalin Bucur wrote:
> Treat all internal delay variants the same as RGMII.
>
> Signed-off-by: Madalin Bucur <[email protected]>

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

Andrew

2020-03-16 21:59:19

by David Miller

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

From: Madalin Bucur <[email protected]>
Date: Mon, 16 Mar 2020 14:05:55 +0200

> v2: used phy_interface_mode_is_rgmii() to identify 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.

Series applied, thanks.