diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2011-04-21 16:50:52 -0400 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2011-11-08 16:35:49 -0500 |
commit | 4936f63cb790e265eb30a1e1630bb90bd6af0e7a (patch) | |
tree | 9cd5da60334940b4d6b190a10262f02823b06aa5 /arch/m68k/kernel | |
parent | 5a2394534b160ce18f9a705cf9de40e77648f8a2 (diff) |
m68k/irq: Add genirq support
Disabled on all platforms for now
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
[v1] Acked-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/m68k/kernel')
-rw-r--r-- | arch/m68k/kernel/Makefile | 9 | ||||
-rw-r--r-- | arch/m68k/kernel/ints.c | 52 |
2 files changed, 58 insertions, 3 deletions
diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile index e7f0f2e5ad44..141425785c4e 100644 --- a/arch/m68k/kernel/Makefile +++ b/arch/m68k/kernel/Makefile | |||
@@ -9,13 +9,18 @@ extra-y += vmlinux.lds | |||
9 | obj-y := entry.o m68k_ksyms.o module.o process.o ptrace.o setup.o signal.o \ | 9 | obj-y := entry.o m68k_ksyms.o module.o process.o ptrace.o setup.o signal.o \ |
10 | sys_m68k.o syscalltable.o time.o traps.o | 10 | sys_m68k.o syscalltable.o time.o traps.o |
11 | 11 | ||
12 | obj-$(CONFIG_MMU) += ints.o devres.o vectors.o | 12 | obj-$(CONFIG_MMU) += ints.o vectors.o |
13 | devres-$(CONFIG_MMU) = ../../../kernel/irq/devres.o | 13 | devres-$(CONFIG_MMU) = ../../../kernel/irq/devres.o |
14 | 14 | ||
15 | ifndef CONFIG_MMU_SUN3 | 15 | ifndef CONFIG_MMU_SUN3 |
16 | obj-y += dma.o | 16 | obj-y += dma.o |
17 | endif | 17 | endif |
18 | ifndef CONFIG_MMU | 18 | ifndef CONFIG_MMU |
19 | obj-y += init_task.o irq.o | 19 | obj-y += init_task.o |
20 | endif | ||
21 | ifdef CONFIG_GENERIC_HARDIRQS | ||
22 | obj-y += irq.o | ||
23 | else | ||
24 | obj-y += devres.o | ||
20 | endif | 25 | endif |
21 | 26 | ||
diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c index f6a469865125..cea439f9819b 100644 --- a/arch/m68k/kernel/ints.c +++ b/arch/m68k/kernel/ints.c | |||
@@ -31,6 +31,7 @@ extern u32 auto_irqhandler_fixup[]; | |||
31 | extern u32 user_irqhandler_fixup[]; | 31 | extern u32 user_irqhandler_fixup[]; |
32 | extern u16 user_irqvec_fixup[]; | 32 | extern u16 user_irqvec_fixup[]; |
33 | 33 | ||
34 | #ifndef CONFIG_GENERIC_HARDIRQS | ||
34 | /* table for system interrupt handlers */ | 35 | /* table for system interrupt handlers */ |
35 | static struct irq_data *irq_list[NR_IRQS]; | 36 | static struct irq_data *irq_list[NR_IRQS]; |
36 | static struct irq_chip *irq_chip[NR_IRQS]; | 37 | static struct irq_chip *irq_chip[NR_IRQS]; |
@@ -41,6 +42,8 @@ static inline int irq_set_chip(unsigned int irq, struct irq_chip *chip) | |||
41 | irq_chip[irq] = chip; | 42 | irq_chip[irq] = chip; |
42 | return 0; | 43 | return 0; |
43 | } | 44 | } |
45 | #define irq_set_chip_and_handler(irq, chip, dummy) irq_set_chip(irq, chip) | ||
46 | #endif /* !CONFIG_GENERIC_HARDIRQS */ | ||
44 | 47 | ||
45 | static int m68k_first_user_vec; | 48 | static int m68k_first_user_vec; |
46 | 49 | ||
@@ -56,8 +59,10 @@ static struct irq_chip user_irq_chip = { | |||
56 | .irq_shutdown = m68k_irq_shutdown, | 59 | .irq_shutdown = m68k_irq_shutdown, |
57 | }; | 60 | }; |
58 | 61 | ||
62 | #ifndef CONFIG_GENERIC_HARDIRQS | ||
59 | #define NUM_IRQ_NODES 100 | 63 | #define NUM_IRQ_NODES 100 |
60 | static struct irq_data nodes[NUM_IRQ_NODES]; | 64 | static struct irq_data nodes[NUM_IRQ_NODES]; |
65 | #endif /* !CONFIG_GENERIC_HARDIRQS */ | ||
61 | 66 | ||
62 | /* | 67 | /* |
63 | * void init_IRQ(void) | 68 | * void init_IRQ(void) |
@@ -81,7 +86,7 @@ void __init init_IRQ(void) | |||
81 | } | 86 | } |
82 | 87 | ||
83 | for (i = IRQ_AUTO_1; i <= IRQ_AUTO_7; i++) | 88 | for (i = IRQ_AUTO_1; i <= IRQ_AUTO_7; i++) |
84 | irq_set_chip(i, &auto_irq_chip); | 89 | irq_set_chip_and_handler(i, &auto_irq_chip, handle_simple_irq); |
85 | 90 | ||
86 | mach_init_IRQ(); | 91 | mach_init_IRQ(); |
87 | } | 92 | } |
@@ -128,6 +133,35 @@ void __init m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, | |||
128 | flush_icache(); | 133 | flush_icache(); |
129 | } | 134 | } |
130 | 135 | ||
136 | #ifdef CONFIG_GENERIC_HARDIRQS | ||
137 | |||
138 | /** | ||
139 | * m68k_setup_irq_controller | ||
140 | * @chip: irq chip which controls specified irq | ||
141 | * @handle: flow handler which handles specified irq | ||
142 | * @irq: first irq to be managed by the controller | ||
143 | * @cnt: number of irqs to be managed by the controller | ||
144 | * | ||
145 | * Change the controller for the specified range of irq, which will be used to | ||
146 | * manage these irq. auto/user irq already have a default controller, which can | ||
147 | * be changed as well, but the controller probably should use m68k_irq_startup/ | ||
148 | * m68k_irq_shutdown. | ||
149 | */ | ||
150 | void m68k_setup_irq_controller(struct irq_chip *chip, | ||
151 | irq_flow_handler_t handle, unsigned int irq, | ||
152 | unsigned int cnt) | ||
153 | { | ||
154 | int i; | ||
155 | |||
156 | for (i = 0; i < cnt; i++) { | ||
157 | irq_set_chip(irq + i, chip); | ||
158 | if (handle) | ||
159 | irq_set_handler(irq + i, handle); | ||
160 | } | ||
161 | } | ||
162 | |||
163 | #else /* !CONFIG_GENERIC_HARDIRQS */ | ||
164 | |||
131 | /** | 165 | /** |
132 | * m68k_setup_irq_chip | 166 | * m68k_setup_irq_chip |
133 | * @contr: irq controller which controls specified irq | 167 | * @contr: irq controller which controls specified irq |
@@ -316,6 +350,8 @@ void disable_irq_nosync(unsigned int irq) __attribute__((alias("disable_irq"))); | |||
316 | 350 | ||
317 | EXPORT_SYMBOL(disable_irq_nosync); | 351 | EXPORT_SYMBOL(disable_irq_nosync); |
318 | 352 | ||
353 | #endif /* !CONFIG_GENERIC_HARDIRQS */ | ||
354 | |||
319 | unsigned int m68k_irq_startup_irq(unsigned int irq) | 355 | unsigned int m68k_irq_startup_irq(unsigned int irq) |
320 | { | 356 | { |
321 | if (irq <= IRQ_AUTO_7) | 357 | if (irq <= IRQ_AUTO_7) |
@@ -341,6 +377,8 @@ void m68k_irq_shutdown(struct irq_data *data) | |||
341 | } | 377 | } |
342 | 378 | ||
343 | 379 | ||
380 | #ifndef CONFIG_GENERIC_HARDIRQS | ||
381 | |||
344 | /* | 382 | /* |
345 | * Do we need these probe functions on the m68k? | 383 | * Do we need these probe functions on the m68k? |
346 | * | 384 | * |
@@ -367,6 +405,7 @@ int probe_irq_off (unsigned long irqs) | |||
367 | } | 405 | } |
368 | 406 | ||
369 | EXPORT_SYMBOL(probe_irq_off); | 407 | EXPORT_SYMBOL(probe_irq_off); |
408 | #endif /* CONFIG_GENERIC_HARDIRQS */ | ||
370 | 409 | ||
371 | unsigned int irq_canonicalize(unsigned int irq) | 410 | unsigned int irq_canonicalize(unsigned int irq) |
372 | { | 411 | { |
@@ -379,6 +418,7 @@ unsigned int irq_canonicalize(unsigned int irq) | |||
379 | 418 | ||
380 | EXPORT_SYMBOL(irq_canonicalize); | 419 | EXPORT_SYMBOL(irq_canonicalize); |
381 | 420 | ||
421 | #ifndef CONFIG_GENERIC_HARDIRQS | ||
382 | void generic_handle_irq(unsigned int irq) | 422 | void generic_handle_irq(unsigned int irq) |
383 | { | 423 | { |
384 | struct irq_data *node; | 424 | struct irq_data *node; |
@@ -428,3 +468,13 @@ void init_irq_proc(void) | |||
428 | /* Insert /proc/irq driver here */ | 468 | /* Insert /proc/irq driver here */ |
429 | } | 469 | } |
430 | #endif | 470 | #endif |
471 | |||
472 | #else /* CONFIG_GENERIC_HARDIRQS */ | ||
473 | |||
474 | asmlinkage void handle_badint(struct pt_regs *regs) | ||
475 | { | ||
476 | atomic_inc(&irq_err_count); | ||
477 | pr_warn("unexpected interrupt from %u\n", regs->vector); | ||
478 | } | ||
479 | |||
480 | #endif /* CONFIG_GENERIC_HARDIRQS */ | ||