forked from Openwrt-EcoNet/openwrt
Update b53 RGMII port patches to the accepted upstream version. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
56 lines
2.3 KiB
Diff
56 lines
2.3 KiB
Diff
From eb9e6142ac5f42beee48c9ec8edf1da3a3d7ff81 Mon Sep 17 00:00:00 2001
|
|
From: Jonas Gorski <jonas.gorski@gmail.com>
|
|
Date: Thu, 5 Jun 2025 16:39:20 +0200
|
|
Subject: [PATCH] net: dsa: b53: invert bcm531x5 rgmii delay heuristic
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
When configuring the RGMII port for BCM531x5, we are only doing so in
|
|
MLO_AN_FIXED, i.e. fixed link mode. This implies this port is used as
|
|
cpu port and thus connected to an ethernet mac, so the switch takes the
|
|
role of the PHY.
|
|
|
|
Therefore we need to enable delays when the interface mode is rgmii-id,
|
|
and not rgmii. Enabling delays for rgmii is wrong in any case.
|
|
|
|
Also update the comment with the incomplete sentence to match what we
|
|
are now doing, and add a comment about rgmii-id.
|
|
|
|
Luckily there are at least no in-tree users of rgmii or rgmii-id mode
|
|
that would be affected, as the only user with a defined link mode uses
|
|
rgmii-txid, which we already handle correctly.
|
|
|
|
Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
|
|
Reported-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
|
---
|
|
drivers/net/dsa/b53/b53_common.c | 13 ++++++-------
|
|
1 file changed, 6 insertions(+), 7 deletions(-)
|
|
|
|
--- a/drivers/net/dsa/b53/b53_common.c
|
|
+++ b/drivers/net/dsa/b53/b53_common.c
|
|
@@ -1363,16 +1363,15 @@ static void b53_adjust_531x5_rgmii(struc
|
|
*
|
|
* PHY_INTERFACE_MODE_RGMII means that we are not introducing
|
|
* any delay neither on transmission nor reception, so the
|
|
- * BCM53125 must also be configured accordingly to account for
|
|
- * the lack of delay and introduce
|
|
- *
|
|
- * The BCM53125 switch has its RX clock and TX clock control
|
|
- * swapped, hence the reason why we modify the TX clock path in
|
|
- * the "RGMII" case
|
|
+ * BCM53125 must also be configured accordingly, and not enable
|
|
+ * either delay.
|
|
+ *
|
|
+ * PHY_INTERFACE_MODE_RGMII_ID means both TX internal delay and RX
|
|
+ * interal delay, so enable delay on both paths.
|
|
*/
|
|
if (interface == PHY_INTERFACE_MODE_RGMII_TXID)
|
|
rgmii_ctrl |= RGMII_CTRL_DLL_TXC;
|
|
- if (interface == PHY_INTERFACE_MODE_RGMII)
|
|
+ if (interface == PHY_INTERFACE_MODE_RGMII_ID)
|
|
rgmii_ctrl |= RGMII_CTRL_DLL_TXC | RGMII_CTRL_DLL_RXC;
|
|
|
|
if (dev->chip_id != BCM53115_DEVICE_ID)
|