diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/s3c2440/gigabeat-fx/kernel-meg-fx.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/kernel-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/kernel-meg-fx.c index 5ef8c8023a..6a750c32e2 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/kernel-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/kernel-meg-fx.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "timer.h" | 24 | #include "timer.h" |
25 | #include "thread.h" | 25 | #include "thread.h" |
26 | 26 | ||
27 | void tick_start(unsigned int interval_in_ms) | 27 | static inline void tick_set(unsigned int interval_in_ms) |
28 | { | 28 | { |
29 | /* | 29 | /* |
30 | * Based on default PCLK of 49.1568MHz - scaling chosen to give | 30 | * Based on default PCLK of 49.1568MHz - scaling chosen to give |
@@ -49,6 +49,12 @@ void tick_start(unsigned int interval_in_ms) | |||
49 | TCON |= 1 << 21; | 49 | TCON |= 1 << 21; |
50 | /* reset manual bit */ | 50 | /* reset manual bit */ |
51 | TCON &= ~(1 << 21); | 51 | TCON &= ~(1 << 21); |
52 | } | ||
53 | |||
54 | void tick_start(unsigned int interval_in_ms) | ||
55 | { | ||
56 | tick_set(interval_in_ms); | ||
57 | |||
52 | /* interval mode */ | 58 | /* interval mode */ |
53 | TCON |= 1 << 22; | 59 | TCON |= 1 << 22; |
54 | /* start timer 4 */ | 60 | /* start timer 4 */ |
@@ -58,6 +64,26 @@ void tick_start(unsigned int interval_in_ms) | |||
58 | INTMSK &= ~TIMER4_MASK; | 64 | INTMSK &= ~TIMER4_MASK; |
59 | } | 65 | } |
60 | 66 | ||
67 | #ifdef BOOTLOADER | ||
68 | void delay(int ticks) | ||
69 | { | ||
70 | volatile unsigned long counter; | ||
71 | |||
72 | INTMSK |= TIMER4_MASK; | ||
73 | |||
74 | tick_set(1000 * ticks / HZ); | ||
75 | |||
76 | /* autoreload Off */ | ||
77 | TCON &= ~(1 << 22); | ||
78 | /* start timer 4 */ | ||
79 | TCON |= (1 << 20); | ||
80 | |||
81 | do { | ||
82 | counter = TCNTO4; | ||
83 | } while(counter > 0); | ||
84 | } | ||
85 | #endif /* BOOTLOADER */ | ||
86 | |||
61 | void TIMER4(void) | 87 | void TIMER4(void) |
62 | { | 88 | { |
63 | /* Run through the list of tick tasks */ | 89 | /* Run through the list of tick tasks */ |