- net: designware: fix PHY reset with DM_MDIO, fixing boot of (at least) Odroid-C4

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPVPGJshWBf4d9CyLd9zb2sjISdEFAmCJg4wACgkQd9zb2sjI
 SdHekBAAt53MzWI3wl+wrbFDYjGOqWcV8yIRqwqB6zoHN1WTQqauKE/42fh1r8mY
 Wek26poY6q9VGTskT/OCh1WLPnvqZXEsuJXSHAMZC3m2bjjmoqDDHGnXWQD2RLGZ
 RTOqLO0r50Gh1sKwV4oAVZw4FINwPpd5zLCTxD9jSlT7J9ZhHrn+1FFk+Kvsct4e
 7HTASAz3WZPKLYzBVJnrNiX7U3K92d/sBQgo8bZGpAebjmyjG5syJMrOQgRc7TWx
 PRsDmp7Yn+HHPteE8+3D5DkAuMSsCYL3hbH6SlNIuF7wrCVdhER2cYXpccgD2dEt
 YdBUjUCJlHg53timjAmkF/HQPSE1EZCpt9hHvcMb0G7a7BfN/3JNpdws4e2z6Shn
 pHJEgKdt/S/a+v2x529ElBDwEqcVaLYYOkIKhv29sif18+/3IzpfCWgD8/NWGoo8
 QePQ6JnyA37/2poY0r7/T4oI/Q2YAhdkIOWnUTwfOIMSs+/jJjbTPSouLdr6bPTE
 UYohCv8uzIWMhG4F41YW2tU6P5WtXWWKCYBSoZ8sODVc985g89Wue3PFm20y551F
 HRzF0jeIdYAMYb0UipUbGtP4/QwsTmMOjz1eMrsfbgo5slYIIGgnSe7zv5AgAbZI
 S7DI8OhMLhsIXLqPsApoHs/HR3mxd6NwOnXfyb5HoyjOTkfaZ4Y=
 =kBLz
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-amlogic-20210428' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- net: designware: fix PHY reset with DM_MDIO, fixing boot of (at least) Odroid-C4
This commit is contained in:
Tom Rini 2021-04-28 14:22:43 -04:00
commit 9c211075d0

View file

@ -91,9 +91,8 @@ static int dw_mdio_write(struct mii_dev *bus, int addr, int devad, int reg,
}
#if defined(CONFIG_DM_ETH) && CONFIG_IS_ENABLED(DM_GPIO)
static int dw_mdio_reset(struct mii_dev *bus)
static int __dw_mdio_reset(struct udevice *dev)
{
struct udevice *dev = bus->priv;
struct dw_eth_dev *priv = dev_get_priv(dev);
struct dw_eth_pdata *pdata = dev_get_plat(dev);
int ret;
@ -122,6 +121,13 @@ static int dw_mdio_reset(struct mii_dev *bus)
return 0;
}
static int dw_mdio_reset(struct mii_dev *bus)
{
struct udevice *dev = bus->priv;
return __dw_mdio_reset(dev);
}
#endif
#if IS_ENABLED(CONFIG_DM_MDIO)
@ -142,9 +148,10 @@ int designware_eth_mdio_write(struct udevice *mdio_dev, int addr, int devad, int
#if CONFIG_IS_ENABLED(DM_GPIO)
int designware_eth_mdio_reset(struct udevice *mdio_dev)
{
struct mdio_perdev_priv *pdata = dev_get_uclass_priv(mdio_dev);
struct mdio_perdev_priv *mdio_pdata = dev_get_uclass_priv(mdio_dev);
struct udevice *dev = mdio_pdata->mii_bus->priv;
return dw_mdio_reset(pdata->mii_bus);
return __dw_mdio_reset(dev->parent);
}
#endif