* [PATCH net-next 0/2] net: dsa: mt7530: add EcoNet EN7528 built-in switch support
@ 2026-07-10 10:54 Ahmed Naseef
2026-07-10 10:54 ` [PATCH net-next 1/2] dt-bindings: net: dsa: mediatek,mt7530: add econet,en7528-switch Ahmed Naseef
2026-07-10 10:54 ` [PATCH net-next 2/2] net: dsa: mt7530: add EN7528 support Ahmed Naseef
0 siblings, 2 replies; 8+ messages in thread
From: Ahmed Naseef @ 2026-07-10 10:54 UTC (permalink / raw)
To: netdev
Cc: Arınç ÜNAL, Chester A. Unal, David S. Miller,
Andrew Lunn, AngeloGioacchino Del Regno, Conor Dooley,
DENG Qingfang, Daniel Golle, Eric Dumazet, Jakub Kicinski,
Krzysztof Kozlowski, Landen Chao, Matthias Brugger, Paolo Abeni,
Rob Herring, Russell King, Sean Wang, Vladimir Oltean, devicetree,
linux-arm-kernel, linux-kernel, linux-mediatek, Ahmed Naseef
The EcoNet EN7528 is a MIPS SoC whose platform support is already
upstream. It integrates an MT7530 switch, memory-mapped like the built-in
switches of the MediaTek MT7988 and Airoha EN7581/AN7583 SoCs, but with a
true MT7530 core, four Gigabit PHYs on ports 1-4 and a CPU port at a fixed
1000 Mbps full duplex link.
Patch 1 documents the compatible, patch 2 adds the driver support.
Ahmed Naseef (2):
dt-bindings: net: dsa: mediatek,mt7530: add econet,en7528-switch
net: dsa: mt7530: add EN7528 support
.../bindings/net/dsa/mediatek,mt7530.yaml | 5 ++
drivers/net/dsa/mt7530-mmio.c | 1 +
drivers/net/dsa/mt7530.c | 56 ++++++++++++++++++-
drivers/net/dsa/mt7530.h | 1 +
4 files changed, 62 insertions(+), 1 deletion(-)
base-commit: fe3e786ef4eb6e47d2901f568a27bd920477bbe9
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next 1/2] dt-bindings: net: dsa: mediatek,mt7530: add econet,en7528-switch
2026-07-10 10:54 [PATCH net-next 0/2] net: dsa: mt7530: add EcoNet EN7528 built-in switch support Ahmed Naseef
@ 2026-07-10 10:54 ` Ahmed Naseef
2026-07-10 16:18 ` Conor Dooley
2026-07-10 10:54 ` [PATCH net-next 2/2] net: dsa: mt7530: add EN7528 support Ahmed Naseef
1 sibling, 1 reply; 8+ messages in thread
From: Ahmed Naseef @ 2026-07-10 10:54 UTC (permalink / raw)
To: netdev
Cc: Arınç ÜNAL, Chester A. Unal, David S. Miller,
Andrew Lunn, AngeloGioacchino Del Regno, Conor Dooley,
DENG Qingfang, Daniel Golle, Eric Dumazet, Jakub Kicinski,
Krzysztof Kozlowski, Landen Chao, Matthias Brugger, Paolo Abeni,
Rob Herring, Russell King, Sean Wang, Vladimir Oltean, devicetree,
linux-arm-kernel, linux-kernel, linux-mediatek, Ahmed Naseef
The EcoNet EN7528 MIPS SoC integrates an MT7530 Gigabit switch,
memory-mapped in the SoC register space like the built-in switches of
the MediaTek MT7988 and Airoha EN7581/AN7583 SoCs. Its four user ports
are connected to integrated Gigabit PHYs and its CPU port is connected
internally to the SoC Ethernet MAC.
Add the econet,en7528-switch compatible, with the same constraints as
the other built-in switches.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
---
.../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
index 815a90808901..90b3582b7619 100644
--- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
@@ -100,6 +100,10 @@ properties:
Built-in switch of the Airoha AN7583 SoC
const: airoha,an7583-switch
+ - description:
+ Built-in switch of the EcoNet EN7528 SoC
+ const: econet,en7528-switch
+
reg:
maxItems: 1
@@ -318,6 +322,7 @@ allOf:
- mediatek,mt7988-switch
- airoha,en7581-switch
- airoha,an7583-switch
+ - econet,en7528-switch
then:
$ref: "#/$defs/builtin-dsa-port"
properties:
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next 2/2] net: dsa: mt7530: add EN7528 support
2026-07-10 10:54 [PATCH net-next 0/2] net: dsa: mt7530: add EcoNet EN7528 built-in switch support Ahmed Naseef
2026-07-10 10:54 ` [PATCH net-next 1/2] dt-bindings: net: dsa: mediatek,mt7530: add econet,en7528-switch Ahmed Naseef
@ 2026-07-10 10:54 ` Ahmed Naseef
2026-07-10 13:32 ` Andrew Lunn
2026-07-11 10:55 ` sashiko-bot
1 sibling, 2 replies; 8+ messages in thread
From: Ahmed Naseef @ 2026-07-10 10:54 UTC (permalink / raw)
To: netdev
Cc: Arınç ÜNAL, Chester A. Unal, David S. Miller,
Andrew Lunn, AngeloGioacchino Del Regno, Conor Dooley,
DENG Qingfang, Daniel Golle, Eric Dumazet, Jakub Kicinski,
Krzysztof Kozlowski, Landen Chao, Matthias Brugger, Paolo Abeni,
Rob Herring, Russell King, Sean Wang, Vladimir Oltean, devicetree,
linux-arm-kernel, linux-kernel, linux-mediatek, Ahmed Naseef
The EcoNet EN7528 SoC integrates an MT7530 switch (the chip revision
register reads 0x7530), memory-mapped in the SoC register space and
reached through the same MMIO glue used for the built-in switches of the
MediaTek MT7988 and Airoha EN7581/AN7583 SoCs. Its reset sequence and its
PHY indirect access registers are the same as on those switches, so add
an ID_EN7528 variant bound with the "econet,en7528-switch" compatible,
reusing mt7988_setup() and the indirect PHY accessors.
The switch core, however, is an MT7530 and not an MT7531 derivative: it
has no MT7531 CFC register, and the CPU port to trap frames to is set
through the MT7530-style CPU_EN / CPU_PORT fields of the MFC register, so
add it to the MT7530 handling in mt753x_conduit_state_change(). For the
same reason the MT7530 mirror and force-mode register layouts already
apply to it as the default of the MT753X_*() macros.
The four user ports (1-4) are connected to integrated Gigabit PHYs at
MDIO addresses 9-12 of the switch internal MDIO bus. The CPU port (port
6) is connected to the SoC Ethernet MAC at a fixed 1000 Mbps full duplex
link, so the port capabilities cannot be shared with the MT7988 and
EN7581 switches, whose CPU ports run at 10 Gbps.
The LAN GPHYs advertise EEE by default, but negotiating EEE with some
link partners results in an unstable link with dropped frames. Disable
EEE advertisement on them at setup time, like mt7531_setup() does for the
MT7531 switch PHYs.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
---
drivers/net/dsa/mt7530-mmio.c | 1 +
drivers/net/dsa/mt7530.c | 56 ++++++++++++++++++++++++++++++++++-
drivers/net/dsa/mt7530.h | 1 +
3 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mt7530-mmio.c b/drivers/net/dsa/mt7530-mmio.c
index 1dc8b93fb51a..1065671bcdd1 100644
--- a/drivers/net/dsa/mt7530-mmio.c
+++ b/drivers/net/dsa/mt7530-mmio.c
@@ -13,6 +13,7 @@
static const struct of_device_id mt7988_of_match[] = {
{ .compatible = "airoha,an7583-switch", .data = &mt753x_table[ID_AN7583], },
{ .compatible = "airoha,en7581-switch", .data = &mt753x_table[ID_EN7581], },
+ { .compatible = "econet,en7528-switch", .data = &mt753x_table[ID_EN7528], },
{ .compatible = "mediatek,mt7988-switch", .data = &mt753x_table[ID_MT7988], },
{ /* sentinel */ },
};
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 3c2a3029b10c..2aecad77af9a 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2912,6 +2912,30 @@ static void en7581_mac_port_get_caps(struct dsa_switch *ds, int port,
}
}
+static void en7528_mac_port_get_caps(struct dsa_switch *ds, int port,
+ struct phylink_config *config)
+{
+ switch (port) {
+ /* Ports which are connected to switch PHYs. There is no MII pinout. */
+ case 1 ... 4:
+ __set_bit(PHY_INTERFACE_MODE_INTERNAL,
+ config->supported_interfaces);
+
+ config->mac_capabilities |= MAC_10 | MAC_100 | MAC_1000FD;
+ break;
+
+ /* Port 6 is connected to SoC's GMAC at 1000 Mbps full duplex. There
+ * is no MII pinout.
+ */
+ case 6:
+ __set_bit(PHY_INTERFACE_MODE_INTERNAL,
+ config->supported_interfaces);
+
+ config->mac_capabilities |= MAC_1000FD;
+ break;
+ }
+}
+
static void
mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
phy_interface_t interface)
@@ -3254,7 +3278,8 @@ mt753x_conduit_state_change(struct dsa_switch *ds,
* forwarded to the numerically smallest CPU port whose conduit
* interface is up.
*/
- if (priv->id != ID_MT7530 && priv->id != ID_MT7621)
+ if (priv->id != ID_MT7530 && priv->id != ID_MT7621 &&
+ priv->id != ID_EN7528)
return;
mask = BIT(cpu_dp->index);
@@ -3319,9 +3344,17 @@ static int mt753x_setup_tc(struct dsa_switch *ds, int port,
}
}
+/* The EN7528 LAN ports are integrated GPHYs at MDIO addresses 9..12 (switch
+ * ports 1..4) on the switch internal MDIO bus, reachable only through the PHY
+ * indirect access registers. There is no mdiodev to derive the addresses from.
+ */
+#define EN7528_GPHY_BASE 9
+#define EN7528_NUM_GPHYS 4
+
static int mt7988_setup(struct dsa_switch *ds)
{
struct mt7530_priv *priv = ds->priv;
+ int i;
/* Reset the switch */
reset_control_assert(priv->rstc);
@@ -3342,6 +3375,17 @@ static int mt7988_setup(struct dsa_switch *ds)
/* Reset the switch PHYs */
mt7530_write(priv, MT7530_SYS_CTRL, SYS_CTRL_PHY_RST);
+ /* The EN7528 LAN GPHYs advertise EEE by default, but negotiating EEE
+ * with common link partners (e.g. Realtek GbE NICs) results in an
+ * unstable link with dropped frames. Disable EEE advertisement on
+ * them.
+ */
+ if (priv->id == ID_EN7528)
+ for (i = EN7528_GPHY_BASE;
+ i < EN7528_GPHY_BASE + EN7528_NUM_GPHYS; i++)
+ mt7531_ind_c45_phy_write(priv, i, MDIO_MMD_AN,
+ MDIO_AN_EEE_ADV, 0);
+
return mt7531_setup_common(ds);
}
@@ -3459,6 +3503,16 @@ const struct mt753x_info mt753x_table[] = {
.phy_write_c45 = mt7531_ind_c45_phy_write,
.mac_port_get_caps = en7581_mac_port_get_caps,
},
+ [ID_EN7528] = {
+ .id = ID_EN7528,
+ .pcs_ops = &mt7530_pcs_ops,
+ .sw_setup = mt7988_setup,
+ .phy_read_c22 = mt7531_ind_c22_phy_read,
+ .phy_write_c22 = mt7531_ind_c22_phy_write,
+ .phy_read_c45 = mt7531_ind_c45_phy_read,
+ .phy_write_c45 = mt7531_ind_c45_phy_write,
+ .mac_port_get_caps = en7528_mac_port_get_caps,
+ },
};
EXPORT_SYMBOL_GPL(mt753x_table);
diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h
index dd33b0df3419..5f1e841f42c0 100644
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -21,6 +21,7 @@ enum mt753x_id {
ID_MT7988 = 3,
ID_EN7581 = 4,
ID_AN7583 = 5,
+ ID_EN7528 = 6,
};
#define NUM_TRGMII_CTRL 5
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 2/2] net: dsa: mt7530: add EN7528 support
2026-07-10 10:54 ` [PATCH net-next 2/2] net: dsa: mt7530: add EN7528 support Ahmed Naseef
@ 2026-07-10 13:32 ` Andrew Lunn
2026-07-10 16:58 ` Ahmed Naseef
2026-07-11 10:55 ` sashiko-bot
1 sibling, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2026-07-10 13:32 UTC (permalink / raw)
To: Ahmed Naseef
Cc: netdev, Arınç ÜNAL, Chester A. Unal,
David S. Miller, AngeloGioacchino Del Regno, Conor Dooley,
DENG Qingfang, Daniel Golle, Eric Dumazet, Jakub Kicinski,
Krzysztof Kozlowski, Landen Chao, Matthias Brugger, Paolo Abeni,
Rob Herring, Russell King, Sean Wang, Vladimir Oltean, devicetree,
linux-arm-kernel, linux-kernel, linux-mediatek
> + /* The EN7528 LAN GPHYs advertise EEE by default, but negotiating EEE
> + * with common link partners (e.g. Realtek GbE NICs) results in an
> + * unstable link with dropped frames. Disable EEE advertisement on
> + * them.
> + */
> + if (priv->id == ID_EN7528)
> + for (i = EN7528_GPHY_BASE;
> + i < EN7528_GPHY_BASE + EN7528_NUM_GPHYS; i++)
> + mt7531_ind_c45_phy_write(priv, i, MDIO_MMD_AN,
> + MDIO_AN_EEE_ADV, 0);
> +
The problem with this is, you can still use ethtool to enable EEE.
Please look at phylink_bringup_phy(), where it calls
phy_disable_eee().
Andrew
---
pw-bot: cr
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 1/2] dt-bindings: net: dsa: mediatek,mt7530: add econet,en7528-switch
2026-07-10 10:54 ` [PATCH net-next 1/2] dt-bindings: net: dsa: mediatek,mt7530: add econet,en7528-switch Ahmed Naseef
@ 2026-07-10 16:18 ` Conor Dooley
0 siblings, 0 replies; 8+ messages in thread
From: Conor Dooley @ 2026-07-10 16:18 UTC (permalink / raw)
To: Ahmed Naseef
Cc: netdev, Arınç ÜNAL, Chester A. Unal,
David S. Miller, Andrew Lunn, AngeloGioacchino Del Regno,
Conor Dooley, DENG Qingfang, Daniel Golle, Eric Dumazet,
Jakub Kicinski, Krzysztof Kozlowski, Landen Chao,
Matthias Brugger, Paolo Abeni, Rob Herring, Russell King,
Sean Wang, Vladimir Oltean, devicetree, linux-arm-kernel,
linux-kernel, linux-mediatek
[-- Attachment #1: Type: text/plain, Size: 1856 bytes --]
On Fri, Jul 10, 2026 at 02:54:23PM +0400, Ahmed Naseef wrote:
> The EcoNet EN7528 MIPS SoC integrates an MT7530 Gigabit switch,
> memory-mapped in the SoC register space like the built-in switches of
> the MediaTek MT7988 and Airoha EN7581/AN7583 SoCs. Its four user ports
> are connected to integrated Gigabit PHYs and its CPU port is connected
> internally to the SoC Ethernet MAC.
Please note what actually makes this different from the other devices
such that it cannot use a fallback. It's not clear from this description
if the described features are shared with other devices or unique.
pw-bot: changes-requested
Thanks,
Conor.
>
> Add the econet,en7528-switch compatible, with the same constraints as
> the other built-in switches.
>
> Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
> ---
> .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index 815a90808901..90b3582b7619 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -100,6 +100,10 @@ properties:
> Built-in switch of the Airoha AN7583 SoC
> const: airoha,an7583-switch
>
> + - description:
> + Built-in switch of the EcoNet EN7528 SoC
> + const: econet,en7528-switch
> +
> reg:
> maxItems: 1
>
> @@ -318,6 +322,7 @@ allOf:
> - mediatek,mt7988-switch
> - airoha,en7581-switch
> - airoha,an7583-switch
> + - econet,en7528-switch
> then:
> $ref: "#/$defs/builtin-dsa-port"
> properties:
> --
> 2.34.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 2/2] net: dsa: mt7530: add EN7528 support
2026-07-10 13:32 ` Andrew Lunn
@ 2026-07-10 16:58 ` Ahmed Naseef
2026-07-10 17:04 ` Andrew Lunn
0 siblings, 1 reply; 8+ messages in thread
From: Ahmed Naseef @ 2026-07-10 16:58 UTC (permalink / raw)
To: Andrew Lunn
Cc: Ahmed Naseef, netdev, Arınç ÜNAL, Chester A. Unal,
David S. Miller, AngeloGioacchino Del Regno, Conor Dooley,
DENG Qingfang, Daniel Golle, Eric Dumazet, Jakub Kicinski,
Krzysztof Kozlowski, Landen Chao, Matthias Brugger, Paolo Abeni,
Rob Herring, Russell King, Sean Wang, Vladimir Oltean, devicetree,
linux-arm-kernel, linux-kernel, linux-mediatek
On Fri, Jul 10, 2026 at 03:32:32PM +0200, Andrew Lunn wrote:
> > + /* The EN7528 LAN GPHYs advertise EEE by default, but negotiating EEE
> > + * with common link partners (e.g. Realtek GbE NICs) results in an
> > + * unstable link with dropped frames. Disable EEE advertisement on
> > + * them.
> > + */
> > + if (priv->id == ID_EN7528)
> > + for (i = EN7528_GPHY_BASE;
> > + i < EN7528_GPHY_BASE + EN7528_NUM_GPHYS; i++)
> > + mt7531_ind_c45_phy_write(priv, i, MDIO_MMD_AN,
> > + MDIO_AN_EEE_ADV, 0);
> > +
>
> The problem with this is, you can still use ethtool to enable EEE.
>
> Please look at phylink_bringup_phy(), where it calls
> phy_disable_eee().
Thanks, you are right , the register write is the wrong approach.
While looking at phylink_bringup_phy(), I noticed that the mt7530
driver sets config->lpi_capabilities but never config->lpi_interfaces.
Since
mac_supports_eee = mac_supports_eee_ops && lpi_capabilities &&
!phy_interface_empty(lpi_interfaces);
that leaves mac_supports_eee false on all mt753x ports, so phylink
already takes the phy_disable_eee() path for every port and
phylink_ethtool_set_eee() returns -EOPNOTSUPP. On the EN7528 I
confirmed "ethtool --set-eee lan1 eee on" reports "Not supported", so
EEE cannot currently be enabled from userspace on this driver at all.
That looks like it unintentionally undid the "EEE can now be enabled
using ethtool" behaviour from commit 06dfcd4098cf ("net: dsa: mt7530:
fix enabling EEE on MT7531 switch on all boards"), starting with commit
9cf21773f535 ("net: dsa: mt7530: convert to phylink managed EEE"). That
is pre-existing and outside the scope of this series, just flagging it.
For the EN7528 the GPHYs report EEE capability, but the link stops
passing traffic once LPI is entered, so EEE must stay off regardless.
The register loop cannot express that to phylib, as you noted.
My plan for v2 is to not advertise lpi_capabilities for the EN7528, so
mac_supports_eee stays false by design and phylink disables EEE on
these PHYs via phy_disable_eee() and refuses to enable it from
userspace. Does that sound like the right approach to you, or would
you prefer it handled differently?
Thanks,
Ahmed
>
> Andrew
>
> ---
> pw-bot: cr
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 2/2] net: dsa: mt7530: add EN7528 support
2026-07-10 16:58 ` Ahmed Naseef
@ 2026-07-10 17:04 ` Andrew Lunn
0 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2026-07-10 17:04 UTC (permalink / raw)
To: Ahmed Naseef
Cc: netdev, Arınç ÜNAL, Chester A. Unal,
David S. Miller, AngeloGioacchino Del Regno, Conor Dooley,
DENG Qingfang, Daniel Golle, Eric Dumazet, Jakub Kicinski,
Krzysztof Kozlowski, Landen Chao, Matthias Brugger, Paolo Abeni,
Rob Herring, Russell King, Sean Wang, Vladimir Oltean, devicetree,
linux-arm-kernel, linux-kernel, linux-mediatek
> My plan for v2 is to not advertise lpi_capabilities for the EN7528, so
> mac_supports_eee stays false by design and phylink disables EEE on
> these PHYs via phy_disable_eee() and refuses to enable it from
> userspace. Does that sound like the right approach to you, or would
> you prefer it handled differently?
That sounds like the correct thing to do.
Andrew
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 2/2] net: dsa: mt7530: add EN7528 support
2026-07-10 10:54 ` [PATCH net-next 2/2] net: dsa: mt7530: add EN7528 support Ahmed Naseef
2026-07-10 13:32 ` Andrew Lunn
@ 2026-07-11 10:55 ` sashiko-bot
1 sibling, 0 replies; 8+ messages in thread
From: sashiko-bot @ 2026-07-11 10:55 UTC (permalink / raw)
To: Ahmed Naseef; +Cc: robh, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
New issues:
- [Medium] ID_EN7528 writes to an MT7531-specific register, MT7531_DBG_CNT(i), inside mt7531_setup_common().
- [Medium] Missing stabilization delay after hardware reset of PHYs before issuing MDIO writes.
Pre-existing issues:
- [High] ID_AN7583 incorrectly falls back to MT7530_MIRROR_EN (BIT 3) while using the MT7531_CFC register format, failing port mirroring and corrupting CPU packet forwarding logic.
- [High] ID_EN7581 and ID_AN7583 are missing from the MT753X_FORCE_MODE macro, causing them to use the MT7530 bitmask instead of the MT7531 bitmask.
--
--- Patch [2]: [PATCH net-next 2/2] net: dsa: mt7530: add EN7528 support ---
commit 6e316acbfa461fc0e2739fe9d461c2511b9c012c
Author: Ahmed Naseef <naseefkm@gmail.com>
net: dsa: mt7530: add EN7528 support
This patch adds support for the EcoNet EN7528 SoC switch. It introduces the
ID_EN7528 variant, reusing mt7988_setup() and indirect PHY accessors, while
handling the switch core as an MT7530 derivative rather than MT7531.
> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> index 3c2a3029b10cf..2aecad77af9ad 100644
> --- a/drivers/net/dsa/mt7530.c
> +++ b/drivers/net/dsa/mt7530.c
[ ... ]
> @@ -3342,6 +3375,17 @@ static int mt7988_setup(struct dsa_switch *ds)
> /* Reset the switch PHYs */
> mt7530_write(priv, MT7530_SYS_CTRL, SYS_CTRL_PHY_RST);
>
> + /* The EN7528 LAN GPHYs advertise EEE by default, but negotiating EEE
> + * with common link partners (e.g. Realtek GbE NICs) results in an
> + * unstable link with dropped frames. Disable EEE advertisement on
> + * them.
> + */
> + if (priv->id == ID_EN7528)
> + for (i = EN7528_GPHY_BASE;
> + i < EN7528_GPHY_BASE + EN7528_NUM_GPHYS; i++)
> + mt7531_ind_c45_phy_write(priv, i, MDIO_MMD_AN,
> + MDIO_AN_EEE_ADV, 0);
[Severity: Medium]
Does this sequence need a stabilization delay before issuing MDIO writes?
The switch PHYs are hardware reset via SYS_CTRL_PHY_RST just before this,
and hardware PHYs typically require a few milliseconds to exit the reset
state and initialize their management logic.
Could issuing MDIO C45 writes immediately after asserting the reset result in
the PHYs ignoring the transaction or the MDIO controller timing out?
>
> return mt7531_setup_common(ds);
[Severity: Medium]
Does mt7531_setup_common() write to MT7531-specific registers that shouldn't
be accessed by the EN7528?
The commit message states that the EN7528 switch core is an MT7530 derivative
and not an MT7531 derivative. However, mt7988_setup() returns by calling
mt7531_setup_common(), which executes:
mt7531_setup_common() {
...
for (i = 0; i < priv->ds->num_ports; i++) {
...
mt7530_set(priv, MT7531_DBG_CNT(i), MT7531_DIS_CLR);
Could writing MT7531_DIS_CLR to the MT7531_DBG_CNT(i) offset on an MT7530
derivative cause hardware errors or state corruption?
> }
>
> diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h
> index dd33b0df3419e..5f1e841f42c0e 100644
> --- a/drivers/net/dsa/mt7530.h
> +++ b/drivers/net/dsa/mt7530.h
[ ... ]
> @@ -21,6 +21,7 @@ enum mt753x_id {
> ID_MT7988 = 3,
> ID_EN7581 = 4,
> ID_AN7583 = 5,
> + ID_EN7528 = 6,
[Severity: High]
This isn't a bug introduced by this patch, but are ID_AN7583 and ID_EN7581
missing from the MT753X_MIRROR_EN and MT753X_FORCE_MODE macros?
In drivers/net/dsa/mt7530.h, MT753X_MIRROR_EN is defined as:
#define MT753X_MIRROR_EN(id) ((id == ID_MT7531 || \
id == ID_MT7988 || \
id == ID_EN7581) ? \
MT7531_MIRROR_EN : MT7530_MIRROR_EN)
Because ID_AN7583 is omitted, it falls back to MT7530_MIRROR_EN (BIT 3).
When mt753x_port_mirror_add() uses the MT7531_CFC register format for
ID_AN7583, it applies BIT 3. In MT7531_CFC, BIT 3 is part of
MT7531_CPU_PMAP_MASK, which controls CPU packet forwarding logic.
Does this break port mirroring and corrupt the CPU forward control for
ID_AN7583?
Similarly, MT753X_FORCE_MODE is defined as:
#define MT753X_FORCE_MODE(id) ((id == ID_MT7531 || \
id == ID_MT7988) ? \
MT7531_FORCE_MODE_MASK : \
MT7530_FORCE_MODE)
Both ID_EN7581 and ID_AN7583 are missing here. When mt7531_setup_common()
attempts to force all port links down during setup, it applies
MT7530_FORCE_MODE (BIT 15) instead of MT7531_FORCE_MODE_MASK.
Does this fail to correctly disable the port links during switch
initialization?
> };
>
> #define NUM_TRGMII_CTRL 5
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1783680864.git.naseefkm@gmail.com?part=2
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-07-11 10:55 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10 10:54 [PATCH net-next 0/2] net: dsa: mt7530: add EcoNet EN7528 built-in switch support Ahmed Naseef
2026-07-10 10:54 ` [PATCH net-next 1/2] dt-bindings: net: dsa: mediatek,mt7530: add econet,en7528-switch Ahmed Naseef
2026-07-10 16:18 ` Conor Dooley
2026-07-10 10:54 ` [PATCH net-next 2/2] net: dsa: mt7530: add EN7528 support Ahmed Naseef
2026-07-10 13:32 ` Andrew Lunn
2026-07-10 16:58 ` Ahmed Naseef
2026-07-10 17:04 ` Andrew Lunn
2026-07-11 10:55 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox