blob: 68b8ff4190733a3e86edbcef4197bd9669565c2b [file] [log] [blame]
Ingo van Lil3eb90ba2009-11-24 14:09:21 +01001/*
2 * (C) Copyright 2000-2009
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Ingo van Lil3eb90ba2009-11-24 14:09:21 +01006 */
7
8#include <common.h>
9#include <watchdog.h>
10
11#ifndef CONFIG_WD_PERIOD
12# define CONFIG_WD_PERIOD (10 * 1000 * 1000) /* 10 seconds default*/
13#endif
14
15/* ------------------------------------------------------------------------- */
16
17void udelay(unsigned long usec)
18{
19 ulong kv;
20
21 do {
22 WATCHDOG_RESET();
23 kv = usec > CONFIG_WD_PERIOD ? CONFIG_WD_PERIOD : usec;
24 __udelay (kv);
25 usec -= kv;
26 } while(usec);
27}
Anatolij Gustschinc4c9fbe2011-10-12 02:31:39 +000028
29void mdelay(unsigned long msec)
30{
31 while (msec--)
32 udelay(1000);
33}