]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
eth: asix88179: reset during probe
authorCaleb Connolly <caleb.connolly@linaro.org>
Tue, 18 Jun 2024 14:57:57 +0000 (16:57 +0200)
committerMarek Vasut <marex@denx.de>
Sat, 13 Jul 2024 17:51:16 +0000 (19:51 +0200)
In some cases (consistently in my case with an embedded board) the
ethernet controller will time out on the first init but always succeed
after reset.

Let's reset the controller during probe so we always start with it in a
known state, and don't have wait for the first asix_wait_link() to
time out.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
drivers/usb/eth/asix88179.c

index 7bfd285b3aa4b8e0d8e42fed3385802aac4e830d..a0aa5c25e428bff2a5861dc2e8f64108174511d6 100644 (file)
@@ -629,6 +629,12 @@ static int ax88179_eth_probe(struct udevice *dev)
        usb_dev = priv->ueth.pusb_dev;
        priv->maxpacketsize = usb_dev->epmaxpacketout[AX_ENDPOINT_OUT];
 
+       ret = asix_basic_reset(&priv->ueth, priv);
+       if (ret) {
+               printf("Failed to reset ethernet device\n");
+               return ret;
+       }
+
        /* Get the MAC address */
        ret = asix_read_mac(&priv->ueth, pdata->enetaddr);
        if (ret)