summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-02-02 04:23:32 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2014-02-10 23:14:24 +0100
commitcefaabfe9d284e3eaa049819be0c06ac6c37a29b (patch)
tree2e3d7aa512b25c370be1f818acf399e38ecf81bd /firmware
parent55877f442a6b2fd29af8f35c64ea59c42442927e (diff)
downloadrockbox-cefaabfe9d284e3eaa049819be0c06ac6c37a29b.tar.gz
rockbox-cefaabfe9d284e3eaa049819be0c06ac6c37a29b.zip
imx233: cleanup icoll and add software irq sources
Change-Id: I4cf2b0b74cf391021afaec08329ec7cf5dbd578d
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/imx233/icoll-imx233.c19
-rw-r--r--firmware/target/arm/imx233/icoll-imx233.h12
2 files changed, 24 insertions, 7 deletions
diff --git a/firmware/target/arm/imx233/icoll-imx233.c b/firmware/target/arm/imx233/icoll-imx233.c
index cd96b6fae6..1c8774ad80 100644
--- a/firmware/target/arm/imx233/icoll-imx233.c
+++ b/firmware/target/arm/imx233/icoll-imx233.c
@@ -70,10 +70,14 @@ default_interrupt(INT_LCDIF_ERROR);
70/* STMP3780+ specific */ 70/* STMP3780+ specific */
71#if IMX233_SUBTARGET >= 3780 71#if IMX233_SUBTARGET >= 3780
72#endif 72#endif
73default_interrupt(INT_SOFTWARE0);
74default_interrupt(INT_SOFTWARE1);
75default_interrupt(INT_SOFTWARE2);
76default_interrupt(INT_SOFTWARE3);
73 77
74typedef void (*isr_t)(void); 78typedef void (*isr_t)(void);
75 79
76static isr_t isr_table[INT_SRC_NR_SOURCES] = 80static isr_t isr_table[INT_SRC_COUNT] =
77{ 81{
78 [INT_SRC_USB_CTRL] = INT_USB_CTRL, 82 [INT_SRC_USB_CTRL] = INT_USB_CTRL,
79 [INT_SRC_TIMER(0)] = INT_TIMER0, 83 [INT_SRC_TIMER(0)] = INT_TIMER0,
@@ -111,13 +115,17 @@ static isr_t isr_table[INT_SRC_NR_SOURCES] =
111#endif 115#endif
112#if IMX233_SUBTARGET >= 3780 116#if IMX233_SUBTARGET >= 3780
113#endif 117#endif
118 [INT_SRC_SOFTWARE(0)] = INT_SOFTWARE0,
119 [INT_SRC_SOFTWARE(1)] = INT_SOFTWARE1,
120 [INT_SRC_SOFTWARE(2)] = INT_SOFTWARE2,
121 [INT_SRC_SOFTWARE(3)] = INT_SOFTWARE3,
114}; 122};
115 123
116#define IRQ_STORM_DELAY 100 /* ms */ 124#define IRQ_STORM_DELAY 100 /* ms */
117#define IRQ_STORM_THRESHOLD 100000 /* allows irq / delay */ 125#define IRQ_STORM_THRESHOLD 100000 /* allows irq / delay */
118 126
119static uint32_t irq_count_old[INT_SRC_NR_SOURCES]; 127static uint32_t irq_count_old[INT_SRC_COUNT];
120static uint32_t irq_count[INT_SRC_NR_SOURCES]; 128static uint32_t irq_count[INT_SRC_COUNT];
121 129
122struct imx233_icoll_irq_info_t imx233_icoll_get_irq_info(int src) 130struct imx233_icoll_irq_info_t imx233_icoll_get_irq_info(int src)
123{ 131{
@@ -215,10 +223,10 @@ void imx233_icoll_init(void)
215 /* disable all interrupts */ 223 /* disable all interrupts */
216 /* priority = 0, disable, disable fiq */ 224 /* priority = 0, disable, disable fiq */
217#if IMX233_SUBTARGET >= 3780 225#if IMX233_SUBTARGET >= 3780
218 for(int i = 0; i < INT_SRC_NR_SOURCES; i++) 226 for(int i = 0; i < INT_SRC_COUNT; i++)
219 HW_ICOLL_INTERRUPTn(i) = 0; 227 HW_ICOLL_INTERRUPTn(i) = 0;
220#else 228#else
221 for(int i = 0; i < INT_SRC_NR_SOURCES / 4; i++) 229 for(int i = 0; i < INT_SRC_COUNT / 4; i++)
222 HW_ICOLL_PRIORITYn(i) = 0; 230 HW_ICOLL_PRIORITYn(i) = 0;
223#endif 231#endif
224 /* setup vbase as isr_table */ 232 /* setup vbase as isr_table */
@@ -226,4 +234,3 @@ void imx233_icoll_init(void)
226 /* enable final irq bit */ 234 /* enable final irq bit */
227 BF_SET(ICOLL_CTRL, IRQ_FINAL_ENABLE); 235 BF_SET(ICOLL_CTRL, IRQ_FINAL_ENABLE);
228} 236}
229
diff --git a/firmware/target/arm/imx233/icoll-imx233.h b/firmware/target/arm/imx233/icoll-imx233.h
index cf87305e11..2de2693ae4 100644
--- a/firmware/target/arm/imx233/icoll-imx233.h
+++ b/firmware/target/arm/imx233/icoll-imx233.h
@@ -44,7 +44,6 @@
44#define INT_SRC_TOUCH_DETECT 36 44#define INT_SRC_TOUCH_DETECT 36
45#define INT_SRC_LRADC_CHx(x) (37 + (x)) 45#define INT_SRC_LRADC_CHx(x) (37 + (x))
46#define INT_SRC_RTC_1MSEC 48 46#define INT_SRC_RTC_1MSEC 48
47#define INT_SRC_NR_SOURCES 64
48/* STMP3700+ specific */ 47/* STMP3700+ specific */
49#if IMX233_SUBTARGET >= 3700 48#if IMX233_SUBTARGET >= 3700
50#define INT_SRC_SSP2_ERROR 2 49#define INT_SRC_SSP2_ERROR 2
@@ -55,7 +54,18 @@
55#endif 54#endif
56/* STMP3780+ specific */ 55/* STMP3780+ specific */
57#if IMX233_SUBTARGET >= 3780 56#if IMX233_SUBTARGET >= 3780
57#endif
58 58
59/* Software IRQ and IRQ count*/
60#if IMX233_SUBTARGET >= 3780
61#define INT_SRC_SOFTWARE(x) (66 + (x))
62#define INT_SRC_COUNT 128
63#elif IMX233_SUBTARGET >= 3700
64#define INT_SRC_SOFTWARE(x) (55 + (x))
65#define INT_SRC_COUNT 64
66#elif IMX233_SUBTARGET >= 3600
67#define INT_SRC_SOFTWARE(x) (60 + (x))
68#define INT_SRC_COUNT 64
59#endif 69#endif
60 70
61/* helpers */ 71/* helpers */