Add support for the MDIO multiplexer found in the Amlogic GXL SoC family.
This multiplexer allows to choose between the external (SoC pins) MDIO bus,
or the internal one leading to the integrated 10/100M PHY.
This multiplexer has been handled with the mdio-mux-mmioreg generic driver
so far. When it was added, it was thought the logic was handled by a
single register.
It turns out more than a single register need to be properly set.
As long as the device is using the Amlogic vendor bootloader, or upstream
u-boot with net support, it is working fine since the kernel is inheriting
the bootloader settings. Without net support in the bootloader, this glue
comes unset in the kernel and only the external path may operate properly.
With this driver (and the associated DT update), the kernel no longer relies
on the bootloader to set things up, fixing the problem.
This has been tested on the aml-s905x-cc (LePotato) for the internal path
and the aml-s912-pc (Tartiflette) for the external path.
Jerome Brunet (2):
dt-bindings: net: add amlogic gxl mdio multiplexer
net: mdio: add amlogic gxl mdio mux support
.../bindings/net/amlogic,gxl-mdio-mux.yaml | 64 +++++++
drivers/net/mdio/Kconfig | 11 ++
drivers/net/mdio/Makefile | 1 +
drivers/net/mdio/mdio-mux-meson-gxl.c | 160 ++++++++++++++++++
4 files changed, 236 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/amlogic,gxl-mdio-mux.yaml
create mode 100644 drivers/net/mdio/mdio-mux-meson-gxl.c
--
2.39.0
On Mon, Jan 16, 2023 at 10:16:34AM +0100, Jerome Brunet wrote:
> Add support for the MDIO multiplexer found in the Amlogic GXL SoC family.
> This multiplexer allows to choose between the external (SoC pins) MDIO bus,
> or the internal one leading to the integrated 10/100M PHY.
>
> This multiplexer has been handled with the mdio-mux-mmioreg generic driver
> so far. When it was added, it was thought the logic was handled by a
> single register.
>
> It turns out more than a single register need to be properly set.
> As long as the device is using the Amlogic vendor bootloader, or upstream
> u-boot with net support, it is working fine since the kernel is inheriting
> the bootloader settings. Without net support in the bootloader, this glue
> comes unset in the kernel and only the external path may operate properly.
>
> With this driver (and the associated DT update), the kernel no longer relies
> on the bootloader to set things up, fixing the problem.
Ideally, you should also post an actual user of this driver, i.e. the
DT updates.
> This has been tested on the aml-s905x-cc (LePotato) for the internal path
> and the aml-s912-pc (Tartiflette) for the external path.
So these exist in mainline, which is enough for me.
Andrew
On Wed 18 Jan 2023 at 04:08, Andrew Lunn <[email protected]> wrote:
> On Mon, Jan 16, 2023 at 10:16:34AM +0100, Jerome Brunet wrote:
>> Add support for the MDIO multiplexer found in the Amlogic GXL SoC family.
>> This multiplexer allows to choose between the external (SoC pins) MDIO bus,
>> or the internal one leading to the integrated 10/100M PHY.
>>
>> This multiplexer has been handled with the mdio-mux-mmioreg generic driver
>> so far. When it was added, it was thought the logic was handled by a
>> single register.
>>
>> It turns out more than a single register need to be properly set.
>> As long as the device is using the Amlogic vendor bootloader, or upstream
>> u-boot with net support, it is working fine since the kernel is inheriting
>> the bootloader settings. Without net support in the bootloader, this glue
>> comes unset in the kernel and only the external path may operate properly.
>>
>> With this driver (and the associated DT update), the kernel no longer relies
>> on the bootloader to set things up, fixing the problem.
>
> Ideally, you should also post an actual user of this driver, i.e. the
> DT updates.
I usually avoid doing this since the DT part is intended for another
maintainer. The idea is make life easy for them and let them pick the
entire series (or not). I don't mind sending the DT update along if it
is the perferred way with netdev.
FYI, the DT update would look like this :
https://gitlab.com/jbrunet/linux/-/commit/1d38ccf1b9f264111b1c56f18cfb4804227d3894.patch
>
>> This has been tested on the aml-s905x-cc (LePotato) for the internal path
>> and the aml-s912-pc (Tartiflette) for the external path.
>
> So these exist in mainline, which is enough for me.
Yes the boards exists in mainline, there are still using the mdio-mux-mmioreg driver
ATM
>
> Andrew
> I usually avoid doing this since the DT part is intended for another
> maintainer. The idea is make life easy for them and let them pick the
> entire series (or not). I don't mind sending the DT update along if it
> is the perferred way with netdev.
>
> FYI, the DT update would look like this :
> https://gitlab.com/jbrunet/linux/-/commit/1d38ccf1b9f264111b1c56f18cfb4804227d3894.patch
>
> >
> >> This has been tested on the aml-s905x-cc (LePotato) for the internal path
> >> and the aml-s912-pc (Tartiflette) for the external path.
> >
> > So these exist in mainline, which is enough for me.
>
> Yes the boards exists in mainline, there are still using the mdio-mux-mmioreg driver
> ATM
The point of posting the actual users is sometimes we get vendor crap
with no actual in tree users. We want to avoid that. It can be enough
to mention in the cover letter than a future patchset will change the
DT files X, Y and Z, making it clear there are in tree users.
Andrew