]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: gem: Reduce timeout of mdio phy idle status check
authorAshok Reddy Soma <ashok.reddy.soma@xilinx.com>
Mon, 11 Oct 2021 11:45:42 +0000 (05:45 -0600)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 6 Dec 2021 12:32:48 +0000 (13:32 +0100)
Timeout for checking mdio phy idle status is 20seconds. In case of errors
this timeout will be too much. Reduce it to 100ms.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
drivers/net/zynq_gem.c

index 8e77711acb75d7bb0c254e638e78f089b07a74f2..fece077066dfd0cc4437f1d494ab8097d25c853c 100644 (file)
 
 #define ZYNQ_GEM_DCFG_DBG6_DMA_64B     BIT(23)
 
+#define MDIO_IDLE_TIMEOUT_MS           100
+
 /* Use MII register 1 (MII status register) to detect PHY */
 #define PHY_DETECT_REG  1
 
@@ -228,7 +230,7 @@ static int phy_setup_op(struct zynq_gem_priv *priv, u32 phy_addr, u32 regnum,
        int err;
 
        err = wait_for_bit_le32(&regs->nwsr, ZYNQ_GEM_NWSR_MDIOIDLE_MASK,
-                               true, 20000, false);
+                               true, MDIO_IDLE_TIMEOUT_MS, false);
        if (err)
                return err;
 
@@ -241,7 +243,7 @@ static int phy_setup_op(struct zynq_gem_priv *priv, u32 phy_addr, u32 regnum,
        writel(mgtcr, &regs->phymntnc);
 
        err = wait_for_bit_le32(&regs->nwsr, ZYNQ_GEM_NWSR_MDIOIDLE_MASK,
-                               true, 20000, false);
+                               true, MDIO_IDLE_TIMEOUT_MS, false);
        if (err)
                return err;