diff options
Diffstat (limited to 'firmware/timer.c')
-rw-r--r-- | firmware/timer.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/firmware/timer.c b/firmware/timer.c index a11cd10b7e..e9f11b6ae7 100644 --- a/firmware/timer.c +++ b/firmware/timer.c | |||
@@ -35,6 +35,15 @@ static int base_prescale; | |||
35 | static long SHAREDBSS_ATTR cycles_new = 0; | 35 | static long SHAREDBSS_ATTR cycles_new = 0; |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #ifndef __TIMER_SET | ||
39 | /* Define these if not defined by target to make the #else cases compile | ||
40 | * even if the target doesn't have them implemented. */ | ||
41 | #define __TIMER_SET(cycles, set) false | ||
42 | #define __TIMER_REGISTER(reg_prio, unregister_callback, cycles, \ | ||
43 | int_prio, timer_callback) false | ||
44 | #define __TIMER_UNREGISTER(...) | ||
45 | #endif | ||
46 | |||
38 | /* interrupt handler */ | 47 | /* interrupt handler */ |
39 | #if CONFIG_CPU == SH7034 | 48 | #if CONFIG_CPU == SH7034 |
40 | void IMIA4(void) __attribute__((interrupt_handler)); | 49 | void IMIA4(void) __attribute__((interrupt_handler)); |
@@ -245,10 +254,6 @@ static bool timer_set(long cycles, bool start) | |||
245 | cycles_new = cycles; | 254 | cycles_new = cycles; |
246 | 255 | ||
247 | return true; | 256 | return true; |
248 | #elif (CONFIG_CPU == IMX31L) | ||
249 | /* TODO */ | ||
250 | (void)cycles; (void)start; | ||
251 | return false; | ||
252 | #else | 257 | #else |
253 | return __TIMER_SET(cycles, start); | 258 | return __TIMER_SET(cycles, start); |
254 | #endif /* CONFIG_CPU */ | 259 | #endif /* CONFIG_CPU */ |
@@ -319,9 +324,6 @@ bool timer_register(int reg_prio, void (*unregister_callback)(void), | |||
319 | CGU_PERI |= CGU_TIMER1_CLOCK_ENABLE; /* enable peripheral */ | 324 | CGU_PERI |= CGU_TIMER1_CLOCK_ENABLE; /* enable peripheral */ |
320 | VIC_INT_ENABLE |= INTERRUPT_TIMER1; | 325 | VIC_INT_ENABLE |= INTERRUPT_TIMER1; |
321 | return true; | 326 | return true; |
322 | #elif CONFIG_CPU == IMX31L | ||
323 | /* TODO */ | ||
324 | return false; | ||
325 | #else | 327 | #else |
326 | return __TIMER_REGISTER(reg_prio, unregister_callback, cycles, | 328 | return __TIMER_REGISTER(reg_prio, unregister_callback, cycles, |
327 | int_prio, timer_callback); | 329 | int_prio, timer_callback); |
@@ -359,7 +361,7 @@ void timer_unregister(void) | |||
359 | TIMER1_CONTROL &= 0x10; /* disable timer 1 (don't modify bit 4) */ | 361 | TIMER1_CONTROL &= 0x10; /* disable timer 1 (don't modify bit 4) */ |
360 | VIC_INT_EN_CLEAR = INTERRUPT_TIMER1; /* disable interrupt */ | 362 | VIC_INT_EN_CLEAR = INTERRUPT_TIMER1; /* disable interrupt */ |
361 | CGU_PERI &= ~CGU_TIMER1_CLOCK_ENABLE; /* disable peripheral */ | 363 | CGU_PERI &= ~CGU_TIMER1_CLOCK_ENABLE; /* disable peripheral */ |
362 | #elif CONFIG_CPU == S3C2440 || CONFIG_CPU == DM320 | 364 | #else |
363 | __TIMER_UNREGISTER(); | 365 | __TIMER_UNREGISTER(); |
364 | #endif | 366 | #endif |
365 | pfn_timer = NULL; | 367 | pfn_timer = NULL; |