1
0
Fork 0
forked from len0rd/rockbox

imx233: cleanup icoll and add software irq sources

Change-Id: I4cf2b0b74cf391021afaec08329ec7cf5dbd578d
This commit is contained in:
Amaury Pouly 2014-02-02 04:23:32 +01:00
parent 55877f442a
commit cefaabfe9d
2 changed files with 24 additions and 7 deletions

View file

@ -70,10 +70,14 @@ default_interrupt(INT_LCDIF_ERROR);
/* STMP3780+ specific */ /* STMP3780+ specific */
#if IMX233_SUBTARGET >= 3780 #if IMX233_SUBTARGET >= 3780
#endif #endif
default_interrupt(INT_SOFTWARE0);
default_interrupt(INT_SOFTWARE1);
default_interrupt(INT_SOFTWARE2);
default_interrupt(INT_SOFTWARE3);
typedef void (*isr_t)(void); typedef void (*isr_t)(void);
static isr_t isr_table[INT_SRC_NR_SOURCES] = static isr_t isr_table[INT_SRC_COUNT] =
{ {
[INT_SRC_USB_CTRL] = INT_USB_CTRL, [INT_SRC_USB_CTRL] = INT_USB_CTRL,
[INT_SRC_TIMER(0)] = INT_TIMER0, [INT_SRC_TIMER(0)] = INT_TIMER0,
@ -111,13 +115,17 @@ static isr_t isr_table[INT_SRC_NR_SOURCES] =
#endif #endif
#if IMX233_SUBTARGET >= 3780 #if IMX233_SUBTARGET >= 3780
#endif #endif
[INT_SRC_SOFTWARE(0)] = INT_SOFTWARE0,
[INT_SRC_SOFTWARE(1)] = INT_SOFTWARE1,
[INT_SRC_SOFTWARE(2)] = INT_SOFTWARE2,
[INT_SRC_SOFTWARE(3)] = INT_SOFTWARE3,
}; };
#define IRQ_STORM_DELAY 100 /* ms */ #define IRQ_STORM_DELAY 100 /* ms */
#define IRQ_STORM_THRESHOLD 100000 /* allows irq / delay */ #define IRQ_STORM_THRESHOLD 100000 /* allows irq / delay */
static uint32_t irq_count_old[INT_SRC_NR_SOURCES]; static uint32_t irq_count_old[INT_SRC_COUNT];
static uint32_t irq_count[INT_SRC_NR_SOURCES]; static uint32_t irq_count[INT_SRC_COUNT];
struct imx233_icoll_irq_info_t imx233_icoll_get_irq_info(int src) struct imx233_icoll_irq_info_t imx233_icoll_get_irq_info(int src)
{ {
@ -215,10 +223,10 @@ void imx233_icoll_init(void)
/* disable all interrupts */ /* disable all interrupts */
/* priority = 0, disable, disable fiq */ /* priority = 0, disable, disable fiq */
#if IMX233_SUBTARGET >= 3780 #if IMX233_SUBTARGET >= 3780
for(int i = 0; i < INT_SRC_NR_SOURCES; i++) for(int i = 0; i < INT_SRC_COUNT; i++)
HW_ICOLL_INTERRUPTn(i) = 0; HW_ICOLL_INTERRUPTn(i) = 0;
#else #else
for(int i = 0; i < INT_SRC_NR_SOURCES / 4; i++) for(int i = 0; i < INT_SRC_COUNT / 4; i++)
HW_ICOLL_PRIORITYn(i) = 0; HW_ICOLL_PRIORITYn(i) = 0;
#endif #endif
/* setup vbase as isr_table */ /* setup vbase as isr_table */
@ -226,4 +234,3 @@ void imx233_icoll_init(void)
/* enable final irq bit */ /* enable final irq bit */
BF_SET(ICOLL_CTRL, IRQ_FINAL_ENABLE); BF_SET(ICOLL_CTRL, IRQ_FINAL_ENABLE);
} }

View file

@ -44,7 +44,6 @@
#define INT_SRC_TOUCH_DETECT 36 #define INT_SRC_TOUCH_DETECT 36
#define INT_SRC_LRADC_CHx(x) (37 + (x)) #define INT_SRC_LRADC_CHx(x) (37 + (x))
#define INT_SRC_RTC_1MSEC 48 #define INT_SRC_RTC_1MSEC 48
#define INT_SRC_NR_SOURCES 64
/* STMP3700+ specific */ /* STMP3700+ specific */
#if IMX233_SUBTARGET >= 3700 #if IMX233_SUBTARGET >= 3700
#define INT_SRC_SSP2_ERROR 2 #define INT_SRC_SSP2_ERROR 2
@ -55,7 +54,18 @@
#endif #endif
/* STMP3780+ specific */ /* STMP3780+ specific */
#if IMX233_SUBTARGET >= 3780 #if IMX233_SUBTARGET >= 3780
#endif
/* Software IRQ and IRQ count*/
#if IMX233_SUBTARGET >= 3780
#define INT_SRC_SOFTWARE(x) (66 + (x))
#define INT_SRC_COUNT 128
#elif IMX233_SUBTARGET >= 3700
#define INT_SRC_SOFTWARE(x) (55 + (x))
#define INT_SRC_COUNT 64
#elif IMX233_SUBTARGET >= 3600
#define INT_SRC_SOFTWARE(x) (60 + (x))
#define INT_SRC_COUNT 64
#endif #endif
/* helpers */ /* helpers */