net: fec: add support for DM_MDIO
authorTim Harvey <tharvey@gateworks.com>
Wed, 30 Nov 2022 17:42:49 +0000 (09:42 -0800)
committerTom Rini <trini@konsulko.com>
Thu, 2 Feb 2023 19:44:51 +0000 (14:44 -0500)
commit3b8f99a3e7628c17763b18a14f880bf1725c3828
tree91fbd55ad429c1ec58cc94284e5068a032f6d50f
parent8abb9f6b17c8f76301f7359450813b6f6f52540e
net: fec: add support for DM_MDIO

Add support for DM_MDIO by registering a UCLASS_MDIO driver and
attempting to use it. This is necessary if wanting to use a DSA
driver for example hanging off of the FEC MAC.

Care is taken to fallback to non DM_MDIO mii bus as several boards define
DM_MDIO without having the proper device-tree configuration necessary
such as an mdio subnode, a phy-mode prop, and either a valid phy-handle
prop or fixed-phy subnode which will cause dm_eth_phy_connect() to fail.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
drivers/net/fec_mxc.c