[U-Boot-Users] PATCH: m68k/mcf5282 udelay support

Hello,
this patch add udelay support for the mcf5282 cpu.
Best Regards,
Mathias
--- time.c.orig 2004-06-09 17:24:19.000000000 +0200 +++ time.c 2004-11-07 09:51:07.000000000 +0100 @@ -126,6 +126,28 @@
void udelay(unsigned long usec) { + volatile unsigned short *timerp; + uint tmp; + + timerp = (volatile unsigned short *) (CFG_MBAR + MCFTIMER_BASE3); + + while (usec > 0) { + if (usec > 65000) + tmp = 65000; + else + tmp = usec; + usec = usec - tmp; + + /* Set up TIMER 3 as timebase clock */ + timerp[MCFTIMER_PCSR] = MCFTIMER_PCSR_OVW; + timerp[MCFTIMER_PMR] = 0; + /* set period to 1 us */ + timerp[MCFTIMER_PCSR] = + (5 << 8) | MCFTIMER_PCSR_EN | MCFTIMER_PCSR_OVW; + + timerp[MCFTIMER_PMR] = tmp; + while (timerp[MCFTIMER_PCNTR] > 0); + } }
void timer_init (void)

In message 41A366C0.8000204@freenet.de you wrote:
this patch add udelay support for the mcf5282 cpu.
Thanks, added.
Best regards,
Wolfgang Denk
participants (2)
-
Mathias Küster
-
Wolfgang Denk