2009-11-24 21:09:21 +08:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2000-2009
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*
|
2013-07-08 15:37:19 +08:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2009-11-24 21:09:21 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#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);
|
|
|
|
}
|
2011-10-12 10:31:39 +08:00
|
|
|
|
|
|
|
void mdelay(unsigned long msec)
|
|
|
|
{
|
|
|
|
while (msec--)
|
|
|
|
udelay(1000);
|
|
|
|
}
|