summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/export/rk27xx.h33
-rw-r--r--firmware/target/arm/rk27xx/kernel-rk27xx.c4
-rw-r--r--firmware/target/arm/rk27xx/pcm-rk27xx.c8
-rw-r--r--firmware/target/arm/rk27xx/sd-rk27xx.c4
-rw-r--r--firmware/target/arm/rk27xx/timer-rk27xx.c8
-rw-r--r--firmware/target/arm/rk27xx/usb-drv-rk27xx.c4
6 files changed, 49 insertions, 12 deletions
diff --git a/firmware/export/rk27xx.h b/firmware/export/rk27xx.h
index 6f5859f6f8..58b3fe8166 100644
--- a/firmware/export/rk27xx.h
+++ b/firmware/export/rk27xx.h
@@ -489,6 +489,39 @@
#define INTC_ICCR (*(volatile unsigned long *)(AHB0_INTC + 0x118))
#define INTC_ISCR (*(volatile unsigned long *)(AHB0_INTC + 0x11C))
+#define IRQ_ARM_UART0 (1<<0)
+#define IRQ_ARM_UART1 (1<<1)
+#define IRQ_ARM_TIMER0 (1<<2)
+#define IRQ_ARM_TIMER1 (1<<3)
+#define IRQ_ARM_TIMER2 (1<<4)
+#define IRQ_ARM_GPIO0 (1<<5)
+#define IRQ_ARM_SW (1<<6)
+#define IRQ_ARM_MAILBOX (1<<7)
+#define IRQ_ARM_RTC (1<<8)
+#define IRQ_ARM_SCU (1<<9)
+#define IRQ_ARM_SD (1<<10)
+#define IRQ_ARM_SPI (1<<11)
+#define IRQ_ARM_HDMA (1<<12)
+#define IRQ_ARM_A2A (1<<13)
+#define IRQ_ARM_I2C (1<<14)
+#define IRQ_ARM_I2S (1<<15)
+#define IRQ_ARM_UDC (1<<16)
+#define IRQ_ARM_UHC (1<<17)
+#define IRQ_ARM_PWM0 (1<<18)
+#define IRQ_ARM_PWM1 (1<<19)
+#define IRQ_ARM_PWM2 (1<<20)
+#define IRQ_ARM_PWM3 (1<<21)
+#define IRQ_ARM_ADC (1<<22)
+#define IRQ_ARM_GPIO1 (1<<23)
+#define IRQ_ARM_VIP (1<<24)
+#define IRQ_ARM_DWDMA (1<<25)
+#define IRQ_ARM_NANDC (1<<26)
+#define IRQ_ARM_LCDC (1<<27)
+#define IRQ_ARM_DSP (1<<28)
+#define IRQ_ARM_SW1 (1<<29)
+#define IRQ_ARM_SW2 (1<<30)
+#define IRQ_ARM_SW3 (1<<31)
+
#define INTC_TEST (*(volatile unsigned long *)(AHB0_INTC + 0x124))
/* Bus arbiter module */
diff --git a/firmware/target/arm/rk27xx/kernel-rk27xx.c b/firmware/target/arm/rk27xx/kernel-rk27xx.c
index 26911c0ad6..012cc9acc7 100644
--- a/firmware/target/arm/rk27xx/kernel-rk27xx.c
+++ b/firmware/target/arm/rk27xx/kernel-rk27xx.c
@@ -46,9 +46,9 @@ void tick_start(unsigned int interval_in_ms)
TMR0CON = (1<<8) | (1<<7) | (1<<1); /* periodic, 1/1, interrupt enable */
/* unmask timer0 interrupt */
- INTC_IMR |= 0x04;
+ INTC_IMR |= IRQ_ARM_TIMER0;
/* enable timer0 interrupt */
- INTC_IECR |= 0x04;
+ INTC_IECR |= IRQ_ARM_TIMER0;
}
diff --git a/firmware/target/arm/rk27xx/pcm-rk27xx.c b/firmware/target/arm/rk27xx/pcm-rk27xx.c
index 56c191a0d6..a4ce568a83 100644
--- a/firmware/target/arm/rk27xx/pcm-rk27xx.c
+++ b/firmware/target/arm/rk27xx/pcm-rk27xx.c
@@ -35,7 +35,7 @@ void pcm_play_lock(void)
if (++locked == 1)
{
int old = disable_irq_save();
- INTC_IMR &= ~(1<<12); /* mask HDMA interrupt */
+ INTC_IMR &= ~IRQ_ARM_HDMA; /* mask HDMA interrupt */
restore_irq(old);
}
}
@@ -46,7 +46,7 @@ void pcm_play_unlock(void)
if(--locked == 0)
{
int old = disable_irq_save();
- INTC_IMR |= (1<<12); /* unmask HDMA interrupt */
+ INTC_IMR |= IRQ_ARM_HDMA; /* unmask HDMA interrupt */
restore_irq(old);
}
}
@@ -241,8 +241,8 @@ static void set_codec_freq(unsigned int freq)
void pcm_play_dma_init(void)
{
/* unmask HDMA interrupt in INTC */
- INTC_IMR |= (1<<12);
- INTC_IECR |= (1<<12);
+ INTC_IMR |= IRQ_ARM_HDMA;
+ INTC_IECR |= IRQ_ARM_HDMA;
audiohw_preinit();
diff --git a/firmware/target/arm/rk27xx/sd-rk27xx.c b/firmware/target/arm/rk27xx/sd-rk27xx.c
index cb5c02e0b6..d6a3b11a50 100644
--- a/firmware/target/arm/rk27xx/sd-rk27xx.c
+++ b/firmware/target/arm/rk27xx/sd-rk27xx.c
@@ -402,8 +402,8 @@ static void init_controller(void)
/* enable and unmask SD interrupts in interrupt controller */
SCU_CLKCFG &= ~CLKCFG_SD;
- INTC_IMR |= (1<<10);
- INTC_IECR |= (1<<10);
+ INTC_IMR |= IRQ_ARM_SD;
+ INTC_IECR |= IRQ_ARM_SD;
SD_CTRL = SD_PWR_CPU | SD_DETECT_MECH | SD_CLOCK_EN | 0x7D;
SD_INT = CMD_RES_INT_EN | DATA_XFER_INT_EN;
diff --git a/firmware/target/arm/rk27xx/timer-rk27xx.c b/firmware/target/arm/rk27xx/timer-rk27xx.c
index 4493ccdfa9..116f169e2d 100644
--- a/firmware/target/arm/rk27xx/timer-rk27xx.c
+++ b/firmware/target/arm/rk27xx/timer-rk27xx.c
@@ -52,10 +52,10 @@ bool timer_set(long cycles, bool start)
TMR1CON = (1<<7) | (1<<1); /* periodic, 1/1 */
/* unmask timer1 interrupt */
- INTC_IMR |= (1<<3);
+ INTC_IMR |= IRQ_ARM_TIMER1;
/* enable timer1 interrupt */
- INTC_IECR |= (1<<3);
+ INTC_IECR |= IRQ_ARM_TIMER1;
return true;
}
@@ -70,5 +70,9 @@ bool timer_start(void)
void timer_stop(void)
{
TMR1CON &= ~(1 << 8); /* timer1 disable */
+
+ /* disable timer1 interrupt */
+ INTC_IMR &= ~IRQ_ARM_TIMER1;
+ INTC_IECR &= ~IRQ_ARM_TIMER1;
}
diff --git a/firmware/target/arm/rk27xx/usb-drv-rk27xx.c b/firmware/target/arm/rk27xx/usb-drv-rk27xx.c
index 9fdfe64f62..e60bef584f 100644
--- a/firmware/target/arm/rk27xx/usb-drv-rk27xx.c
+++ b/firmware/target/arm/rk27xx/usb-drv-rk27xx.c
@@ -715,8 +715,8 @@ void usb_drv_exit(void)
DEV_CTL = DEV_SELF_PWR;
/* disable USB interrupts in interrupt controller */
- INTC_IMR &= ~(1<<16);
- INTC_IECR &= ~(1<<16);
+ INTC_IMR &= ~IRQ_ARM_UDC;
+ INTC_IECR &= ~IRQ_ARM_UDC;
/* we cannot disable UDC clock since this causes data abort
* when reading DEV_INFO in order to check usb connect event