9 #include <linux/kernel.h>
10 #include <linux/errno.h>
18 #include <hwregs/reg_map.h>
20 #include <hwregs/intr_vect.h>
21 #include <hwregs/intr_vect_defs.h>
26 #if TIMER0_INTR_VECT - FIRST_IRQ < 32
27 #define TIMER_MASK (1 << (TIMER0_INTR_VECT - FIRST_IRQ))
30 #define TIMER_MASK (1 << (TIMER0_INTR_VECT - FIRST_IRQ - 32))
33 #ifdef CONFIG_ETRAX_KGDB
34 #if defined(CONFIG_ETRAX_KGDB_PORT0)
35 #define IGNOREMASK (1 << (SER0_INTR_VECT - FIRST_IRQ))
36 #elif defined(CONFIG_ETRAX_KGDB_PORT1)
37 #define IGNOREMASK (1 << (SER1_INTR_VECT - FIRST_IRQ))
38 #elif defined(CONFIG_ETRAX_KGB_PORT2)
39 #define IGNOREMASK (1 << (SER2_INTR_VECT - FIRST_IRQ))
40 #elif defined(CONFIG_ETRAX_KGDB_PORT3)
41 #define IGNOREMASK (1 << (SER3_INTR_VECT - FIRST_IRQ))
56 static unsigned long irq_regs[
NR_CPUS] =
100 #ifdef CONFIG_CRIS_MACH_ARTPEC3
130 #ifdef CONFIG_ETRAXFS
177 IRQ0x31_interrupt, IRQ0x32_interrupt, IRQ0x33_interrupt,
178 IRQ0x34_interrupt, IRQ0x35_interrupt, IRQ0x36_interrupt,
179 IRQ0x37_interrupt, IRQ0x38_interrupt, IRQ0x39_interrupt,
180 IRQ0x3a_interrupt, IRQ0x3b_interrupt, IRQ0x3c_interrupt,
181 IRQ0x3d_interrupt, IRQ0x3e_interrupt, IRQ0x3f_interrupt,
182 IRQ0x40_interrupt, IRQ0x41_interrupt, IRQ0x42_interrupt,
183 IRQ0x43_interrupt, IRQ0x44_interrupt, IRQ0x45_interrupt,
184 IRQ0x46_interrupt, IRQ0x47_interrupt, IRQ0x48_interrupt,
185 IRQ0x49_interrupt, IRQ0x4a_interrupt, IRQ0x4b_interrupt,
186 IRQ0x4c_interrupt, IRQ0x4d_interrupt, IRQ0x4e_interrupt,
187 IRQ0x4f_interrupt, IRQ0x50_interrupt,
189 IRQ0x51_interrupt, IRQ0x52_interrupt, IRQ0x53_interrupt,
190 IRQ0x54_interrupt, IRQ0x55_interrupt, IRQ0x56_interrupt,
191 IRQ0x57_interrupt, IRQ0x58_interrupt, IRQ0x59_interrupt,
192 IRQ0x5a_interrupt, IRQ0x5b_interrupt, IRQ0x5c_interrupt,
193 IRQ0x5d_interrupt, IRQ0x5e_interrupt, IRQ0x5f_interrupt,
194 IRQ0x60_interrupt, IRQ0x61_interrupt, IRQ0x62_interrupt,
195 IRQ0x63_interrupt, IRQ0x64_interrupt, IRQ0x65_interrupt,
196 IRQ0x66_interrupt, IRQ0x67_interrupt, IRQ0x68_interrupt,
197 IRQ0x69_interrupt, IRQ0x6a_interrupt, IRQ0x6b_interrupt,
198 IRQ0x6c_interrupt, IRQ0x6d_interrupt, IRQ0x6e_interrupt,
199 IRQ0x6f_interrupt, IRQ0x70_interrupt,
220 intr_mask &= ~(1 << (irq -
FIRST_IRQ - 32));
224 spin_unlock_irqrestore(&
irq_lock, flags);
244 intr_mask |= (1 << (irq -
FIRST_IRQ - 32));
248 spin_unlock_irqrestore(&
irq_lock, flags);
252 static int irq_cpu(
int irq)
263 spin_unlock_irqrestore(&
irq_lock, flags);
273 cpu = cpumask_first(&irq_allocations[irq -
FIRST_IRQ].mask);
276 spin_unlock_irqrestore(&
irq_lock, flags);
284 for (cpu = 0; cpu <
NR_CPUS; cpu++)
304 static int set_affinity_crisv32_irq(
struct irq_data *
data,
311 spin_unlock_irqrestore(&
irq_lock, flags);
315 static struct irq_chip crisv32_irq_type = {
317 .irq_shutdown = disable_crisv32_irq,
318 .irq_enable = enable_crisv32_irq,
319 .irq_disable = disable_crisv32_irq,
320 .irq_set_affinity = set_affinity_crisv32_irq,
390 if ((i == 0) && (masked[0] & TIMER_MASK))
398 if ((i == 1) && (masked[i] & TIMER_MASK)) {
399 masked[
i] &= ~TIMER_MASK;
403 if ((i == 0) && (masked[i] & TIMER_MASK)) {
404 masked[
i] &= ~TIMER_MASK;
412 masked[0] &= ~IGNORE_MASK;
417 for (bit = 0; bit < 32; bit++) {
418 if (masked[i] & (1 << bit))
449 for (i = 0; i < 256; i++)
454 irq_set_chip_and_handler(j, &crisv32_irq_type,
495 #ifdef CONFIG_ETRAX_KGDB