summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/as3525/system-as3525.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index 6a4c7a1264..5eae1a35b3 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -38,8 +38,9 @@
38#define default_interrupt(name) \ 38#define default_interrupt(name) \
39 extern __attribute__((weak,alias("UIRQ"))) void name (void) 39 extern __attribute__((weak,alias("UIRQ"))) void name (void)
40 40
41void irq_handler(void) __attribute__((interrupt ("IRQ"), naked)); 41static void UIRQ (void) __attribute__((interrupt ("IRQ")));
42void fiq_handler(void) __attribute__((interrupt ("FIQ"), naked)); 42void irq_handler(void) __attribute__((interrupt ("IRQ")));
43void fiq_handler(void) __attribute__((interrupt ("FIQ")));
43 44
44default_interrupt(INT_WATCHDOG); 45default_interrupt(INT_WATCHDOG);
45default_interrupt(INT_TIMER1); 46default_interrupt(INT_TIMER1);
@@ -136,8 +137,6 @@ struct vec_int_src vec_int_srcs[] =
136 137
137static void setup_vic(void) 138static void setup_vic(void)
138{ 139{
139 volatile unsigned long *vic_vect_addrs = VIC_VECT_ADDRS;
140 volatile unsigned long *vic_vect_cntls = VIC_VECT_CNTLS;
141 const unsigned int n = sizeof(vec_int_srcs)/sizeof(vec_int_srcs[0]); 140 const unsigned int n = sizeof(vec_int_srcs)/sizeof(vec_int_srcs[0]);
142 unsigned int i; 141 unsigned int i;
143 142
@@ -145,12 +144,12 @@ static void setup_vic(void)
145 VIC_INT_EN_CLEAR = 0xffffffff; /* disable all interrupt lines */ 144 VIC_INT_EN_CLEAR = 0xffffffff; /* disable all interrupt lines */
146 VIC_INT_SELECT = 0; /* only IRQ, no FIQ */ 145 VIC_INT_SELECT = 0; /* only IRQ, no FIQ */
147 146
148 VIC_DEF_VECT_ADDR = (unsigned long)UIRQ; 147 *VIC_DEF_VECT_ADDR = UIRQ;
149 148
150 for(i = 0; i < n; i++) 149 for(i = 0; i < n; i++)
151 { 150 {
152 vic_vect_addrs[i] = (unsigned long)vec_int_srcs[i].isr; 151 VIC_VECT_ADDRS[i] = vec_int_srcs[i].isr;
153 vic_vect_cntls[i] = (1<<5) | vec_int_srcs[i].source; 152 VIC_VECT_CNTLS[i] = (1<<5) | vec_int_srcs[i].source;
154 } 153 }
155} 154}
156 155
@@ -168,21 +167,12 @@ void INT_GPIOA(void)
168 167
169void irq_handler(void) 168void irq_handler(void)
170{ 169{
171 asm volatile( "stmfd sp!, {r0-r5,ip,lr} \n" /* Store context */ 170 (*VIC_VECT_ADDR)(); /* call the isr */
172 "ldr r5, =0xC6010030 \n" /* VIC_VECT_ADDR */ 171 *VIC_VECT_ADDR = (void*)VIC_VECT_ADDR; /* any write will ack the irq */
173 "mov lr, pc \n" /* Return from ISR */
174 "ldr pc, [r5] \n" /* execute ISR */
175 "str r0, [r5] \n" /* Ack interrupt */
176 "ldmfd sp!, {r0-r5,ip,lr} \n" /* Restore context */
177 "subs pc, lr, #4 \n" /* Return from IRQ */
178 );
179} 172}
180 173
181void fiq_handler(void) 174void fiq_handler(void)
182{ 175{
183 asm volatile (
184 "subs pc, lr, #4 \r\n"
185 );
186} 176}
187 177
188#if defined(SANSA_C200V2) 178#if defined(SANSA_C200V2)