[PATCH] net: dwc_eth_qos: add support of device tree configuration for reset delay

Marek Vasut marex at denx.de
Wed Apr 14 16:36:17 CEST 2021


On 4/14/21 4:07 PM, Patrick DELAUNAY wrote:
> Hi,

Hi,

> On 4/9/21 2:22 PM, Marek Vasut wrote:
>> On 4/9/21 10:00 AM, Patrick Delaunay wrote:
>>> The gpio reset assert/deassert delay are today harcoded in U-Boot driver
>>> but the value should be read from DT.
>>>
>>> STM32 use the generic binding defined in linux:
>>> Documentation/devicetree/bindings/net/ethernet-phy.yaml
>>>
>>>    reset-gpios:
>>>      maxItems: 1
>>>      description:
>>>        The GPIO phandle and specifier for the PHY reset signal.
>>>
>>>    reset-assert-us:
>>>      description:
>>>        Delay after the reset was asserted in microseconds. If this
>>>        property is missing the delay will be skipped.
>>>
>>>    reset-deassert-us:
>>>      description:
>>>        Delay after the reset was deasserted in microseconds. If
>>>        this property is missing the delay will be skipped.
>>>
>>> See also U-Boot: doc/device-tree-bindings/net/phy.txt
>>
>> Since this is a PHY property, shouldn't that be handled in 
>> drivers/net/phy/ instead of MAC driver ?
> 
> 
> I was my first idea but I don't found found the correct location in phy 
> (driver or uclass)
> 
> to manage these generic property and the generic property "reset-gpios" 
> was already
> 
> managed in eth driver, so I continue to patch the driver.
> 
> 
> But I come back to this idea after your remark....
> 
> => in linux these property are managed in
> 
>      drivers/net/mdio/of_mdio.c::of_mdiobus_phy_device_register
> 
>          parse DT node and add info in mdio
> 
>      drivers/net/phy/mdio_device.c::mdio_device_reset
> 
>          called in  mdio_probe / mdio_remove
> 
> 
> In my first search, I don't found the same level in the U-Boot drivers 
> in drivers/net/phy/

Note that this is MDIO-wide PHY reset (e.g. you can have single reset 
line connected to multiple PHYs on single MDIO bus), this is not 
PHY-specific reset.

> but I miss the uclass defined in drivers/net/eth-phy-uclass.c
> 
> 
> Finally I think I need to manage the generic binding property
> 
> (reset-gpios, reset-assert-us, reset-deassert-us) directly  in
> 
> => drivers/net/mdio-uclass
> 
> 
> The GPIO RESET will be managed in mdio  ops: pre_probe/ post_remove
> 
> as it is done in linux
> 
> warning: today post_remove ops don't exit in u-class.
> 
> 
> Do you think it is the correct location ?

For single-PHY reset, the correct location is in drivers/net/phy/ somewhere.

> Do you think it should be a new serie (migrate the eqos property in mdio)
> 
> after this eqos is accepted
> 
> or I shoudl sent a new serie to replace this serie.

I'll leave that decision to Ramon/Joe.


More information about the U-Boot mailing list