summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-08-10 21:44:48 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-08-10 21:44:48 +0000
commit4bf4d2bb55535c9c90afff717bcf046bd19af982 (patch)
tree0c1a8c5a4a636339699059c7300cb45f6cd129e4 /firmware/target/mips/ingenic_jz47xx/system-jz4740.c
parent4396b5b101dba2af84ad92bdefd16c5b6210f910 (diff)
downloadrockbox-4bf4d2bb55535c9c90afff717bcf046bd19af982.tar.gz
rockbox-4bf4d2bb55535c9c90afff717bcf046bd19af982.tar.bz2
rockbox-4bf4d2bb55535c9c90afff717bcf046bd19af982.zip
* Get interrupts working (but crashes after 10-30secs)
* Make current_tick increase * Convert button driver into SADC driver * Make touchscreen handling work better (still needs good calibration routine) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18240 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/system-jz4740.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/system-jz4740.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
index 6d1e68e115..e878173abd 100644
--- a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
@@ -32,9 +32,10 @@
#define NUM_GPIO 128
#define IRQ_MAX (IRQ_GPIO_0 + NUM_GPIO)
+static int irq;
static void UIRQ(void)
{
- panicf("Unhandled interrupt occurred\n");
+ panicf("Unhandled interrupt occurred: %d\n", irq);
}
#define default_interrupt(name) \
@@ -51,7 +52,6 @@ default_interrupt(SSI);
default_interrupt(CIM);
default_interrupt(AIC);
default_interrupt(ETH);
-default_interrupt(TCU3);
default_interrupt(TCU2);
default_interrupt(TCU1);
default_interrupt(TCU0);
@@ -197,11 +197,12 @@ default_interrupt(GPIO127);
static void (* const irqvector[])(void) =
{
- I2C,EMC,UHC,UART0,SADC,MSC,RTC,SSI,
- CIM,AIC,ETH,UIRQ,TCU3,TCU2,TCU1,TCU0,
- UDC,UIRQ,UIRQ,UIRQ,UIRQ,IPU,LCD,UIRQ,
- DMA0,DMA1,DMA2,DMA3,DMA4,DMA5,UIRQ,UIRQ,
- UIRQ,UIRQ,UIRQ,UIRQ,UIRQ,UIRQ,UIRQ,UIRQ,
+ I2C,EMC,UHC,UIRQ,UIRQ,UIRQ,UIRQ,UIRQ,
+ UART0,UIRQ,UIRQ,SADC,UIRQ,MSC,RTC,SSI,
+ CIM,AIC,ETH,UIRQ,TCU2,TCU1,TCU0,UDC,
+ UIRQ,UIRQ,UIRQ,UIRQ,IPU,LCD,UIRQ,DMA0,
+ DMA1,DMA2,DMA3,DMA4,DMA5,UIRQ,UIRQ,UIRQ,
+ UIRQ,UIRQ,UIRQ,UIRQ,UIRQ,UIRQ,UIRQ,
GPIO0,GPIO1,GPIO2,GPIO3,GPIO4,GPIO5,GPIO6,GPIO7,
GPIO8,GPIO9,GPIO10,GPIO11,GPIO12,GPIO13,GPIO14,GPIO15,
GPIO16,GPIO17,GPIO18,GPIO19,GPIO20,GPIO21,GPIO22,GPIO23,
@@ -223,7 +224,7 @@ static void (* const irqvector[])(void) =
static unsigned int dma_irq_mask = 0;
static unsigned int gpio_irq_mask[4] = {0};
-static void ena_irq(unsigned int irq)
+void system_enable_irq(unsigned int irq)
{
register unsigned int t;
if ((irq >= IRQ_GPIO_0) && (irq <= IRQ_GPIO_0 + NUM_GPIO))
@@ -333,7 +334,7 @@ static int get_irq_number(void)
void intr_handler(void)
{
- register int irq = get_irq_number();
+ irq = get_irq_number();
if(irq < 0)
return;
@@ -341,7 +342,6 @@ void intr_handler(void)
if(irq > 0)
irqvector[irq-1]();
- printf("Interrupt!");
return;
}
@@ -558,18 +558,11 @@ void system_main(void)
__dcache_writeback_all();
__icache_invalidate_all();
-
- //set_c0_status(1 << 22); /* Enable Boot Exception Vectors */
- /* Init interrupt handlers */
+ /* Init interrupt handling */
ipl = 0;
for(i=0;i<IRQ_MAX;i++)
- {
- if(irqvector[i] == UIRQ)
- dis_irq(i);
- else
- ena_irq(i);
- }
+ dis_irq(i);
sti();