summaryrefslogtreecommitdiffstats
path: root/cpu/at91rm9200
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/at91rm9200')
-rw-r--r--cpu/at91rm9200/interrupts.c15
-rw-r--r--cpu/at91rm9200/start.S6
2 files changed, 10 insertions, 11 deletions
diff --git a/cpu/at91rm9200/interrupts.c b/cpu/at91rm9200/interrupts.c
index f15c5830bb..cccc4050a8 100644
--- a/cpu/at91rm9200/interrupts.c
+++ b/cpu/at91rm9200/interrupts.c
@@ -231,20 +231,19 @@ ulong get_timer_masked (void)
void udelay_masked (unsigned long usec)
{
ulong tmo;
+ ulong endtime;
+ signed long diff;
-#if 0 /* doesn't work for usec < 1000 */
- tmo = usec / 1000;
- tmo *= CFG_HZ_CLOCK;
-#else
tmo = CFG_HZ_CLOCK / 1000;
tmo *= usec;
-#endif
tmo /= 1000;
- reset_timer_masked ();
+ endtime = get_timer_raw () + tmo;
- while (get_timer_raw () < tmo)
- /*NOP*/;
+ do {
+ ulong now = get_timer_raw ();
+ diff = endtime - now;
+ } while (diff >= 0);
}
/*
diff --git a/cpu/at91rm9200/start.S b/cpu/at91rm9200/start.S
index e897e6b9c9..1881ab1990 100644
--- a/cpu/at91rm9200/start.S
+++ b/cpu/at91rm9200/start.S
@@ -117,11 +117,11 @@ reset:
#ifdef CONFIG_INIT_CRITICAL
/* scratch stack */
- ldr r1, =0x00204000
+/**** ldr r1, =0x00204000 ****/
/* Insure word alignment */
- bic r1, r1, #3
+/**** bic r1, r1, #3 ****/
/* Init stack SYS */
- mov sp, r1
+/**** mov sp, r1 ****/
/*
* This does a lot more than just set up the memory, which
* is why it's called lowlevelinit
OpenPOWER on IntegriCloud