summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/avic-imx31.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-05-06 03:23:51 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-05-06 03:23:51 +0000
commita36a498c577ae5c9daa8487c8440df46d325bab3 (patch)
treeba8a35620ee10da2a7e1d6e6ed9234f0f35647d9 /firmware/target/arm/imx31/avic-imx31.c
parent8fd3ec97271001d0b50d4404f5891c9a4e77d960 (diff)
downloadrockbox-a36a498c577ae5c9daa8487c8440df46d325bab3.tar.gz
rockbox-a36a498c577ae5c9daa8487c8440df46d325bab3.zip
i.MX31/Gigabeat S: This should fix stability problems. One problem was to start using the DVFS controller properly so that interrupts will be masked at the lowest and highest frequency indexes. Millions of useless interrupts were occurring at 132MHz because its index was 2, not 3, which masks it automatically when it can't go slower. Stopping the flood was enough to actually see the difference in general. IRQ must be disabled when fiddling with the CCM registers and only enabled when waiting for voltage ramp as having them enables also causes spurious DVFS ints. Implement interruptible ISR pro/epilogue more safely (always using IRQ stack even in SVC mode handling). Fix an improper inequality in DVFS code (which set regs for down when going up and v.v.). Misc. support changes. Have internal tables take less RAM.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25837 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/avic-imx31.c')
-rw-r--r--firmware/target/arm/imx31/avic-imx31.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/firmware/target/arm/imx31/avic-imx31.c b/firmware/target/arm/imx31/avic-imx31.c
index 51ba14d0b3..e349c97d82 100644
--- a/firmware/target/arm/imx31/avic-imx31.c
+++ b/firmware/target/arm/imx31/avic-imx31.c
@@ -119,8 +119,10 @@ void avic_init(void)
119 for (i = 0; i < 8; i++) 119 for (i = 0; i < 8; i++)
120 avic->nipriority[i] = 0; 120 avic->nipriority[i] = 0;
121 121
122 /* Set NM bit to enable VIC */ 122 /* Set NM bit to enable VIC. Mask fast interrupts. Core arbiter rise
123 avic->intcntl |= AVIC_INTCNTL_NM; 123 * for normal interrupts (for lowest latency). */
124 avic->intcntl |= AVIC_INTCNTL_NM | AVIC_INTCNTL_FIDIS |
125 AVIC_INTCNTL_NIAD;
124 126
125 /* Enable VE bit in CP15 Control reg to enable VIC */ 127 /* Enable VE bit in CP15 Control reg to enable VIC */
126 asm volatile ( 128 asm volatile (
@@ -213,7 +215,12 @@ void avic_set_int_type(enum IMX31_INT_LIST ints, enum INT_TYPE intstype)
213 restore_interrupt(oldstatus); 215 restore_interrupt(oldstatus);
214} 216}
215 217
216void avic_set_ni_level(unsigned int level) 218void avic_set_ni_level(int level)
217{ 219{
218 AVIC_NIMASK = level > 0x1f ? 0x1f : level; 220 if (level < 0)
221 level = 0x1f; /* -1 */
222 else if (level > 15)
223 level = 15;
224
225 AVIC_NIMASK = level;
219} 226}