mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
1a4596601f
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
33 lines
606 B
C
33 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);
|
|
}
|