summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/imx233/debug-imx233.c3
-rw-r--r--firmware/target/arm/imx233/icoll-imx233.c29
-rw-r--r--firmware/target/arm/imx233/icoll-imx233.h7
3 files changed, 38 insertions, 1 deletions
diff --git a/firmware/target/arm/imx233/debug-imx233.c b/firmware/target/arm/imx233/debug-imx233.c
index d5d4d08b9a..1069c9ceaa 100644
--- a/firmware/target/arm/imx233/debug-imx233.c
+++ b/firmware/target/arm/imx233/debug-imx233.c
@@ -518,7 +518,8 @@ bool dbg_hw_info_icoll(void)
518 for(int i = first_irq, j = 0; i < dbg_irqs_count && j < line_count; i++, j++) 518 for(int i = first_irq, j = 0; i < dbg_irqs_count && j < line_count; i++, j++)
519 { 519 {
520 struct imx233_icoll_irq_info_t info = imx233_icoll_get_irq_info(dbg_irqs[i].src); 520 struct imx233_icoll_irq_info_t info = imx233_icoll_get_irq_info(dbg_irqs[i].src);
521 lcd_putsf(0, j, "%s", dbg_irqs[i].name); 521 static char prio[4] = {'-', '+', '^', '!'};
522 lcd_putsf(0, j, "%c%s", prio[info.priority & 3], dbg_irqs[i].name);
522 if(info.enabled || info.freq > 0) 523 if(info.enabled || info.freq > 0)
523 lcd_putsf(10, j, "%d", info.freq); 524 lcd_putsf(10, j, "%d", info.freq);
524 } 525 }
diff --git a/firmware/target/arm/imx233/icoll-imx233.c b/firmware/target/arm/imx233/icoll-imx233.c
index b753af8d54..cd96b6fae6 100644
--- a/firmware/target/arm/imx233/icoll-imx233.c
+++ b/firmware/target/arm/imx233/icoll-imx233.c
@@ -127,6 +127,11 @@ struct imx233_icoll_irq_info_t imx233_icoll_get_irq_info(int src)
127#else 127#else
128 info.enabled = BF_RDn(ICOLL_INTERRUPTn, src, ENABLE); 128 info.enabled = BF_RDn(ICOLL_INTERRUPTn, src, ENABLE);
129#endif 129#endif
130#if IMX233_SUBTARGET < 3780
131 info.priority = BF_RDn(ICOLL_PRIORITYn, src / 4, PRIORITYx(src % 4));
132#else
133 info.priority = BF_RDn(ICOLL_INTERRUPTn, src, PRIORITY);
134#endif
130 info.freq = irq_count_old[src]; 135 info.freq = irq_count_old[src];
131 return info; 136 return info;
132} 137}
@@ -165,6 +170,21 @@ void fiq_handler(void)
165{ 170{
166} 171}
167 172
173void imx233_icoll_force_irq(unsigned src, bool enable)
174{
175#if IMX233_SUBTARGET < 3780
176 if(enable)
177 BF_SETn(ICOLL_PRIORITYn, src / 4, SOFTIRQx(src % 4));
178 else
179 BF_CLRn(ICOLL_PRIORITYn, src / 4, SOFTIRQx(src % 4));
180#else
181 if(enable)
182 BF_SETn(ICOLL_INTERRUPTn, src, SOFTIRQ);
183 else
184 BF_CLRn(ICOLL_INTERRUPTn, src, SOFTIRQ);
185#endif
186}
187
168void imx233_icoll_enable_interrupt(int src, bool enable) 188void imx233_icoll_enable_interrupt(int src, bool enable)
169{ 189{
170#if IMX233_SUBTARGET < 3780 190#if IMX233_SUBTARGET < 3780
@@ -180,6 +200,15 @@ void imx233_icoll_enable_interrupt(int src, bool enable)
180#endif 200#endif
181} 201}
182 202
203void imx233_icoll_set_priority(int src, unsigned prio)
204{
205#if IMX233_SUBTARGET < 3780
206 BF_WRn(ICOLL_PRIORITYn, src / 4, PRIORITYx(src % 4), prio);
207#else
208 BF_WRn(ICOLL_INTERRUPTn, src, PRIORITY, prio);
209#endif
210}
211
183void imx233_icoll_init(void) 212void imx233_icoll_init(void)
184{ 213{
185 imx233_reset_block(&HW_ICOLL_CTRL); 214 imx233_reset_block(&HW_ICOLL_CTRL);
diff --git a/firmware/target/arm/imx233/icoll-imx233.h b/firmware/target/arm/imx233/icoll-imx233.h
index 81d7695ec5..cf87305e11 100644
--- a/firmware/target/arm/imx233/icoll-imx233.h
+++ b/firmware/target/arm/imx233/icoll-imx233.h
@@ -62,16 +62,23 @@
62#if IMX233_SUBTARGET >= 3600 && IMX233_SUBTARGET < 3780 62#if IMX233_SUBTARGET >= 3600 && IMX233_SUBTARGET < 3780
63#define BP_ICOLL_PRIORITYn_ENABLEx(x) (2 + 8 * (x)) 63#define BP_ICOLL_PRIORITYn_ENABLEx(x) (2 + 8 * (x))
64#define BM_ICOLL_PRIORITYn_ENABLEx(x) (1 << (2 + 8 * (x))) 64#define BM_ICOLL_PRIORITYn_ENABLEx(x) (1 << (2 + 8 * (x)))
65#define BP_ICOLL_PRIORITYn_PRIORITYx(x) (0 + 8 * (x))
66#define BM_ICOLL_PRIORITYn_PRIORITYx(x) (3 << (0 + 8 * (x)))
67#define BP_ICOLL_PRIORITYn_SOFTIRQx(x) (3 + 8 * (x))
68#define BM_ICOLL_PRIORITYn_SOFTIRQx(x) (1 << (3 + 8 * (x)))
65#endif 69#endif
66 70
67struct imx233_icoll_irq_info_t 71struct imx233_icoll_irq_info_t
68{ 72{
69 bool enabled; 73 bool enabled;
70 unsigned freq; 74 unsigned freq;
75 unsigned priority;
71}; 76};
72 77
73void imx233_icoll_init(void); 78void imx233_icoll_init(void);
74void imx233_icoll_enable_interrupt(int src, bool enable); 79void imx233_icoll_enable_interrupt(int src, bool enable);
80void imx233_icoll_set_priority(int src, unsigned prio);
75struct imx233_icoll_irq_info_t imx233_icoll_get_irq_info(int src); 81struct imx233_icoll_irq_info_t imx233_icoll_get_irq_info(int src);
82void imx233_icoll_force_irq(unsigned src, bool enable);
76 83
77#endif /* ICOLL_IMX233_H */ 84#endif /* ICOLL_IMX233_H */