[PATCH 2/2] dt-bindings: net: dsa: mediatek,mt7530: document MDIO-bus

Arınç ÜNAL arinc.unal at arinc9.com
Sun Apr 30 11:28:26 PDT 2023


On 30.04.2023 20:18, Andrew Lunn wrote:
> On Sun, Apr 30, 2023 at 07:17:10PM +0300, Arınç ÜNAL wrote:
>> On 30.04.2023 15:34, Arınç ÜNAL wrote:
>>> On 30.04.2023 14:28, David Bauer wrote:
>>>> Document the ability to add nodes for the MDIO bus connecting the
>>>> switch-internal PHYs.
>>>
>>> This is quite interesting. Currently the PHY muxing feature for the
>>> MT7530 switch looks for some fake ethernet-phy definitions on the
>>> mdio-bus where the switch is also defined.
>>>
>>> Looking at the binding here, there will be an mdio node under the switch
>>> node. This could be useful to define the ethernet-phys for PHY muxing
>>> here instead, so we don't waste the register addresses on the parent
>>> mdio-bus for fake things. It looks like this should work right out of
>>> the box. I will do some tests.
>>
>> Once I start using the mdio node it forces me to define all the PHYs which
>> were defined as ports.
> 
> Try setting ds->slave_mii_bus to the MDIO bus you register via
> of_mdiobus_register().

That seems to be the case already, under mt7530_setup_mdio():

	bus = devm_mdiobus_alloc(dev);
	if (!bus)
		return -ENOMEM;

	ds->slave_mii_bus = bus;

The bus is registered with devm_of_mdiobus_register(), if that matters. 
(My current knowledge about OF or OF helpers for MDIO is next to nothing.)

The same behaviour is there.

Arınç



More information about the linux-arm-kernel mailing list