blob: 0cef08e4d2e10239d3d8c213d056d86beff99e99 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#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);
}
|