lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95b6d4e7-24de-4a46-b5ab-c5a9e14ce312@kontron.de>
Date: Tue, 25 Feb 2025 09:41:49 +0100
From: Frieder Schrempf <frieder.schrempf@...tron.de>
To: Vladimir Oltean <olteanv@...il.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: DT options for DSA user port with internal PHY

Hi Vladimir,

On 04.02.25 1:50 PM, Vladimir Oltean wrote:
> 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/

Thanks a lot for the detailed explanation. This is really helpful!
I was aware of the mdio subnode, but I incorrectly assumed that it can
only be used for external PHYs on a real MDIO bus.

That resolves my issue and I can now properly configure the internal PHYs.

Thanks
Frieder

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ