2003-10-08 23:26:14 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2003, Psyent Corporation <www.psyent.com>
|
|
|
|
* Scott McNutt <smcnutt@psyent.com>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2003-10-08 23:26:14 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2004-02-23 23:54:43 +00:00
|
|
|
#include <watchdog.h>
|
2003-10-08 23:26:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
extern void dly_clks( unsigned long ticks );
|
|
|
|
|
2009-11-24 13:09:21 +00:00
|
|
|
void __udelay(unsigned long usec)
|
2003-10-08 23:26:14 +00:00
|
|
|
{
|
|
|
|
/* The Nios core doesn't have a timebase, so we do our
|
|
|
|
* best for now and call a low-level loop that counts
|
|
|
|
* cpu clocks.
|
|
|
|
*/
|
|
|
|
unsigned long cnt = (CONFIG_SYS_CLK_FREQ/1000000) * usec;
|
|
|
|
dly_clks (cnt);
|
|
|
|
}
|