diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2014-02-02 04:20:41 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2014-02-10 23:14:24 +0100 |
commit | 0ba4c3b0787eb349458b0187623bc260d3789ebc (patch) | |
tree | e39d75cd87da2921423bd1c3f15c619ff5af07f1 /firmware | |
parent | ab5dfd55aaa37da65a4168d0dc46f9a3a7d8844a (diff) | |
download | rockbox-0ba4c3b0787eb349458b0187623bc260d3789ebc.tar.gz rockbox-0ba4c3b0787eb349458b0187623bc260d3789ebc.zip |
imx233: enhance icoll with priority and soft IRQ
Change-Id: If9568ab6e11bf933b2cc607e5a86866a975886bc
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/imx233/debug-imx233.c | 3 | ||||
-rw-r--r-- | firmware/target/arm/imx233/icoll-imx233.c | 29 | ||||
-rw-r--r-- | firmware/target/arm/imx233/icoll-imx233.h | 7 |
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 | ||
173 | void 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 | |||
168 | void imx233_icoll_enable_interrupt(int src, bool enable) | 188 | void 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 | ||
203 | void 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 | |||
183 | void imx233_icoll_init(void) | 212 | void 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 | ||
67 | struct imx233_icoll_irq_info_t | 71 | struct 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 | ||
73 | void imx233_icoll_init(void); | 78 | void imx233_icoll_init(void); |
74 | void imx233_icoll_enable_interrupt(int src, bool enable); | 79 | void imx233_icoll_enable_interrupt(int src, bool enable); |
80 | void imx233_icoll_set_priority(int src, unsigned prio); | ||
75 | struct imx233_icoll_irq_info_t imx233_icoll_get_irq_info(int src); | 81 | struct imx233_icoll_irq_info_t imx233_icoll_get_irq_info(int src); |
82 | void imx233_icoll_force_irq(unsigned src, bool enable); | ||
76 | 83 | ||
77 | #endif /* ICOLL_IMX233_H */ | 84 | #endif /* ICOLL_IMX233_H */ |