blob: 78eab33f8d68598554c07f347938cc84608c6716 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// SPDX-License-Identifier: GPL-2.0-only
#include <asm/system.h>
#include <clock.h>
#include <common.h>
void udelay(unsigned long us)
{
unsigned long cntfrq = get_cntfrq();
unsigned long ticks = (us * cntfrq) / 1000000;
unsigned long start = get_cntpct();
while ((long)(start + ticks - get_cntpct()) > 0);
}
void mdelay(unsigned long ms)
{
udelay(ms * 1000);
}
|