1 // Copyright 2008-2009 Segher Boessenkool <segher@kernel.crashing.org>
2 // This code is licensed to you under the terms of the GNU GPL, version 2;
3 // see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
7 // Timebase frequency is bus frequency / 4. Ignore roundoff, this
8 // doesn't have to be very accurate.
9 #define TICKS_PER_USEC (243/4)
15 asm volatile("mftb %0" : "=r"(x));
20 static void __delay(u32 ticks)
24 while (mftb() - start < ticks)
30 __delay(TICKS_PER_USEC * us);