summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r--firmware/target/arm/as3525/system-as3525.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index a28ffc473e..9944e60cc5 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -87,10 +87,12 @@ static const char * const irqname[] =
87 87
88static void UIRQ(void) 88static void UIRQ(void)
89{ 89{
90/* TODO 90 unsigned int irq_no = 0;
91 unsigned int offset = INTOFFSET; 91 int status = VIC_IRQ_STATUS;
92 panicf("Unhandled IRQ %02X: %s", offset, irqname[offset]); 92 while((status >>= 1))
93*/ 93 irq_no++;
94
95 panicf("Unhandled IRQ %02X: %s", irq_no, irqname[irq_no]);
94} 96}
95 97
96void irq_handler(void) 98void irq_handler(void)
@@ -102,16 +104,12 @@ void irq_handler(void)
102 asm volatile( "stmfd sp!, {r0-r7, ip, lr} \n" /* Store context */ 104 asm volatile( "stmfd sp!, {r0-r7, ip, lr} \n" /* Store context */
103 "sub sp, sp, #8 \n"); /* Reserve stack */ 105 "sub sp, sp, #8 \n"); /* Reserve stack */
104 106
105 /* TODO */ 107 unsigned int irq_no = 0;
106#if 0 108 int status = VIC_IRQ_STATUS;
107 int irq_no = INTOFFSET; /* Read clears the corresponding IRQ status */ 109 while((status >>= 1))
108#else 110 irq_no++;
109 int irq_no = 69; 111
110#endif 112 irqvector[irq_no]();
111 if ((irq_no & (1<<31)) == 0) /* Ensure invalid flag is not set */
112 {
113 irqvector[irq_no]();
114 }
115 113
116 asm volatile( "add sp, sp, #8 \n" /* Cleanup stack */ 114 asm volatile( "add sp, sp, #8 \n" /* Cleanup stack */
117 "ldmfd sp!, {r0-r7, ip, lr} \n" /* Restore context */ 115 "ldmfd sp!, {r0-r7, ip, lr} \n" /* Restore context */
@@ -228,6 +226,12 @@ void system_init(void)
228 sdram_init(); 226 sdram_init();
229 227
230 CGU_PERI |= (5<<2)|0x01; /* pclk = PLLA / 6 = 64 MHz */ 228 CGU_PERI |= (5<<2)|0x01; /* pclk = PLLA / 6 = 64 MHz */
229
230#if 0 /* we don't use interrupts at the moment */
231 /* enable VIC */
232 CGU_PERI |= CGU_VIC_CLOCK_ENABLE;
233 VIC_INT_SELECT = 0; /* only IRQ, no FIQ */
234#endif
231} 235}
232 236
233void system_reboot(void) 237void system_reboot(void)