Re: [PATCH net-next v4 4/8] dt-bindings: mfd: Add SoC-e SWIP parent
From: Vasilij Strassheim
Date: Mon Nov 16 2026 - 05:35:06 EST
On Fri, 2026-11-13 at 21:48 +0100, Andrew Lunn wrote:
> > > Given the MDIO bus and mux registers are adjacent, I don't know that
> > > putting the mux into its own node and driver really buys you anything.
> > > Can't your MDIO driver handle the muxing directly? mdio-mux-mmioreg was
> > > created for when you have mux registers in some completely unrelated
> > > block.
> > >
> >
> > What it buys me is less custom code to maintain for bus selection and
> > selector-value validation.
> >
> > The MDIO controller and mux were combined in a previous version.
> > Following Andrew's suggestion [1], I moved the controller into its own
> > driver and stacked mdio-mux-mmioreg on top of it.
> > Sure, the selector is part of the same MDIO control register. But the
> > generic driver already provides the masked register update and
> > selector-value checks. My preference is to keep the current approach
> > to reuse existing code, even if it requires some integration and
> > documentation efforts.
>
> Since you have both implementations. Did the lines of code go down
> when you reused the existing mux?
Yes, the number was halved from around 400 lines when I didn't use
mdio-mux at all in c-files. I have no numbers to compare only those for
mdio-mux-mmioreg.
Without mdio-mux-mmioreg, I would need to reimplement the selector
handling and bus number checks, as well as some de-/initialization
routines. I think the bcm6368 and iproc use mdio-mux in this way.
>
> > The IP core can also include an I2C master for accessing external
> > devices as a synthesis option.
>
> SFP cage being the obvious thing.
SFP is a good hint. Their website shows FPGA-based devices, such as PCIe
cards, that support SFP ports.
>
> It will need to be a Linux I2C master in order that phylink can use
> it. And i would not be too surprised if the existing I2C drivers can
> drive it, it will be licensed IP. So an MFD will make it easier to
> instantiate.
Looks like a standard I2C interface. I don't have one yet to test, but
it would be good to consider this early with MFD.
>
> Andrew
Thanks,
Vasilij