Re: [PATCH net-next] net: phy: mediatek: support MT7530 PHYs on EN71221 MCM

From: Daniel Golle

Date: Wed Sep 09 2026 - 21:59:44 EST


On Thu, Sep 10, 2026 at 01:26:14AM +0200, Caleb James DeLisle wrote:
>
> On 10/09/2026 01:02, Daniel Golle wrote:
> > On Wed, Sep 09, 2026 at 09:32:50PM +0000, Caleb James DeLisle wrote:
> > > The EcoNet EN751221 multi-chip module implementation of the MT7530
> > > requires some additional configuration of the PHYs on startup.
> > > The reason for this is not known, but it is possible that it has
> > > to do with the fact that the EN751221 MCM implementation of the
> > > MT7530 runs at an abnormal PLL frequency (362.5Mhz).
> > >
> > > Detect whether the MT7530 PHY is attached to the MDIO bus of an
> > > EcoNet EN751221 switch and if so, apply the necessary register
> > > updates.
> > >
> > > Co-developed-by: Matheus Sampaio Queiroga <srherobrine20@xxxxxxxxx>
> > > Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@xxxxxxxxx>
> > > Signed-off-by: Caleb James DeLisle <cjd@xxxxxxxx>
> > > ---
> > > drivers/net/phy/mediatek/mtk-ge.c | 61 +++++++++++++++++++++++++++++++
> > > 1 file changed, 61 insertions(+)
> > >
> > > diff --git a/drivers/net/phy/mediatek/mtk-ge.c b/drivers/net/phy/mediatek/mtk-ge.c
> > > index 73d9b72f9d9e..42b06c40d703 100644
> > > --- a/drivers/net/phy/mediatek/mtk-ge.c
> > > +++ b/drivers/net/phy/mediatek/mtk-ge.c
> > > [...]
> > > static int mt7530_phy_config_init(struct phy_device *phydev)
> > > {
> > > + int ret;
> > > +
> > > + if (mt7530_phy_is_en751221_companion(phydev)) {
> > Please introduce a `.match_phy_device` operation for both, actual
> > MT7530 and EN751221, similar eg. to `ksz8051_match_phy_device` in
> > micrel.c.
>
> Sounds good, since this will certainly collide with
> https://lore.kernel.org/netdev/20260827065930.2618729-2-cjd@xxxxxxxx/ would
> you prefer them in the same patch, or as a patch set? If you'd like I can do
> this and the FE phy as a common patch set. Let me know what you prefer.

I'd do it one driver at a time, starting with mtk-ge.c, already adding
the .match_phy_device logic so it would also avoid binding the MT7530
driver to an ECONET_FEPHY.

The econet-fe-soc.c driver is much larger and may require more rounds
to make all bots and humans happy, so I'd not have the independently
useful mtk-ge.c changes depend on that.

Dumping the PHY register space and comparing it with MT7530 could also
help to indentify any better way than relying on the parent DT
compatible which *is* a bit of a stretch (but could well be
unavoidable, of course).