* [PATCH net-next v2 0/7] net/stmmac: Add Mediatek MT8189 support
@ 2026-09-24 7:23 Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 1/7] dt-bindings: net: mediatek-dwmac: add support for MT8189 SoC Louis-Alexis Eyraud
` (6 more replies)
0 siblings, 7 replies; 11+ messages in thread
From: Louis-Alexis Eyraud @ 2026-09-24 7:23 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Richard Cochran, Matthias Brugger, AngeloGioacchino Del Regno,
Biao Huang, Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
Cc: kernel, netdev, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek, linux-stm32, Louis-Alexis Eyraud
This series adds the Ethernet support for Mediatek MT8189 SoC and its
variants (MT8371, MT8391). These SoC integrate a Gigabit Ethernet MAC
with RGMII/RMII/MII interface, with a similar design than previous SoCs
such MT8188 or MT8195.
This series is based on net-next tree (sha1: 528de6832b21).
It has been tested on Mediatek Genio 520-EVK (MT8371) and
720-EVK(MT8391) boards, which both integrate an Airoha AN8801R Ethernet
PHY, with hardware enablement series ([1]) and additional devicetrees
patches for enabling their Ethernet interface.
It has been also tested on Mediatek Genio 510-EVK (MT8370, variant of
MT8188) and 1200-EVK (MT8395, variant of MT8195).
[1]: https://lore.kernel.org/linux-mediatek/20260701-add-mediatek-genio-520-720-evk-v2-0-19d5da4ef984@collabora.com/
---
Changes in v2:
- Rebased on net-next (sha1: 528de6832b21)
- Dropped "net: stmmac: mediatek: rename MT2712 and MT8195 variant
methods" and "net: stmmac: mediatek: add support for TX deallocation
adjustment feature" patches, present in v1 (M. Chevallier)
- Patch 1:
- Removed rmii_internal clock from required clock list (A. Lunn)
- Added MT8189 stage delay divider values in "mediatek,rx-delay-ps" and
"mediatek,rx-delay-ps" property description (Sashiko)
- Updated commit description
- Added patch 2 to simplify TX/RX delay handling in mt8195_set_delay
- Added patch 3 to add RX/TX delay stage divider in platform data
- Patch 4:
- Replace MT8195_PERI_ETH_CTRL_BASE by MT8195_PERI_ETH_CTRL_OFFSET to
harmonize the variable and definition naming (A. Lunn)
- Added Reviewed-By tag
- Added patch 5 to add the TX Clock phase shift use in
RGMII and in 1G speed
- Patch 6:
- Reworded flag and define names to explicit a bit more what the
feature does
- Updated commit description
- Patch 7:
- Added the new definitions and needed fields in platform data
- Updated commit description to add the info about MT8189 RX/TX delay
stage divider and maximum values, and remove reference about
stage fine feature
- Link to v1: https://lore.kernel.org/r/20260707-dwmac-mediatek-mt8189-v1-0-17f345eaaca3@collabora.com
---
Louis-Alexis Eyraud (7):
dt-bindings: net: mediatek-dwmac: add support for MT8189 SoC
net: stmmac: mediatek: simplify TX/RX delay handling in mt8195_set_delay
net: stmmac: mediatek: add RX/TX delay stage divider in platform data
net: stmmac: mediatek: add PERI_ETH_CTRLx register offset in platform data
net: stmmac: mediatek: use TX clock phase shift in RGMII mode with 1Gbps speed
net: stmmac: mediatek: add support for TX clock output enable feature
net: stmmac: mediatek: add support for MT8189 SoC
.../devicetree/bindings/net/mediatek-dwmac.yaml | 87 ++++++---
.../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 211 ++++++++++++++++-----
2 files changed, 224 insertions(+), 74 deletions(-)
---
base-commit: 528de6832b2194ae0b1d62b0925e0ac6cad1087c
change-id: 20260703-dwmac-mediatek-mt8189-9dafe3984951
Best regards,
--
Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH net-next v2 1/7] dt-bindings: net: mediatek-dwmac: add support for MT8189 SoC
2026-09-24 7:23 [PATCH net-next v2 0/7] net/stmmac: Add Mediatek MT8189 support Louis-Alexis Eyraud
@ 2026-09-24 7:23 ` Louis-Alexis Eyraud
2026-09-28 8:03 ` netdev-bot+sashiko
2026-09-24 7:23 ` [PATCH net-next v2 2/7] net: stmmac: mediatek: simplify TX/RX delay handling in mt8195_set_delay Louis-Alexis Eyraud
` (5 subsequent siblings)
6 siblings, 1 reply; 11+ messages in thread
From: Louis-Alexis Eyraud @ 2026-09-24 7:23 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Richard Cochran, Matthias Brugger, AngeloGioacchino Del Regno,
Biao Huang, Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
Cc: kernel, netdev, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek, linux-stm32, Louis-Alexis Eyraud
Add new compatible string and clock definitions for the Ethernet MAC
IP found in MT8189 SoC.
Also, update "mediatek,rx-delay-ps" and "mediatek,tx-delay-ps" property
description to add MT8189 RX/TX delay stage divider values, as they
differ from existing supported SoC.
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
.../devicetree/bindings/net/mediatek-dwmac.yaml | 87 +++++++++++++++-------
1 file changed, 60 insertions(+), 27 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml b/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
index 3aab21b8e8de..6624dff015f0 100644
--- a/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
@@ -20,13 +20,11 @@ select:
enum:
- mediatek,mt2712-gmac
- mediatek,mt8188-gmac
+ - mediatek,mt8189-gmac
- mediatek,mt8195-gmac
required:
- compatible
-allOf:
- - $ref: snps,dwmac.yaml#
-
properties:
compatible:
oneOf:
@@ -36,6 +34,7 @@ properties:
- const: snps,dwmac-4.20a
- items:
- enum:
+ - mediatek,mt8189-gmac
- mediatek,mt8195-gmac
- const: snps,dwmac-5.10a
- items:
@@ -44,26 +43,6 @@ properties:
- const: mediatek,mt8195-gmac
- const: snps,dwmac-5.10a
- clocks:
- minItems: 5
- items:
- - description: AXI clock
- - description: APB clock
- - description: MAC Main clock
- - description: PTP clock
- - description: RMII reference clock provided by MAC
- - description: MAC clock gate
-
- clock-names:
- minItems: 5
- items:
- - const: axi
- - const: apb
- - const: mac_main
- - const: ptp_ref
- - const: rmii_internal
- - const: mac_cg
-
interrupts:
maxItems: 1
@@ -86,8 +65,10 @@ properties:
or will round down. Range 0~31*170.
For MT2712 RMII/MII interface, Allowed value need to be a multiple of 550,
or will round down. Range 0~31*550.
- For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a multiple of 290,
- or will round down. Range 0~31*290.
+ For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a
+ multiple of 290, or will round down. Range 0~31*290.
+ For MT8189 RGMII/RMII/MII interface, Allowed value need to
+ be a multiple of 180, or will round down. Range 0~31*180.
mediatek,rx-delay-ps:
description:
@@ -96,8 +77,10 @@ properties:
or will round down. Range 0~31*170.
For MT2712 RMII/MII interface, Allowed value need to be a multiple of 550,
or will round down. Range 0~31*550.
- For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a multiple
- of 290, or will round down. Range 0~31*290.
+ For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a
+ multiple of 290, or will round down. Range 0~31*290.
+ For MT8189 RGMII/RMII/MII interface, Allowed value need to
+ be a multiple of 180, or will round down. Range 0~31*180.
mediatek,rmii-rxc:
type: boolean
@@ -147,6 +130,56 @@ required:
- phy-mode
- mediatek,pericfg
+allOf:
+ - $ref: snps,dwmac.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - mediatek,mt2712-gmac
+ - mediatek,mt8188-gmac
+ - mediatek,mt8195-gmac
+ then:
+ properties:
+ clocks:
+ minItems: 5
+ items:
+ - description: AXI clock
+ - description: APB clock
+ - description: MAC Main clock
+ - description: PTP clock
+ - description: RMII reference clock provided by MAC
+ - description: MAC clock gate
+
+ clock-names:
+ minItems: 5
+ items:
+ - const: axi
+ - const: apb
+ - const: mac_main
+ - const: ptp_ref
+ - const: rmii_internal
+ - const: mac_cg
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - mediatek,mt8189-gmac
+ then:
+ properties:
+ clocks:
+ items:
+ - description: MAC Main clock
+ - description: PTP clock
+
+ clock-names:
+ items:
+ - const: mac_main
+ - const: ptp_ref
+
unevaluatedProperties: false
examples:
--
2.55.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH net-next v2 2/7] net: stmmac: mediatek: simplify TX/RX delay handling in mt8195_set_delay
2026-09-24 7:23 [PATCH net-next v2 0/7] net/stmmac: Add Mediatek MT8189 support Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 1/7] dt-bindings: net: mediatek-dwmac: add support for MT8189 SoC Louis-Alexis Eyraud
@ 2026-09-24 7:23 ` Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 3/7] net: stmmac: mediatek: add RX/TX delay stage divider in platform data Louis-Alexis Eyraud
` (4 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Louis-Alexis Eyraud @ 2026-09-24 7:23 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Richard Cochran, Matthias Brugger, AngeloGioacchino Del Regno,
Biao Huang, Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
Cc: kernel, netdev, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek, linux-stm32, Louis-Alexis Eyraud
The mt8195_set_delay function modifies at its beginning the TX and RX
internal delay variables, located in the driver data, by dividing
them by a constant (290) and restores their original values by
multiplying them again at the function end. It is done in order to
convert them into a step value, used by the hardware registers for
setting these delays.
But this is rather pointless to modify the driver data for that, while
it could be done locally in the function. The original delay values
cannot be used anymore (if needed) during mt8195_set_delay processing.
Finally, they are altered after the function call if they are not a
multiple of 290.
So, simplify these delay variable handling by using local variables to
convert them into the register value and use those in the write calls.
Also, remove the two private conversion functions, that are not useful
anymore and add definitions for MT8195 RX/TX delay maximum and divider
values.
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
.../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 77 ++++++++++------------
1 file changed, 36 insertions(+), 41 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
index 30ae0dba7fff..f7eb85110df0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
@@ -63,6 +63,11 @@
#define MT8195_DLY_RMII_TXC_ENABLE BIT(5)
#define MT8195_DLY_RMII_TXC_STAGES GENMASK(4, 0)
+#define MT8195_DLY_RXC_STAGE_DIV 290 /* 290ps per stage */
+#define MT8195_DLY_RXC_MAX 9280 /* 32 x 290ps */
+#define MT8195_DLY_TXC_STAGE_DIV 290 /* 290ps per stage */
+#define MT8195_DLY_TXC_MAX 9280 /* 32 x 290ps */
+
struct mac_delay_struct {
u32 tx_delay;
u32 rx_delay;
@@ -293,39 +298,27 @@ static int mt8195_set_interface(struct mediatek_dwmac_plat_data *plat,
return 0;
}
-static void mt8195_delay_ps2stage(struct mediatek_dwmac_plat_data *plat)
-{
- struct mac_delay_struct *mac_delay = &plat->mac_delay;
-
- /* 290ps per stage */
- mac_delay->tx_delay /= 290;
- mac_delay->rx_delay /= 290;
-}
-
-static void mt8195_delay_stage2ps(struct mediatek_dwmac_plat_data *plat)
-{
- struct mac_delay_struct *mac_delay = &plat->mac_delay;
-
- /* 290ps per stage */
- mac_delay->tx_delay *= 290;
- mac_delay->rx_delay *= 290;
-}
-
static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
{
struct mac_delay_struct *mac_delay = &plat->mac_delay;
- u32 gtxc_delay_val = 0, delay_val = 0, rmii_delay_val = 0;
-
- mt8195_delay_ps2stage(plat);
+ u32 rx_delay_stage_val = mac_delay->rx_delay / MT8195_DLY_RXC_STAGE_DIV;
+ u32 tx_delay_stage_val = mac_delay->tx_delay / MT8195_DLY_TXC_STAGE_DIV;
+ u32 gtxc_delay_val = 0;
+ u32 rmii_delay_val = 0;
+ u32 delay_val = 0;
switch (plat->phy_mode) {
case PHY_INTERFACE_MODE_MII:
- delay_val |= FIELD_PREP(MT8195_DLY_TXC_ENABLE, !!mac_delay->tx_delay);
- delay_val |= FIELD_PREP(MT8195_DLY_TXC_STAGES, mac_delay->tx_delay);
+ delay_val |= FIELD_PREP(MT8195_DLY_TXC_ENABLE,
+ !!tx_delay_stage_val);
+ delay_val |= FIELD_PREP(MT8195_DLY_TXC_STAGES,
+ tx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_TXC_INV, mac_delay->tx_inv);
- delay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE, !!mac_delay->rx_delay);
- delay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES, mac_delay->rx_delay);
+ delay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE,
+ !!rx_delay_stage_val);
+ delay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES,
+ rx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_RXC_INV, mac_delay->rx_inv);
break;
case PHY_INTERFACE_MODE_RMII:
@@ -336,16 +329,16 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
* The ingress timing can be adjusted by RMII_RXC delay macro circuit.
*/
rmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_TXC_ENABLE,
- !!mac_delay->tx_delay);
+ !!tx_delay_stage_val);
rmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_TXC_STAGES,
- mac_delay->tx_delay);
+ tx_delay_stage_val);
rmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_TXC_INV,
mac_delay->tx_inv);
rmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_RXC_ENABLE,
- !!mac_delay->rx_delay);
+ !!rx_delay_stage_val);
rmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_RXC_STAGES,
- mac_delay->rx_delay);
+ rx_delay_stage_val);
rmii_delay_val |= FIELD_PREP(MT8195_DLY_RMII_RXC_INV,
mac_delay->rx_inv);
} else {
@@ -361,9 +354,9 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
* by RXC delay macro circuit.
*/
delay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE,
- !!mac_delay->rx_delay);
+ !!rx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES,
- mac_delay->rx_delay);
+ rx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_RXC_INV,
mac_delay->rx_inv);
} else {
@@ -372,9 +365,9 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
* by TXC delay macro circuit.
*/
delay_val |= FIELD_PREP(MT8195_DLY_TXC_ENABLE,
- !!mac_delay->rx_delay);
+ !!rx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_TXC_STAGES,
- mac_delay->rx_delay);
+ rx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_TXC_INV,
mac_delay->rx_inv);
}
@@ -384,12 +377,16 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
case PHY_INTERFACE_MODE_RGMII_TXID:
case PHY_INTERFACE_MODE_RGMII_RXID:
case PHY_INTERFACE_MODE_RGMII_ID:
- gtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_ENABLE, !!mac_delay->tx_delay);
- gtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_STAGES, mac_delay->tx_delay);
+ gtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_ENABLE,
+ !!tx_delay_stage_val);
+ gtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_STAGES,
+ tx_delay_stage_val);
gtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_INV, mac_delay->tx_inv);
- delay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE, !!mac_delay->rx_delay);
- delay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES, mac_delay->rx_delay);
+ delay_val |= FIELD_PREP(MT8195_DLY_RXC_ENABLE,
+ !!rx_delay_stage_val);
+ delay_val |= FIELD_PREP(MT8195_DLY_RXC_STAGES,
+ rx_delay_stage_val);
delay_val |= FIELD_PREP(MT8195_DLY_RXC_INV, mac_delay->rx_inv);
break;
@@ -408,8 +405,6 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
regmap_write(plat->peri_regmap, MT8195_PERI_ETH_CTRL1, delay_val);
regmap_write(plat->peri_regmap, MT8195_PERI_ETH_CTRL2, rmii_delay_val);
- mt8195_delay_stage2ps(plat);
-
return 0;
}
@@ -418,8 +413,8 @@ static const struct mediatek_dwmac_variant mt8195_gmac_variant = {
.dwmac_set_delay = mt8195_set_delay,
.clk_list = mt8195_dwmac_clk_l,
.num_clks = ARRAY_SIZE(mt8195_dwmac_clk_l),
- .rx_delay_max = 9280,
- .tx_delay_max = 9280,
+ .rx_delay_max = MT8195_DLY_RXC_MAX,
+ .tx_delay_max = MT8195_DLY_TXC_MAX,
.dma_bit_mask = 35,
};
--
2.55.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH net-next v2 3/7] net: stmmac: mediatek: add RX/TX delay stage divider in platform data
2026-09-24 7:23 [PATCH net-next v2 0/7] net/stmmac: Add Mediatek MT8189 support Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 1/7] dt-bindings: net: mediatek-dwmac: add support for MT8189 SoC Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 2/7] net: stmmac: mediatek: simplify TX/RX delay handling in mt8195_set_delay Louis-Alexis Eyraud
@ 2026-09-24 7:23 ` Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 4/7] net: stmmac: mediatek: add PERI_ETH_CTRLx register offset " Louis-Alexis Eyraud
` (3 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Louis-Alexis Eyraud @ 2026-09-24 7:23 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Richard Cochran, Matthias Brugger, AngeloGioacchino Del Regno,
Biao Huang, Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
Cc: kernel, netdev, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek, linux-stm32, Louis-Alexis Eyraud
In preparation of newer SoC support, that have like MT8189 SoC
different RX and TX internal delay stage steps than MT8188/MT8195, add
the RX and TX delay stage divider values in the variant platform data
and replace the hardcoded value use in mt8195_set_delay.
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
index f7eb85110df0..1c532cc3a975 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
@@ -100,6 +100,8 @@ struct mediatek_dwmac_variant {
u32 rx_delay_max;
u32 tx_delay_max;
+ u16 rx_delay_stage_div;
+ u16 tx_delay_stage_div;
u8 dma_bit_mask;
};
@@ -300,13 +302,25 @@ static int mt8195_set_interface(struct mediatek_dwmac_plat_data *plat,
static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
{
+ u16 rx_delay_stage_div = plat->variant->rx_delay_stage_div;
+ u16 tx_delay_stage_div = plat->variant->tx_delay_stage_div;
struct mac_delay_struct *mac_delay = &plat->mac_delay;
- u32 rx_delay_stage_val = mac_delay->rx_delay / MT8195_DLY_RXC_STAGE_DIV;
- u32 tx_delay_stage_val = mac_delay->tx_delay / MT8195_DLY_TXC_STAGE_DIV;
+ u32 rx_delay_stage_val;
+ u32 tx_delay_stage_val;
u32 gtxc_delay_val = 0;
u32 rmii_delay_val = 0;
u32 delay_val = 0;
+ if (rx_delay_stage_div)
+ rx_delay_stage_val = mac_delay->rx_delay / rx_delay_stage_div;
+ else
+ rx_delay_stage_val = 0;
+
+ if (tx_delay_stage_div)
+ tx_delay_stage_val = mac_delay->tx_delay / tx_delay_stage_div;
+ else
+ tx_delay_stage_val = 0;
+
switch (plat->phy_mode) {
case PHY_INTERFACE_MODE_MII:
delay_val |= FIELD_PREP(MT8195_DLY_TXC_ENABLE,
@@ -415,6 +429,8 @@ static const struct mediatek_dwmac_variant mt8195_gmac_variant = {
.num_clks = ARRAY_SIZE(mt8195_dwmac_clk_l),
.rx_delay_max = MT8195_DLY_RXC_MAX,
.tx_delay_max = MT8195_DLY_TXC_MAX,
+ .rx_delay_stage_div = MT8195_DLY_RXC_STAGE_DIV,
+ .tx_delay_stage_div = MT8195_DLY_TXC_STAGE_DIV,
.dma_bit_mask = 35,
};
--
2.55.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH net-next v2 4/7] net: stmmac: mediatek: add PERI_ETH_CTRLx register offset in platform data
2026-09-24 7:23 [PATCH net-next v2 0/7] net/stmmac: Add Mediatek MT8189 support Louis-Alexis Eyraud
` (2 preceding siblings ...)
2026-09-24 7:23 ` [PATCH net-next v2 3/7] net: stmmac: mediatek: add RX/TX delay stage divider in platform data Louis-Alexis Eyraud
@ 2026-09-24 7:23 ` Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 5/7] net: stmmac: mediatek: use TX clock phase shift in RGMII mode with 1Gbps speed Louis-Alexis Eyraud
` (2 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Louis-Alexis Eyraud @ 2026-09-24 7:23 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Richard Cochran, Matthias Brugger, AngeloGioacchino Del Regno,
Biao Huang, Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
Cc: kernel, netdev, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek, linux-stm32, Louis-Alexis Eyraud
In preparation of newer SoC support, that use like MT8195 the Ethernet
control registers from the peripheral configuration syscon but at a
different base offset, add a new base offset in the variant platform
data to access the PERI_ETH_CTRLx registers and use it in implemented
methods.
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
.../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 26 ++++++++++++++++------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
index 1c532cc3a975..dee12cfa437d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
@@ -37,7 +37,9 @@
#define ETH_FINE_DLY_RXC BIT(0)
/* Peri Configuration register for mt8195 */
-#define MT8195_PERI_ETH_CTRL0 0xFD0
+#define MT8195_PERI_ETH_CTRL_OFFSET 0xFD0
+
+#define MT8195_PERI_ETH_CTRL0 0x0
#define MT8195_RMII_CLK_SRC_INTERNAL BIT(28)
#define MT8195_RMII_CLK_SRC_RXC BIT(27)
#define MT8195_ETH_INTF_SEL GENMASK(26, 24)
@@ -47,7 +49,7 @@
#define MT8195_DLY_GTXC_ENABLE BIT(5)
#define MT8195_DLY_GTXC_STAGES GENMASK(4, 0)
-#define MT8195_PERI_ETH_CTRL1 0xFD4
+#define MT8195_PERI_ETH_CTRL1 0x4
#define MT8195_DLY_RXC_INV BIT(25)
#define MT8195_DLY_RXC_ENABLE BIT(18)
#define MT8195_DLY_RXC_STAGES GENMASK(17, 13)
@@ -55,7 +57,7 @@
#define MT8195_DLY_TXC_ENABLE BIT(5)
#define MT8195_DLY_TXC_STAGES GENMASK(4, 0)
-#define MT8195_PERI_ETH_CTRL2 0xFD8
+#define MT8195_PERI_ETH_CTRL2 0x8
#define MT8195_DLY_RMII_RXC_INV BIT(25)
#define MT8195_DLY_RMII_RXC_ENABLE BIT(18)
#define MT8195_DLY_RMII_RXC_STAGES GENMASK(17, 13)
@@ -98,6 +100,7 @@ struct mediatek_dwmac_variant {
const char * const *clk_list;
int num_clks;
+ u32 peri_eth_ctrl_offset;
u32 rx_delay_max;
u32 tx_delay_max;
u16 rx_delay_stage_div;
@@ -284,6 +287,7 @@ static int mt8195_set_interface(struct mediatek_dwmac_plat_data *plat,
u8 phy_intf_sel)
{
u32 intf_val = FIELD_PREP(MT8195_ETH_INTF_SEL, phy_intf_sel);
+ u32 reg_offset = plat->variant->peri_eth_ctrl_offset;
if (phy_intf_sel == PHY_INTF_SEL_RMII) {
if (plat->rmii_clk_from_mac)
@@ -295,7 +299,9 @@ static int mt8195_set_interface(struct mediatek_dwmac_plat_data *plat,
/* MT8195 only support external PHY */
intf_val |= MT8195_EXT_PHY_MODE;
- regmap_write(plat->peri_regmap, MT8195_PERI_ETH_CTRL0, intf_val);
+ regmap_write(plat->peri_regmap,
+ reg_offset + MT8195_PERI_ETH_CTRL0,
+ intf_val);
return 0;
}
@@ -305,6 +311,7 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
u16 rx_delay_stage_div = plat->variant->rx_delay_stage_div;
u16 tx_delay_stage_div = plat->variant->tx_delay_stage_div;
struct mac_delay_struct *mac_delay = &plat->mac_delay;
+ u32 reg_offset = plat->variant->peri_eth_ctrl_offset;
u32 rx_delay_stage_val;
u32 tx_delay_stage_val;
u32 gtxc_delay_val = 0;
@@ -410,14 +417,18 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
}
regmap_update_bits(plat->peri_regmap,
- MT8195_PERI_ETH_CTRL0,
+ reg_offset + MT8195_PERI_ETH_CTRL0,
MT8195_RGMII_TXC_PHASE_CTRL |
MT8195_DLY_GTXC_INV |
MT8195_DLY_GTXC_ENABLE |
MT8195_DLY_GTXC_STAGES,
gtxc_delay_val);
- regmap_write(plat->peri_regmap, MT8195_PERI_ETH_CTRL1, delay_val);
- regmap_write(plat->peri_regmap, MT8195_PERI_ETH_CTRL2, rmii_delay_val);
+ regmap_write(plat->peri_regmap,
+ reg_offset + MT8195_PERI_ETH_CTRL1,
+ delay_val);
+ regmap_write(plat->peri_regmap,
+ reg_offset + MT8195_PERI_ETH_CTRL2,
+ rmii_delay_val);
return 0;
}
@@ -432,6 +443,7 @@ static const struct mediatek_dwmac_variant mt8195_gmac_variant = {
.rx_delay_stage_div = MT8195_DLY_RXC_STAGE_DIV,
.tx_delay_stage_div = MT8195_DLY_TXC_STAGE_DIV,
.dma_bit_mask = 35,
+ .peri_eth_ctrl_offset = MT8195_PERI_ETH_CTRL_OFFSET,
};
static int mediatek_dwmac_config_dt(struct mediatek_dwmac_plat_data *plat)
--
2.55.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH net-next v2 5/7] net: stmmac: mediatek: use TX clock phase shift in RGMII mode with 1Gbps speed
2026-09-24 7:23 [PATCH net-next v2 0/7] net/stmmac: Add Mediatek MT8189 support Louis-Alexis Eyraud
` (3 preceding siblings ...)
2026-09-24 7:23 ` [PATCH net-next v2 4/7] net: stmmac: mediatek: add PERI_ETH_CTRLx register offset " Louis-Alexis Eyraud
@ 2026-09-24 7:23 ` Louis-Alexis Eyraud
2026-09-28 8:03 ` netdev-bot+sashiko
2026-09-24 7:23 ` [PATCH net-next v2 6/7] net: stmmac: mediatek: add support for TX clock output enable feature Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 7/7] net: stmmac: mediatek: add support for MT8189 SoC Louis-Alexis Eyraud
6 siblings, 1 reply; 11+ messages in thread
From: Louis-Alexis Eyraud @ 2026-09-24 7:23 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Richard Cochran, Matthias Brugger, AngeloGioacchino Del Regno,
Biao Huang, Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
Cc: kernel, netdev, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek, linux-stm32, Louis-Alexis Eyraud
Currently, if the devicetree of a board based on MT8195 (or compatible)
configures the use of RGMII PHY mode and insert at MAC level additional
delay on TX clock at MAC (with "mediatek,tx-delay-ps" vendor property
presence), the driver inserts this delay by setting TX coarse delay
bits (bit 0 to 5) of the Ethernet control 0 register from the
peripheral configuration (pericfg) at probe time.
The HW delay macro circuit, that these bits enable, can be affected by
external factors such as environment temperature or vcore voltage and
thus applied delay value can change. For 10/100M link speed cases the
variations are not problematic, but it can be for 1G link speed cases,
that require much precise and stable timings (around 2ns).
The Ethernet control 0 register of MT8195 SoC has another bit (bit 22:
MT8195_RGMII_TXC_PHASE_CTR) to enable the TX clock phase shift and
insert a 2ns clock delay in a more consistence way, as it is not
affected like the HW delay macro circuit under the same conditions.
This only works though for 1G speed cases so it cannot be set
unconditionally at probe time, thus needs to be set after link speed
negotiation.
In order to allow the TX clock phase shift use in the driver, add in
the variant platform data and probe sequence the support of
fix_mac_speed callback, provided by dwmac core. This callback allows
driver configuration update when the link speed has been negotiated.
Implement it for MT8195 so that, when a delay needs to be inserted
for TX clock (due to the devicetree configuration), it enables the
TX clock phase shift in Ethernet control 0 register only and only if
the PHY mode allows it and negotiated link speed is 1G, and fallback
to the HW delay macro circuit otherwise.
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
.../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 59 ++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
index dee12cfa437d..6123efbbaf02 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
@@ -96,6 +96,9 @@ struct mediatek_dwmac_variant {
u8 phy_intf_sel);
int (*dwmac_set_delay)(struct mediatek_dwmac_plat_data *plat);
+ void (*dwmac_fix_mac_speed)(void *priv, phy_interface_t interface,
+ int speed, unsigned int mode);
+
/* clock ids to be requested */
const char * const *clk_list;
int num_clks;
@@ -433,9 +436,62 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
return 0;
}
+static void mt8195_fix_mac_speed(void *priv, phy_interface_t interface,
+ int speed, unsigned int mode)
+{
+ struct mediatek_dwmac_plat_data *priv_plat = priv;
+ const struct mediatek_dwmac_variant *variant;
+ struct mac_delay_struct *mac_delay;
+ u32 tx_delay_stage_val, reg_offset;
+ u32 reg_val = 0;
+
+ if (!priv_plat)
+ return;
+
+ mac_delay = &priv_plat->mac_delay;
+ variant = priv_plat->variant;
+
+ if (!mac_delay->tx_delay ||
+ (interface != PHY_INTERFACE_MODE_RGMII &&
+ interface != PHY_INTERFACE_MODE_RGMII_RXID))
+ return;
+
+ /*
+ * When link speed is 1Gbps with RGMII interface, and a TX internal
+ * delay needs to be applied on MAC, prefer to override the delay
+ * settings with a 2ns fixed delay which is controlled by
+ * RGMII_TXC_PHASE_CTRL. Otherwise, fallback to HW delay macro circuit
+ * for 10/100Mbps link speeds.
+ */
+ if (speed == SPEED_1000) {
+ reg_val = MT8195_RGMII_TXC_PHASE_CTRL;
+ } else {
+ if (variant->tx_delay_stage_div)
+ tx_delay_stage_val = mac_delay->tx_delay /
+ variant->tx_delay_stage_div;
+
+ reg_val |= FIELD_PREP(MT8195_DLY_GTXC_ENABLE,
+ !!mac_delay->tx_delay);
+ reg_val |= FIELD_PREP(MT8195_DLY_GTXC_STAGES,
+ tx_delay_stage_val);
+ reg_val |= FIELD_PREP(MT8195_DLY_GTXC_INV,
+ mac_delay->tx_inv);
+ }
+
+ reg_offset = variant->peri_eth_ctrl_offset + MT8195_PERI_ETH_CTRL0;
+ regmap_update_bits(priv_plat->peri_regmap,
+ reg_offset,
+ MT8195_RGMII_TXC_PHASE_CTRL |
+ MT8195_DLY_GTXC_ENABLE |
+ MT8195_DLY_GTXC_INV |
+ MT8195_DLY_GTXC_STAGES,
+ reg_val);
+}
+
static const struct mediatek_dwmac_variant mt8195_gmac_variant = {
.dwmac_set_phy_interface = mt8195_set_interface,
.dwmac_set_delay = mt8195_set_delay,
+ .dwmac_fix_mac_speed = mt8195_fix_mac_speed,
.clk_list = mt8195_dwmac_clk_l,
.num_clks = ARRAY_SIZE(mt8195_dwmac_clk_l),
.rx_delay_max = MT8195_DLY_RXC_MAX,
@@ -594,6 +650,9 @@ static int mediatek_dwmac_common_data(struct platform_device *pdev,
plat->resume = mediatek_dwmac_init;
plat->clks_config = mediatek_dwmac_clks_config;
+ if (priv_plat->variant->dwmac_fix_mac_speed)
+ plat->fix_mac_speed = priv_plat->variant->dwmac_fix_mac_speed;
+
plat->safety_feat_cfg = devm_kzalloc(&pdev->dev,
sizeof(*plat->safety_feat_cfg),
GFP_KERNEL);
--
2.55.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH net-next v2 6/7] net: stmmac: mediatek: add support for TX clock output enable feature
2026-09-24 7:23 [PATCH net-next v2 0/7] net/stmmac: Add Mediatek MT8189 support Louis-Alexis Eyraud
` (4 preceding siblings ...)
2026-09-24 7:23 ` [PATCH net-next v2 5/7] net: stmmac: mediatek: use TX clock phase shift in RGMII mode with 1Gbps speed Louis-Alexis Eyraud
@ 2026-09-24 7:23 ` Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 7/7] net: stmmac: mediatek: add support for MT8189 SoC Louis-Alexis Eyraud
6 siblings, 0 replies; 11+ messages in thread
From: Louis-Alexis Eyraud @ 2026-09-24 7:23 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Richard Cochran, Matthias Brugger, AngeloGioacchino Del Regno,
Biao Huang, Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
Cc: kernel, netdev, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek, linux-stm32, Louis-Alexis Eyraud
The MT8189 SoC has in the Ethernet control 0 register from the
peripheral configuration (pericfg) an additional bit to enable the TX
clock signal output.
In preparation of MT8189 SoC support, add its definition, use in the
mt8195_set_interface callback, and a support flag in the platform
data.
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
index 6123efbbaf02..36599dc33b14 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
@@ -36,6 +36,9 @@
#define ETH_FINE_DLY_GTXC BIT(1)
#define ETH_FINE_DLY_RXC BIT(0)
+/* Peri Configuration register for mt8189 */
+#define MT8189_CTRL0_TXC_OUT_OP_EN BIT(20)
+
/* Peri Configuration register for mt8195 */
#define MT8195_PERI_ETH_CTRL_OFFSET 0xFD0
@@ -109,6 +112,7 @@ struct mediatek_dwmac_variant {
u16 rx_delay_stage_div;
u16 tx_delay_stage_div;
u8 dma_bit_mask;
+ bool mac_txclk_out_en;
};
/* list of clocks required for mac */
@@ -302,6 +306,9 @@ static int mt8195_set_interface(struct mediatek_dwmac_plat_data *plat,
/* MT8195 only support external PHY */
intf_val |= MT8195_EXT_PHY_MODE;
+ if (plat->variant->mac_txclk_out_en)
+ intf_val |= MT8189_CTRL0_TXC_OUT_OP_EN;
+
regmap_write(plat->peri_regmap,
reg_offset + MT8195_PERI_ETH_CTRL0,
intf_val);
--
2.55.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH net-next v2 7/7] net: stmmac: mediatek: add support for MT8189 SoC
2026-09-24 7:23 [PATCH net-next v2 0/7] net/stmmac: Add Mediatek MT8189 support Louis-Alexis Eyraud
` (5 preceding siblings ...)
2026-09-24 7:23 ` [PATCH net-next v2 6/7] net: stmmac: mediatek: add support for TX clock output enable feature Louis-Alexis Eyraud
@ 2026-09-24 7:23 ` Louis-Alexis Eyraud
2026-09-28 8:03 ` netdev-bot+sashiko
6 siblings, 1 reply; 11+ messages in thread
From: Louis-Alexis Eyraud @ 2026-09-24 7:23 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Richard Cochran, Matthias Brugger, AngeloGioacchino Del Regno,
Biao Huang, Maxime Chevallier, Maxime Coquelin, Alexandre Torgue
Cc: kernel, netdev, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek, linux-stm32, Louis-Alexis Eyraud
Like MT8195 SoC, MT8189 SoC uses the Ethernet control registers from
the peripheral configuration (pericfg) but at a different offset.
It also has different RX and TX internal delay stage dividers (290ps
for MT8195, 180ps for MT8189), and by consequence a reduced value range
for these delays. It finally needs additional feature such as the
TX clock output enable one.
Thus, add compatible, clock definitions and specific platform data to
support the MT8189 SoC.
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
.../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
index 36599dc33b14..f07c331b029f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
@@ -37,8 +37,15 @@
#define ETH_FINE_DLY_RXC BIT(0)
/* Peri Configuration register for mt8189 */
+#define MT8189_PERI_ETH_CTRL_OFFSET 0x270
+
#define MT8189_CTRL0_TXC_OUT_OP_EN BIT(20)
+#define MT8189_DLY_RXC_STAGE_DIV 180 /* 180ps per stage */
+#define MT8189_DLY_RXC_MAX 5760 /* 32 * 180ps */
+#define MT8189_DLY_TXC_STAGE_DIV 180 /* 180ps per stage */
+#define MT8189_DLY_TXC_MAX 5760 /* 32 * 180ps */
+
/* Peri Configuration register for mt8195 */
#define MT8195_PERI_ETH_CTRL_OFFSET 0xFD0
@@ -124,6 +131,10 @@ static const char * const mt8195_dwmac_clk_l[] = {
"axi", "apb", "mac_cg", "mac_main", "ptp_ref"
};
+static const char * const mt8189_dwmac_clk_l[] = {
+ "mac_main", "ptp_ref"
+};
+
static int mt2712_set_interface(struct mediatek_dwmac_plat_data *plat,
u8 phy_intf_sel)
{
@@ -495,6 +506,21 @@ static void mt8195_fix_mac_speed(void *priv, phy_interface_t interface,
reg_val);
}
+static const struct mediatek_dwmac_variant mt8189_gmac_variant = {
+ .dwmac_set_phy_interface = mt8195_set_interface,
+ .dwmac_set_delay = mt8195_set_delay,
+ .dwmac_fix_mac_speed = mt8195_fix_mac_speed,
+ .clk_list = mt8189_dwmac_clk_l,
+ .num_clks = ARRAY_SIZE(mt8189_dwmac_clk_l),
+ .dma_bit_mask = 35,
+ .rx_delay_max = MT8189_DLY_RXC_MAX,
+ .tx_delay_max = MT8189_DLY_TXC_MAX,
+ .rx_delay_stage_div = MT8189_DLY_RXC_STAGE_DIV,
+ .tx_delay_stage_div = MT8189_DLY_TXC_STAGE_DIV,
+ .peri_eth_ctrl_offset = MT8189_PERI_ETH_CTRL_OFFSET,
+ .mac_txclk_out_en = true,
+};
+
static const struct mediatek_dwmac_variant mt8195_gmac_variant = {
.dwmac_set_phy_interface = mt8195_set_interface,
.dwmac_set_delay = mt8195_set_delay,
@@ -751,6 +777,8 @@ static void mediatek_dwmac_remove(struct platform_device *pdev)
static const struct of_device_id mediatek_dwmac_match[] = {
{ .compatible = "mediatek,mt2712-gmac",
.data = &mt2712_gmac_variant },
+ { .compatible = "mediatek,mt8189-gmac",
+ .data = &mt8189_gmac_variant },
{ .compatible = "mediatek,mt8195-gmac",
.data = &mt8195_gmac_variant },
{ }
--
2.55.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next v2 1/7] dt-bindings: net: mediatek-dwmac: add support for MT8189 SoC
2026-09-24 7:23 ` [PATCH net-next v2 1/7] dt-bindings: net: mediatek-dwmac: add support for MT8189 SoC Louis-Alexis Eyraud
@ 2026-09-28 8:03 ` netdev-bot+sashiko
0 siblings, 0 replies; 11+ messages in thread
From: netdev-bot+sashiko @ 2026-09-28 8:03 UTC (permalink / raw)
To: louisalexis.eyraud
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
conor+dt, richardcochran, matthias.bgg,
angelogioacchino.delregno, biao.huang, maxime.chevallier,
mcoquelin.stm32, alexandre.torgue, kernel, netdev, devicetree,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-stm32
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 2 (1)
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The MT8189 binding lets a DT pass validation even though the
driver cannot probe it.
- [Low] The patch restructures how the existing mt2712/mt8188/mt8195
compatibles are validated, but the commit message only mentions adding…
- [Low] Not confirmed (resolved later in the series).
Pre-existing issues:
- [Low] This problem wasn't introduced by this patch, but the
`mediatek,tx-delay-ps`/`mediatek,rx-delay-ps` descriptions still say…
--
dt-bindings: net: mediatek-dwmac: add support for MT8189 SoC
This adds the mediatek,mt8189-gmac compatible to the MediaTek DWMAC
binding with a two-entry clock list (mac_main, ptp_ref). It also documents
the MT8189 RX/TX delay stage divider of 180 ps. The existing clock
definitions are moved into per-compatible allOf if:then blocks.
> diff --git a/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml b/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
> index 3aab21b8e8de..6624dff015f0 100644
> --- a/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
[ ... ]
> @@ -36,6 +34,7 @@ properties:
> - const: snps,dwmac-4.20a
> - items:
> - enum:
> + - mediatek,mt8189-gmac
> - mediatek,mt8195-gmac
> - const: snps,dwmac-5.10a
[Severity: Low]
At this commit, mediatek,mt8189-gmac has no driver match. Neither of the
existing variants fits its 180 ps stage divider or its two-clock set.
This is resolved later in the series. "net: stmmac: mediatek: add support
for MT8189 SoC" adds:
{ .compatible = "mediatek,mt8189-gmac",
.data = &mt8189_gmac_variant },
to mediatek_dwmac_match[]. That variant uses mac_main/ptp_ref and
MT8189_DLY_*_STAGE_DIV = 180, which matches this binding. So this is only
the normal binding-first ordering of a series.
[ ... ]
> @@ -44,26 +43,6 @@ properties:
> - const: mediatek,mt8195-gmac
> - const: snps,dwmac-5.10a
>
> - clocks:
> - minItems: 5
> - items:
> - - description: AXI clock
> - - description: APB clock
> - - description: MAC Main clock
> - - description: PTP clock
> - - description: RMII reference clock provided by MAC
> - - description: MAC clock gate
> -
> - clock-names:
> - minItems: 5
> - items:
> - - const: axi
> - - const: apb
> - - const: mac_main
> - - const: ptp_ref
> - - const: rmii_internal
> - - const: mac_cg
> -
> interrupts:
> maxItems: 1
[Severity: Low]
This moves the existing clocks and clock-names definitions for mt2712,
mt8188 and mt8195 out of the top-level properties and into an allOf
if:then block. It also moves the snps,dwmac.yaml $ref to after required.
The commit message only talks about adding MT8189. Could it also describe
this restructuring?
Documentation/devicetree/bindings/writing-schema.rst also says:
In top level 'properties' define the property with the broadest
constraints. In 'if:then:' blocks, further narrow the constraints for
those properties. Do not define the properties within an 'if:then:'
block
Would it fit that convention better to keep clocks and clock-names at the
top level with the widest limits (for example minItems: 2, maxItems: 6),
and only narrow them per compatible in the if:then branches?
> @@ -86,8 +65,10 @@ properties:
> or will round down. Range 0~31*170.
> For MT2712 RMII/MII interface, Allowed value need to be a multiple of 550,
> or will round down. Range 0~31*550.
> - For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a multiple of 290,
> - or will round down. Range 0~31*290.
> + For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a
> + multiple of 290, or will round down. Range 0~31*290.
> + For MT8189 RGMII/RMII/MII interface, Allowed value need to
> + be a multiple of 180, or will round down. Range 0~31*180.
[Severity: Low]
This is a pre-existing issue, not something this patch introduced. The
mediatek,tx-delay-ps and mediatek,rx-delay-ps descriptions still start
with:
The internal TX clock delay (provided by this driver) in nanoseconds.
The property names use picoseconds, and so does the driver (for example
"Invalid TX clock delay: %dps"). Should this say picoseconds?
The MT2712 range handling has a similar pre-existing problem.
mt2712_gmac_variant uses tx_delay_max/rx_delay_max = 17600 for every
phy-mode. As a result, an RGMII value above the documented 31*170 still
passes the check in mediatek_dwmac_config_dt():
if (tx_delay_ps < plat->variant->tx_delay_max) {
mac_delay->tx_delay = tx_delay_ps;
mt2712_delay_ps2stage() then divides by 170, and FIELD_PREP silently
truncates the result into the 5-bit ETH_DLY_*_STAGES field. Is that
intended?
[ ... ]
> @@ -147,6 +130,56 @@ required:
> - phy-mode
> - mediatek,pericfg
>
> +allOf:
> + - $ref: snps,dwmac.yaml#
[ ... ]
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - mediatek,mt8189-gmac
> + then:
> + properties:
> + clocks:
> + items:
> + - description: MAC Main clock
> + - description: PTP clock
> +
> + clock-names:
> + items:
> + - const: mac_main
> + - const: ptp_ref
[Severity: Medium]
With this branch, an mt8189 node can only list mac_main and ptp_ref, so
there is no way to provide rmii_internal.
However, mediatek,rmii-clk-from-mac is still allowed at the top level for
every compatible, and nothing here sets it to false for mt8189. The
updated delay text also says MT8189 supports RMII.
Consider an mt8189 node with phy-mode = "rmii" and
mediatek,rmii-clk-from-mac. It passes dt_binding_check. With the driver
change later in this series ("net: stmmac: mediatek: add support for
MT8189 SoC"), mediatek_dwmac_clk_init() then does:
drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c:mediatek_dwmac_clk_init() {
...
if (plat->rmii_clk_from_mac) {
plat->rmii_internal_clk = devm_clk_get(plat->dev, "rmii_internal");
if (IS_ERR(plat->rmii_internal_clk))
ret = PTR_ERR(plat->rmii_internal_clk);
...
}
Wouldn't mediatek_dwmac_probe() then fail with -ENOENT?
The mt8189 variant also reuses mt8195_set_interface(), which programs
MT8195_RMII_CLK_SRC_INTERNAL in this case. So the driver treats this mode
as valid for MT8189, but the binding can't describe it.
If MT8189 can't supply the RMII reference clock from the MAC, should this
branch set mediatek,rmii-clk-from-mac: false? If it can, should an
optional rmii_internal clock be allowed here?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260924-dwmac-mediatek-mt8189-v2-0-430bd74d5ef9%40collabora.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next v2 5/7] net: stmmac: mediatek: use TX clock phase shift in RGMII mode with 1Gbps speed
2026-09-24 7:23 ` [PATCH net-next v2 5/7] net: stmmac: mediatek: use TX clock phase shift in RGMII mode with 1Gbps speed Louis-Alexis Eyraud
@ 2026-09-28 8:03 ` netdev-bot+sashiko
0 siblings, 0 replies; 11+ messages in thread
From: netdev-bot+sashiko @ 2026-09-28 8:03 UTC (permalink / raw)
To: louisalexis.eyraud
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
conor+dt, richardcochran, matthias.bgg,
angelogioacchino.delregno, biao.huang, maxime.chevallier,
mcoquelin.stm32, alexandre.torgue, kernel, netdev, devicetree,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-stm32
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 3 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] At 1Gbps, mt8195_fix_mac_speed()
(drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c) ignores the…
- [Medium] mt8195_fix_mac_speed() and mt8195_set_delay() use different
rules for whether a TX delay is present.
- [Medium] At SPEED_1000, mt8195_fix_mac_speed() sets reg_val to
MT8195_RGMII_TXC_PHASE_CTRL only (line 467).
- [Low] In mt8195_fix_mac_speed(), `tx_delay_stage_val` is declared
without an initializer (line 445: `u32 tx_delay_stage_val,…
--
net: stmmac: mediatek: use TX clock phase shift in RGMII mode with 1Gbps speed
This patch adds a fix_mac_speed callback to the MediaTek dwmac glue and
implements it for MT8195. The callback runs when a TX delay is set in the
devicetree and the PHY mode is rgmii or rgmii-rxid. It enables the fixed
2ns TXC phase shift at 1Gbps and uses the HW delay macro circuit at
10/100Mbps.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> index dee12cfa437d..6123efbbaf02 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
[ ... ]
> @@ -433,9 +436,62 @@ static int mt8195_set_delay(struct mediatek_dwmac_plat_data *plat)
> return 0;
> }
>
> +static void mt8195_fix_mac_speed(void *priv, phy_interface_t interface,
> + int speed, unsigned int mode)
> +{
> + struct mediatek_dwmac_plat_data *priv_plat = priv;
> + const struct mediatek_dwmac_variant *variant;
> + struct mac_delay_struct *mac_delay;
> + u32 tx_delay_stage_val, reg_offset;
> + u32 reg_val = 0;
> +
> + if (!priv_plat)
> + return;
> +
> + mac_delay = &priv_plat->mac_delay;
> + variant = priv_plat->variant;
> +
> + if (!mac_delay->tx_delay ||
> + (interface != PHY_INTERFACE_MODE_RGMII &&
> + interface != PHY_INTERFACE_MODE_RGMII_RXID))
> + return;
[Severity: Medium]
Should this check the stage count instead of the raw picosecond value?
mt8195_set_delay() decides whether there is a TX delay from the number of
stages:
tx_delay_stage_val = mac_delay->tx_delay / tx_delay_stage_div;
...
gtxc_delay_val |= FIELD_PREP(MT8195_DLY_GTXC_ENABLE,
!!tx_delay_stage_val);
Take mediatek,tx-delay-ps set to a value from 1 to 289. The binding says
the value rounds down to 0, and the probe path applies no TX delay. The
same value still passes the !mac_delay->tx_delay check here, so at
SPEED_1000 the callback enables the fixed ~2ns TXC phase shift.
The 10/100 branch further down has the same mismatch:
reg_val |= FIELD_PREP(MT8195_DLY_GTXC_ENABLE,
!!mac_delay->tx_delay);
That sets GTXC_ENABLE=1 with STAGES=0, which is not what probe wrote.
Does this turn a documented "no delay" setting into a 2ns delay at 1G?
> +
> + /*
> + * When link speed is 1Gbps with RGMII interface, and a TX internal
> + * delay needs to be applied on MAC, prefer to override the delay
> + * settings with a 2ns fixed delay which is controlled by
> + * RGMII_TXC_PHASE_CTRL. Otherwise, fallback to HW delay macro circuit
> + * for 10/100Mbps link speeds.
> + */
> + if (speed == SPEED_1000) {
> + reg_val = MT8195_RGMII_TXC_PHASE_CTRL;
[Severity: Medium]
Does this throw away the configured size of mediatek,tx-delay-ps at 1G?
The property is only checked for non-zero above. Any value from 1 to 9279
ps ends up writing only MT8195_RGMII_TXC_PHASE_CTRL here.
MT8195_DLY_GTXC_ENABLE and MT8195_DLY_GTXC_STAGES are in the
regmap_update_bits() mask, so the stages that mt8195_set_delay() programmed
at probe and resume get cleared. As a result, <290>, <1160>, <2030> and
<5000> all give the same 1G programming.
The binding in Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
still describes the property as the internal TX delay:
For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a
multiple of 290, or will round down. Range 0~31*290.
It has no 1G exception, and this patch does not update it.
The in-tree users (mt8395-genio-common.dtsi and mt8395-radxa-nio-12l.dts,
both rgmii-rxid with <2030>) are close to 2ns. A board whose value was
tuned for trace skew far from 2ns would get different 1G timing than
before, with no warning.
The commit message says the phase shift is used "when a delay needs to be
inserted". It does not mention that the configured value is ignored.
The later commit "net: stmmac: mediatek: add support for MT8189 SoC" reuses
this callback unchanged, so this also applies to MT8189 with its 180 ps
stages.
Should the phase shift be used only when the configured delay is close to
2ns? Otherwise, should the binding document the override?
> + } else {
> + if (variant->tx_delay_stage_div)
> + tx_delay_stage_val = mac_delay->tx_delay /
> + variant->tx_delay_stage_div;
> +
> + reg_val |= FIELD_PREP(MT8195_DLY_GTXC_ENABLE,
> + !!mac_delay->tx_delay);
> + reg_val |= FIELD_PREP(MT8195_DLY_GTXC_STAGES,
> + tx_delay_stage_val);
[Severity: Low]
Can tx_delay_stage_val be used uninitialized here?
It is declared without an initializer and only assigned when
variant->tx_delay_stage_div is non-zero. FIELD_PREP() always reads it,
though, and the result is written to PERI_ETH_CTRL0.
mt8195_set_delay() handles this case with an explicit else:
if (tx_delay_stage_div)
tx_delay_stage_val = mac_delay->tx_delay / tx_delay_stage_div;
else
tx_delay_stage_val = 0;
clang's -Wsometimes-uninitialized is likely to warn here, which would break
CONFIG_WERROR builds. Every current user has a non-zero divisor (290 for
MT8195, and 180 for MT8189 later in the series), so this path is not hit at
runtime today.
> + reg_val |= FIELD_PREP(MT8195_DLY_GTXC_INV,
> + mac_delay->tx_inv);
> + }
> +
> + reg_offset = variant->peri_eth_ctrl_offset + MT8195_PERI_ETH_CTRL0;
> + regmap_update_bits(priv_plat->peri_regmap,
> + reg_offset,
> + MT8195_RGMII_TXC_PHASE_CTRL |
> + MT8195_DLY_GTXC_ENABLE |
> + MT8195_DLY_GTXC_INV |
> + MT8195_DLY_GTXC_STAGES,
> + reg_val);
> +}
[Severity: Medium]
At SPEED_1000, reg_val holds only MT8195_RGMII_TXC_PHASE_CTRL, but
MT8195_DLY_GTXC_INV is part of the mask. Does this clear the TX clock
inversion requested by mediatek,txc-inverse at 1G?
mediatek_dwmac_config_dt() reads that property into mac_delay->tx_inv, and
mt8195_set_delay() programs it at probe and resume. The 10/100 branch keeps
it through FIELD_PREP(MT8195_DLY_GTXC_INV, mac_delay->tx_inv). The TX clock
would then be inverted at 10/100 but not at 1G.
The binding describes the property as:
1. tx clock will be inversed in MII/RGMII case,
It has no speed exception. Neither the commit message nor the code comment
mentions dropping the inversion.
Is this intended, or does the hardware ignore GTXC_INV once PHASE_CTRL is
set?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260924-dwmac-mediatek-mt8189-v2-0-430bd74d5ef9%40collabora.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next v2 7/7] net: stmmac: mediatek: add support for MT8189 SoC
2026-09-24 7:23 ` [PATCH net-next v2 7/7] net: stmmac: mediatek: add support for MT8189 SoC Louis-Alexis Eyraud
@ 2026-09-28 8:03 ` netdev-bot+sashiko
0 siblings, 0 replies; 11+ messages in thread
From: netdev-bot+sashiko @ 2026-09-28 8:03 UTC (permalink / raw)
To: louisalexis.eyraud
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
conor+dt, richardcochran, matthias.bgg,
angelogioacchino.delregno, biao.huang, maxime.chevallier,
mcoquelin.stm32, alexandre.torgue, kernel, netdev, devicetree,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-stm32
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 (2) · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] On MT8189, the driver and the DT binding disagree about MAC-
sourced RMII.
Pre-existing issues:
- [Medium] This problem wasn't introduced by this patch, but
mediatek_dwmac_probe() ignores the return value of…
- [Medium] This problem wasn't introduced by this patch, but
mediatek_dwmac_clks_config(enabled=true) leaks clock enables.
--
net: stmmac: mediatek: add support for MT8189 SoC
This adds MT8189 support to the MediaTek dwmac glue driver. MT8189 reuses
the MT8195 pericfg programming callbacks, with a different register
offset, 180ps delay stage dividers, a shorter clock list and the TX clock
output enable feature.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> index 36599dc33b14..f07c331b029f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
[ ... ]
> @@ -124,6 +131,10 @@ static const char * const mt8195_dwmac_clk_l[] = {
> "axi", "apb", "mac_cg", "mac_main", "ptp_ref"
> };
>
> +static const char * const mt8189_dwmac_clk_l[] = {
> + "mac_main", "ptp_ref"
> +};
[Severity: Medium]
How is RMII with the MAC providing the reference clock meant to work on
MT8189?
The MT8189 binding added earlier in this series ("dt-bindings: net:
mediatek-dwmac: add support for MT8189 SoC") limits clock-names to exactly
these two entries:
clock-names:
items:
- const: mac_main
- const: ptp_ref
However, it still allows mediatek,rmii-clk-from-mac for this compatible.
The tx/rx-delay-ps descriptions also mention the MT8189 RMII interface.
If a board sets mediatek,rmii-clk-from-mac, mediatek_dwmac_clk_init()
always requests a clock that the binding does not permit:
drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c:mediatek_dwmac_clk_init() {
...
if (plat->rmii_clk_from_mac) {
plat->rmii_internal_clk = devm_clk_get(plat->dev, "rmii_internal");
if (IS_ERR(plat->rmii_internal_clk))
ret = PTR_ERR(plat->rmii_internal_clk);
...
}
So a DT that passes schema validation fails to probe. A DT that supplies
rmii_internal, and so would probe, fails schema validation.
The new variant also reuses mt8195_set_interface() and mt8195_set_delay().
These program MT8195_RMII_CLK_SRC_INTERNAL and the RMII_TXC/RMII_RXC delay
path, so the driver seems to treat this mode as supported.
Should the MT8189 binding gain an optional rmii_internal clock? Or should
the binding and the driver reject mediatek,rmii-clk-from-mac for MT8189
with a clear error?
[ ... ]
> @@ -495,6 +506,21 @@ static void mt8195_fix_mac_speed(void *priv, phy_interface_t interface,
> reg_val);
> }
>
> +static const struct mediatek_dwmac_variant mt8189_gmac_variant = {
> + .dwmac_set_phy_interface = mt8195_set_interface,
> + .dwmac_set_delay = mt8195_set_delay,
[Severity: Medium]
This is a pre-existing issue, not one introduced by this patch. Now that
MT8189 uses mt8195_set_delay(), can it cause trouble that
mediatek_dwmac_probe() ignores the return value of mediatek_dwmac_init()?
drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c:mediatek_dwmac_probe() {
...
mediatek_dwmac_common_data(pdev, plat_dat, priv_plat);
mediatek_dwmac_init(&pdev->dev, priv_plat);
ret = mediatek_dwmac_clks_config(priv_plat, true);
...
}
With phy-mode = "gmii", stmmac_get_phy_intf_sel() returns
PHY_INTF_SEL_GMII_MII. That passes the check in mediatek_dwmac_init(), and
mt8195_set_interface() writes CTRL0. mt8195_set_delay() then reaches:
default:
dev_err(plat->dev, "phy interface not supported\n");
return -EINVAL;
CTRL1 and CTRL2 are never written, but probe still goes on into
stmmac_dvr_probe() and succeeds.
The error is also ignored for phy modes that mediatek_dwmac_init() rejects
up front. In that case the device probes with the pericfg interface
registers never programmed.
Should probe fail when mediatek_dwmac_init() returns an error?
> + .dwmac_fix_mac_speed = mt8195_fix_mac_speed,
> + .clk_list = mt8189_dwmac_clk_l,
> + .num_clks = ARRAY_SIZE(mt8189_dwmac_clk_l),
[Severity: Medium]
This isn't a bug introduced by this patch, but does
mediatek_dwmac_clks_config() leak the bulk clock enables when the
rmii_internal clock fails to enable?
drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c:mediatek_dwmac_clks_config() {
...
ret = clk_bulk_prepare_enable(variant->num_clks, plat->clks);
...
ret = clk_prepare_enable(plat->rmii_internal_clk);
if (ret) {
dev_err(plat->dev, "failed to enable rmii internal clk, err = %d\n", ret);
return ret;
}
...
}
That path has no clk_bulk_disable_unprepare(). mediatek_dwmac_probe() also
returns the error directly, without reaching err_drv_probe:
ret = mediatek_dwmac_clks_config(priv_plat, true);
if (ret)
return ret;
On MT8189 this leaves mac_main and ptp_ref prepared and enabled. The devm
bulk get cleanup only drops the clock references. The same leak can
happen through the clks_config callback on resume.
On MT8189 this needs a DT that sets mediatek,rmii-clk-from-mac and also
supplies an rmii_internal clock, which the MT8189 binding does not allow.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260924-dwmac-mediatek-mt8189-v2-0-430bd74d5ef9%40collabora.com
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-09-28 8:03 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24 7:23 [PATCH net-next v2 0/7] net/stmmac: Add Mediatek MT8189 support Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 1/7] dt-bindings: net: mediatek-dwmac: add support for MT8189 SoC Louis-Alexis Eyraud
2026-09-28 8:03 ` netdev-bot+sashiko
2026-09-24 7:23 ` [PATCH net-next v2 2/7] net: stmmac: mediatek: simplify TX/RX delay handling in mt8195_set_delay Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 3/7] net: stmmac: mediatek: add RX/TX delay stage divider in platform data Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 4/7] net: stmmac: mediatek: add PERI_ETH_CTRLx register offset " Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 5/7] net: stmmac: mediatek: use TX clock phase shift in RGMII mode with 1Gbps speed Louis-Alexis Eyraud
2026-09-28 8:03 ` netdev-bot+sashiko
2026-09-24 7:23 ` [PATCH net-next v2 6/7] net: stmmac: mediatek: add support for TX clock output enable feature Louis-Alexis Eyraud
2026-09-24 7:23 ` [PATCH net-next v2 7/7] net: stmmac: mediatek: add support for MT8189 SoC Louis-Alexis Eyraud
2026-09-28 8:03 ` netdev-bot+sashiko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®