mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-29 15:43:44 +08:00
1a4596601f
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
34 lines
606 B
C
34 lines
606 B
C
/*
|
|
* (C) Copyright 2000-2009
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <watchdog.h>
|
|
|
|
#ifndef CONFIG_WD_PERIOD
|
|
# define CONFIG_WD_PERIOD (10 * 1000 * 1000) /* 10 seconds default*/
|
|
#endif
|
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
void udelay(unsigned long usec)
|
|
{
|
|
ulong kv;
|
|
|
|
do {
|
|
WATCHDOG_RESET();
|
|
kv = usec > CONFIG_WD_PERIOD ? CONFIG_WD_PERIOD : usec;
|
|
__udelay (kv);
|
|
usec -= kv;
|
|
} while(usec);
|
|
}
|
|
|
|
void mdelay(unsigned long msec)
|
|
{
|
|
while (msec--)
|
|
udelay(1000);
|
|
}
|