net: sh_eth: Init the hardware before PHY access
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Sat, 4 Apr 2020 13:01:22 +0000 (15:01 +0200)
committermarex <marex@desktop.lan>
Sat, 4 Apr 2020 13:06:37 +0000 (15:06 +0200)
To access the PHY, the MAC registers must be initialized. Call the init
function in probe() to make it so, otherwise the PHY ID readout returns
all zeroes.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
drivers/net/sh_eth.c

index 183e8e3083ae31a3ea0ee4acc1c33f1fcc52b8e2..f8e5d05722ab90feabeebeacbf6cdf0cef2a900e 100644 (file)
@@ -859,6 +859,10 @@ static int sh_ether_probe(struct udevice *udev)
                goto err_mdio_register;
 #endif
 
+       ret = sh_eth_init_common(eth, pdata->enetaddr);
+       if (ret)
+               goto err_phy_config;
+
        ret = sh_eth_phy_config(udev);
        if (ret) {
                printf(SHETHER_NAME ": phy config timeout\n");