]> git.ipfire.org Git - people/ms/u-boot.git/blame - lib/time.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[people/ms/u-boot.git] / lib / time.c
CommitLineData
3eb90bad
IL
1/*
2 * (C) Copyright 2000-2009
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
1a459660 5 * SPDX-License-Identifier: GPL-2.0+
3eb90bad
IL
6 */
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}
c4c9fbeb
AG
28
29void mdelay(unsigned long msec)
30{
31 while (msec--)
32 udelay(1000);
33}