diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-04-22 17:15:00 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-05-22 14:19:09 -0400 |
commit | 80fcdb959343ab9e0ee95c11b5ea47c44a2c3004 (patch) | |
tree | 16d44c1fb014d3b9856d65c7bd8966d35a3719b2 /arch/blackfin | |
parent | 11cabcb95e0d9de15f3d8a9d25336edfc5444337 (diff) |
Blackfin: SIC: cut down on IAR MMR reads a bit
Tweak the for loops that operate on the SIC IAR system MMRs to avoid
re-reading them multiple times in a row. System MMRs are a little
slower to access, so avoid the penalty when possible.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/mach-common/ints-priority.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index ce988713445..1c8c4c7245c 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c | |||
@@ -92,26 +92,29 @@ static void __init search_IAR(void) | |||
92 | { | 92 | { |
93 | unsigned ivg, irq_pos = 0; | 93 | unsigned ivg, irq_pos = 0; |
94 | for (ivg = 0; ivg <= IVG13 - IVG7; ivg++) { | 94 | for (ivg = 0; ivg <= IVG13 - IVG7; ivg++) { |
95 | int irqn; | 95 | int irqN; |
96 | 96 | ||
97 | ivg7_13[ivg].istop = ivg7_13[ivg].ifirst = &ivg_table[irq_pos]; | 97 | ivg7_13[ivg].istop = ivg7_13[ivg].ifirst = &ivg_table[irq_pos]; |
98 | 98 | ||
99 | for (irqn = 0; irqn < NR_PERI_INTS; irqn++) { | 99 | for (irqN = 0; irqN < NR_PERI_INTS; irqN += 4) { |
100 | int iar_shift = (irqn & 7) * 4; | 100 | int irqn; |
101 | if (ivg == (0xf & | 101 | u32 iar = bfin_read32((unsigned long *)SIC_IAR0 + |
102 | #if defined(CONFIG_BF52x) || defined(CONFIG_BF538) \ | 102 | #if defined(CONFIG_BF51x) || defined(CONFIG_BF52x) || \ |
103 | || defined(CONFIG_BF539) || defined(CONFIG_BF51x) | 103 | defined(CONFIG_BF538) || defined(CONFIG_BF539) |
104 | bfin_read32((unsigned long *)SIC_IAR0 + | 104 | ((irqN % 32) >> 3) + ((irqN / 32) * ((SIC_IAR4 - SIC_IAR0) / 4)) |
105 | ((irqn % 32) >> 3) + ((irqn / 32) * | ||
106 | ((SIC_IAR4 - SIC_IAR0) / 4))) >> iar_shift)) { | ||
107 | #else | 105 | #else |
108 | bfin_read32((unsigned long *)SIC_IAR0 + | 106 | (irqN >> 3) |
109 | (irqn >> 3)) >> iar_shift)) { | ||
110 | #endif | 107 | #endif |
111 | ivg_table[irq_pos].irqno = IVG7 + irqn; | 108 | ); |
112 | ivg_table[irq_pos].isrflag = 1 << (irqn % 32); | 109 | |
113 | ivg7_13[ivg].istop++; | 110 | for (irqn = irqN; irqn < irqN + 4; ++irqn) { |
114 | irq_pos++; | 111 | int iar_shift = (irqn & 7) * 4; |
112 | if (ivg == (0xf & (iar >> iar_shift))) { | ||
113 | ivg_table[irq_pos].irqno = IVG7 + irqn; | ||
114 | ivg_table[irq_pos].isrflag = 1 << (irqn % 32); | ||
115 | ivg7_13[ivg].istop++; | ||
116 | irq_pos++; | ||
117 | } | ||
115 | } | 118 | } |
116 | } | 119 | } |
117 | } | 120 | } |