Lines Matching +full:watchdog +full:- +full:timeout +full:- +full:ms
1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2007-2008
19 #include <watchdog.h>
25 unsigned long const timeout = 1000; /* 1000ms */ in at91_phy_reset() local
28 erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK; in at91_phy_reset()
31 * Need to reset PHY -> 500ms reset in at91_phy_reset()
32 * Reset PHY by pulling the NRST line for 500ms to low. To do so in at91_phy_reset()
37 AT91_RSTC_MR_URSTEN, &rstc->mr); in at91_phy_reset()
39 writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr); in at91_phy_reset()
42 while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL)) { in at91_phy_reset()
43 /* avoid shutdown by watchdog */ in at91_phy_reset()
47 /* timeout for not getting stuck in an endless loop */ in at91_phy_reset()
48 if (get_timer(start) >= timeout) { in at91_phy_reset()
49 puts("*** ERROR: Timeout waiting for PHY reset!\n"); in at91_phy_reset()
55 writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN, &rstc->mr); in at91_phy_reset()