rk27xx: substitute magic constants with meaningful names for INTC
Change-Id: Ic93114db351a9940a53d0c1df6439d82ada044e1
This commit is contained in:
parent
15818bef55
commit
efe1042759
6 changed files with 49 additions and 12 deletions
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue