[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250204125050.lny3ldp7wwc3g3km@skbuf>
Date: Tue, 4 Feb 2025 14:50:50 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Frieder Schrempf <frieder.schrempf@...tron.de>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: DT options for DSA user port with internal PHY
On Tue, Feb 04, 2025 at 09:30:23AM +0100, Frieder Schrempf wrote:
> Hi,
>
> I'm using a KSZ9477 and I'm configuring the DSA user ports in the
> devicetree.
>
> Due to the hardware implementation I need to use some options that
> currently seem to be unsupported by the driver.
>
> First the user ports are physically limited to a maximum speed of
> 100MBit/s. As the MAC and the PHYs are capable of 1G, this also what
> gets advertised during autoneg.
>
> Second the LEDs controlled by the PHY need to be handled in "Single
> Mode" instead of "Dual Mode".
>
> Usually on an external PHY that gets probed separately, I could use
> "max-speed" and "micrel,led-mode" to achieve this.
>
> But for the KSZ9477 the PHYs are not probed but instead hooked into the
> switch driver and from the PHY driver I don't seem to have any way to
> access the DT node for the DSA user port.
>
> What would be the proper way to implement this? Any ideas?
>
> Thanks
> Frieder
>
I don't believe your assessment your correct. The internal KSZ9477 PHYs
are probed either way using the standard device model and phylib, it's
just that their MDIO bus is not backed by an OF node. Looking at
/sys/bus/mdio_bus/devices/ will show that this is the case.
DSA has that shorthand way of describing user ports connected to
internal copper PHYs, but it is for compatibility with legacy drivers
and device trees. For all new device trees is recommended to describe
the "mdio" subnode of the switch, the "ethernet-phy" nodes for the
internal PHYs, and create "phy-handle" references from each user port to
an internal PHY, as you normally would with any other Ethernet PHY.
The schema at
Documentation/devicetree/bindings/net/dsa/microchip/microchip,ksz.yaml
clearly says that an "mdio" child node of the switch is supported.
Also see previous discussions where the same thing has been said:
https://lore.kernel.org/netdev/20241219173805.503900-1-alexander.sverdlin@siemens.com/
Powered by blists - more mailing lists