From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick DELAUNAY Date: Wed, 14 Apr 2021 16:07:45 +0200 Subject: [PATCH] net: dwc_eth_qos: add support of device tree configuration for reset delay In-Reply-To: References: <20210409100022.1.I93dea8b89ea632e7d8f2640a6eca6f6e69fed319@changeid> Message-ID: <68133a1e-5440-0a5d-d5a4-2c1d85ef0c1b@foss.st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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/ 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 ? 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. Regards Patrick