net: eth-phy: add support of device tree configuration for gpio reset
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Tue, 20 Jul 2021 18:09:51 +0000 (20:09 +0200)
committerRamon Fried <rfried.dev@gmail.com>
Thu, 22 Jul 2021 19:05:28 +0000 (22:05 +0300)
commitd33982d5bc442a0dc720962160019cad518d266e
treee379d8ae52ff69282b5fe505bde6e4828c3e1786
parentb8da46fda664d06f0afa2fbd0fab6e2acd603a93
net: eth-phy: add support of device tree configuration for gpio reset

The gpio reset and the assert or deassert delay are defined in generic
binding of the ethernet phy 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

This patch adds the parsing of this common DT properties in the
u-class "eth_phy_generic", used by default in the associated driver
"eth_phy_generic_drv"

This parsing function eth_phy_of_to_plat can be reused by other
ethernet phy drivers for this uclass UCLASS_ETH_PHY.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
drivers/net/eth-phy-uclass.c