[PATCH v2 3/7] net: stmmac: dwmac-sun55i: Support external RGMII TX clock
Alastair D'Silva
alastair at d-silva.org
Sun Nov 29 17:29:58 PST 2026
Select SYSCON_ETCS_EXT_GMII when the "allwinner,rgmii-clk-ext" property
is present in RGMII mode, keeping SYSCON_ETCS_INT_GMII as the default.
Boards that wire the external PHY's 125 MHz CLK_OUT to the MAC (such as
the Orange Pi 4 Pro) stall on 1 Gbps TX with SYSCON_ETCS_INT_GMII,
while boards without that clock wired (such as the Cubie A7A) require
internal GMII TX clocking.
Assisted-by: LLM
Signed-off-by: Alastair D'Silva <alastair at d-silva.org>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sun55i.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun55i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun55i.c
index 675b83cd52c8..7a3ce92be821 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun55i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun55i.c
@@ -158,7 +158,11 @@ static int sun55i_gmac200_setup(struct device *dev,
case PHY_INTERFACE_MODE_RGMII_ID:
case PHY_INTERFACE_MODE_RGMII_RXID:
case PHY_INTERFACE_MODE_RGMII_TXID:
- reg |= SYSCON_EPIT | SYSCON_ETCS_INT_GMII;
+ reg |= SYSCON_EPIT;
+ if (device_property_read_bool(dev, "allwinner,rgmii-clk-ext"))
+ reg |= SYSCON_ETCS_EXT_GMII;
+ else
+ reg |= SYSCON_ETCS_INT_GMII;
break;
case PHY_INTERFACE_MODE_RMII:
reg |= SYSCON_RMII_EN;
--
2.53.0
More information about the linux-arm-kernel
mailing list