diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2006-06-25 08:47:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:00:58 -0400 |
commit | 200a3d352cd5e0ae8fb96bfcf8103f7b7c60645b (patch) | |
tree | e9db90ac38cbfba0f4a4c541733fc4ebd09c5fd7 | |
parent | ebba61d5b05ecfda388dd4c156bafdb78d398055 (diff) |
[PATCH] m68k: convert VME irq code
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/m68k/bvme6000/Makefile | 2 | ||||
-rw-r--r-- | arch/m68k/bvme6000/bvmeints.c | 161 | ||||
-rw-r--r-- | arch/m68k/bvme6000/config.c | 21 | ||||
-rw-r--r-- | arch/m68k/mvme147/147ints.c | 146 | ||||
-rw-r--r-- | arch/m68k/mvme147/Makefile | 2 | ||||
-rw-r--r-- | arch/m68k/mvme147/config.c | 22 | ||||
-rw-r--r-- | arch/m68k/mvme16x/16xints.c | 150 | ||||
-rw-r--r-- | arch/m68k/mvme16x/Makefile | 2 | ||||
-rw-r--r-- | arch/m68k/mvme16x/config.c | 23 | ||||
-rw-r--r-- | include/asm-m68k/bvme6000hw.h | 30 | ||||
-rw-r--r-- | include/asm-m68k/mvme147hw.h | 44 | ||||
-rw-r--r-- | include/asm-m68k/mvme16xhw.h | 40 |
12 files changed, 88 insertions, 555 deletions
diff --git a/arch/m68k/bvme6000/Makefile b/arch/m68k/bvme6000/Makefile index 2348e6ceed1e..d8174004fe2f 100644 --- a/arch/m68k/bvme6000/Makefile +++ b/arch/m68k/bvme6000/Makefile | |||
@@ -2,4 +2,4 @@ | |||
2 | # Makefile for Linux arch/m68k/bvme6000 source directory | 2 | # Makefile for Linux arch/m68k/bvme6000 source directory |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := config.o bvmeints.o rtc.o | 5 | obj-y := config.o rtc.o |
diff --git a/arch/m68k/bvme6000/bvmeints.c b/arch/m68k/bvme6000/bvmeints.c deleted file mode 100644 index b015fdc1b0cb..000000000000 --- a/arch/m68k/bvme6000/bvmeints.c +++ /dev/null | |||
@@ -1,161 +0,0 @@ | |||
1 | /* | ||
2 | * arch/m68k/bvme6000/bvmeints.c | ||
3 | * | ||
4 | * Copyright (C) 1997 Richard Hirst [richard@sleepie.demon.co.uk] | ||
5 | * | ||
6 | * based on amiints.c -- Amiga Linux interrupt handling code | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file README.legal in the main directory of this archive | ||
10 | * for more details. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/errno.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/seq_file.h> | ||
19 | |||
20 | #include <asm/ptrace.h> | ||
21 | #include <asm/system.h> | ||
22 | #include <asm/irq.h> | ||
23 | #include <asm/traps.h> | ||
24 | |||
25 | static irqreturn_t bvme6000_defhand (int irq, void *dev_id, struct pt_regs *fp); | ||
26 | |||
27 | /* | ||
28 | * This should ideally be 4 elements only, for speed. | ||
29 | */ | ||
30 | |||
31 | static struct { | ||
32 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | ||
33 | unsigned long flags; | ||
34 | void *dev_id; | ||
35 | const char *devname; | ||
36 | unsigned count; | ||
37 | } irq_tab[256]; | ||
38 | |||
39 | /* | ||
40 | * void bvme6000_init_IRQ (void) | ||
41 | * | ||
42 | * Parameters: None | ||
43 | * | ||
44 | * Returns: Nothing | ||
45 | * | ||
46 | * This function is called during kernel startup to initialize | ||
47 | * the bvme6000 IRQ handling routines. | ||
48 | */ | ||
49 | |||
50 | void bvme6000_init_IRQ (void) | ||
51 | { | ||
52 | int i; | ||
53 | |||
54 | for (i = 0; i < 256; i++) { | ||
55 | irq_tab[i].handler = bvme6000_defhand; | ||
56 | irq_tab[i].flags = IRQ_FLG_STD; | ||
57 | irq_tab[i].dev_id = NULL; | ||
58 | irq_tab[i].devname = NULL; | ||
59 | irq_tab[i].count = 0; | ||
60 | } | ||
61 | } | ||
62 | |||
63 | int bvme6000_request_irq(unsigned int irq, | ||
64 | irqreturn_t (*handler)(int, void *, struct pt_regs *), | ||
65 | unsigned long flags, const char *devname, void *dev_id) | ||
66 | { | ||
67 | if (irq > 255) { | ||
68 | printk("%s: Incorrect IRQ %d from %s\n", __FUNCTION__, irq, devname); | ||
69 | return -ENXIO; | ||
70 | } | ||
71 | #if 0 | ||
72 | /* Nothing special about auto-vectored devices for the BVME6000, | ||
73 | * but treat it specially to avoid changes elsewhere. | ||
74 | */ | ||
75 | |||
76 | if (irq >= VEC_INT1 && irq <= VEC_INT7) | ||
77 | return cpu_request_irq(irq - VEC_SPUR, handler, flags, | ||
78 | devname, dev_id); | ||
79 | #endif | ||
80 | if (!(irq_tab[irq].flags & IRQ_FLG_STD)) { | ||
81 | if (irq_tab[irq].flags & IRQ_FLG_LOCK) { | ||
82 | printk("%s: IRQ %d from %s is not replaceable\n", | ||
83 | __FUNCTION__, irq, irq_tab[irq].devname); | ||
84 | return -EBUSY; | ||
85 | } | ||
86 | if (flags & IRQ_FLG_REPLACE) { | ||
87 | printk("%s: %s can't replace IRQ %d from %s\n", | ||
88 | __FUNCTION__, devname, irq, irq_tab[irq].devname); | ||
89 | return -EBUSY; | ||
90 | } | ||
91 | } | ||
92 | irq_tab[irq].handler = handler; | ||
93 | irq_tab[irq].flags = flags; | ||
94 | irq_tab[irq].dev_id = dev_id; | ||
95 | irq_tab[irq].devname = devname; | ||
96 | return 0; | ||
97 | } | ||
98 | |||
99 | void bvme6000_free_irq(unsigned int irq, void *dev_id) | ||
100 | { | ||
101 | if (irq > 255) { | ||
102 | printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq); | ||
103 | return; | ||
104 | } | ||
105 | #if 0 | ||
106 | if (irq >= VEC_INT1 && irq <= VEC_INT7) { | ||
107 | cpu_free_irq(irq - VEC_SPUR, dev_id); | ||
108 | return; | ||
109 | } | ||
110 | #endif | ||
111 | if (irq_tab[irq].dev_id != dev_id) | ||
112 | printk("%s: Removing probably wrong IRQ %d from %s\n", | ||
113 | __FUNCTION__, irq, irq_tab[irq].devname); | ||
114 | |||
115 | irq_tab[irq].handler = bvme6000_defhand; | ||
116 | irq_tab[irq].flags = IRQ_FLG_STD; | ||
117 | irq_tab[irq].dev_id = NULL; | ||
118 | irq_tab[irq].devname = NULL; | ||
119 | } | ||
120 | |||
121 | irqreturn_t bvme6000_process_int (unsigned long vec, struct pt_regs *fp) | ||
122 | { | ||
123 | if (vec > 255) { | ||
124 | printk ("bvme6000_process_int: Illegal vector %ld", vec); | ||
125 | return IRQ_NONE; | ||
126 | } else { | ||
127 | irq_tab[vec].count++; | ||
128 | irq_tab[vec].handler(vec, irq_tab[vec].dev_id, fp); | ||
129 | return IRQ_HANDLED; | ||
130 | } | ||
131 | } | ||
132 | |||
133 | int show_bvme6000_interrupts(struct seq_file *p, void *v) | ||
134 | { | ||
135 | int i; | ||
136 | |||
137 | for (i = 0; i < 256; i++) { | ||
138 | if (irq_tab[i].count) | ||
139 | seq_printf(p, "Vec 0x%02x: %8d %s\n", | ||
140 | i, irq_tab[i].count, | ||
141 | irq_tab[i].devname ? irq_tab[i].devname : "free"); | ||
142 | } | ||
143 | return 0; | ||
144 | } | ||
145 | |||
146 | |||
147 | static irqreturn_t bvme6000_defhand (int irq, void *dev_id, struct pt_regs *fp) | ||
148 | { | ||
149 | printk ("Unknown interrupt 0x%02x\n", irq); | ||
150 | return IRQ_NONE; | ||
151 | } | ||
152 | |||
153 | void bvme6000_enable_irq (unsigned int irq) | ||
154 | { | ||
155 | } | ||
156 | |||
157 | |||
158 | void bvme6000_disable_irq (unsigned int irq) | ||
159 | { | ||
160 | } | ||
161 | |||
diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c index c90cb5fcc8ef..d1e916ae55a8 100644 --- a/arch/m68k/bvme6000/config.c +++ b/arch/m68k/bvme6000/config.c | |||
@@ -36,15 +36,8 @@ | |||
36 | #include <asm/machdep.h> | 36 | #include <asm/machdep.h> |
37 | #include <asm/bvme6000hw.h> | 37 | #include <asm/bvme6000hw.h> |
38 | 38 | ||
39 | extern irqreturn_t bvme6000_process_int (int level, struct pt_regs *regs); | ||
40 | extern void bvme6000_init_IRQ (void); | ||
41 | extern void bvme6000_free_irq (unsigned int, void *); | ||
42 | extern int show_bvme6000_interrupts(struct seq_file *, void *); | ||
43 | extern void bvme6000_enable_irq (unsigned int); | ||
44 | extern void bvme6000_disable_irq (unsigned int); | ||
45 | static void bvme6000_get_model(char *model); | 39 | static void bvme6000_get_model(char *model); |
46 | static int bvme6000_get_hardware_list(char *buffer); | 40 | static int bvme6000_get_hardware_list(char *buffer); |
47 | extern int bvme6000_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id); | ||
48 | extern void bvme6000_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); | 41 | extern void bvme6000_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); |
49 | extern unsigned long bvme6000_gettimeoffset (void); | 42 | extern unsigned long bvme6000_gettimeoffset (void); |
50 | extern int bvme6000_hwclk (int, struct rtc_time *); | 43 | extern int bvme6000_hwclk (int, struct rtc_time *); |
@@ -100,6 +93,14 @@ static int bvme6000_get_hardware_list(char *buffer) | |||
100 | return 0; | 93 | return 0; |
101 | } | 94 | } |
102 | 95 | ||
96 | /* | ||
97 | * This function is called during kernel startup to initialize | ||
98 | * the bvme6000 IRQ handling routines. | ||
99 | */ | ||
100 | static void bvme6000_init_IRQ(void) | ||
101 | { | ||
102 | m68k_setup_user_interrupt(VEC_USER, 192, NULL); | ||
103 | } | ||
103 | 104 | ||
104 | void __init config_bvme6000(void) | 105 | void __init config_bvme6000(void) |
105 | { | 106 | { |
@@ -127,12 +128,6 @@ void __init config_bvme6000(void) | |||
127 | mach_hwclk = bvme6000_hwclk; | 128 | mach_hwclk = bvme6000_hwclk; |
128 | mach_set_clock_mmss = bvme6000_set_clock_mmss; | 129 | mach_set_clock_mmss = bvme6000_set_clock_mmss; |
129 | mach_reset = bvme6000_reset; | 130 | mach_reset = bvme6000_reset; |
130 | mach_free_irq = bvme6000_free_irq; | ||
131 | mach_process_int = bvme6000_process_int; | ||
132 | mach_get_irq_list = show_bvme6000_interrupts; | ||
133 | mach_request_irq = bvme6000_request_irq; | ||
134 | enable_irq = bvme6000_enable_irq; | ||
135 | disable_irq = bvme6000_disable_irq; | ||
136 | mach_get_model = bvme6000_get_model; | 131 | mach_get_model = bvme6000_get_model; |
137 | mach_get_hardware_list = bvme6000_get_hardware_list; | 132 | mach_get_hardware_list = bvme6000_get_hardware_list; |
138 | 133 | ||
diff --git a/arch/m68k/mvme147/147ints.c b/arch/m68k/mvme147/147ints.c deleted file mode 100644 index b4aa5e8f44ea..000000000000 --- a/arch/m68k/mvme147/147ints.c +++ /dev/null | |||
@@ -1,146 +0,0 @@ | |||
1 | /* | ||
2 | * arch/m68k/mvme147/147ints.c | ||
3 | * | ||
4 | * Copyright (C) 1997 Richard Hirst [richard@sleepie.demon.co.uk] | ||
5 | * | ||
6 | * based on amiints.c -- Amiga Linux interrupt handling code | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file README.legal in the main directory of this archive | ||
10 | * for more details. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/errno.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/seq_file.h> | ||
19 | |||
20 | #include <asm/ptrace.h> | ||
21 | #include <asm/system.h> | ||
22 | #include <asm/irq.h> | ||
23 | #include <asm/traps.h> | ||
24 | |||
25 | static irqreturn_t mvme147_defhand (int irq, void *dev_id, struct pt_regs *fp); | ||
26 | |||
27 | /* | ||
28 | * This should ideally be 4 elements only, for speed. | ||
29 | */ | ||
30 | |||
31 | static struct { | ||
32 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | ||
33 | unsigned long flags; | ||
34 | void *dev_id; | ||
35 | const char *devname; | ||
36 | unsigned count; | ||
37 | } irq_tab[256]; | ||
38 | |||
39 | /* | ||
40 | * void mvme147_init_IRQ (void) | ||
41 | * | ||
42 | * Parameters: None | ||
43 | * | ||
44 | * Returns: Nothing | ||
45 | * | ||
46 | * This function is called during kernel startup to initialize | ||
47 | * the mvme147 IRQ handling routines. | ||
48 | */ | ||
49 | |||
50 | void mvme147_init_IRQ (void) | ||
51 | { | ||
52 | int i; | ||
53 | |||
54 | for (i = 0; i < 256; i++) { | ||
55 | irq_tab[i].handler = mvme147_defhand; | ||
56 | irq_tab[i].flags = IRQ_FLG_STD; | ||
57 | irq_tab[i].dev_id = NULL; | ||
58 | irq_tab[i].devname = NULL; | ||
59 | irq_tab[i].count = 0; | ||
60 | } | ||
61 | } | ||
62 | |||
63 | int mvme147_request_irq(unsigned int irq, | ||
64 | irqreturn_t (*handler)(int, void *, struct pt_regs *), | ||
65 | unsigned long flags, const char *devname, void *dev_id) | ||
66 | { | ||
67 | if (irq > 255) { | ||
68 | printk("%s: Incorrect IRQ %d from %s\n", __FUNCTION__, irq, devname); | ||
69 | return -ENXIO; | ||
70 | } | ||
71 | if (!(irq_tab[irq].flags & IRQ_FLG_STD)) { | ||
72 | if (irq_tab[irq].flags & IRQ_FLG_LOCK) { | ||
73 | printk("%s: IRQ %d from %s is not replaceable\n", | ||
74 | __FUNCTION__, irq, irq_tab[irq].devname); | ||
75 | return -EBUSY; | ||
76 | } | ||
77 | if (flags & IRQ_FLG_REPLACE) { | ||
78 | printk("%s: %s can't replace IRQ %d from %s\n", | ||
79 | __FUNCTION__, devname, irq, irq_tab[irq].devname); | ||
80 | return -EBUSY; | ||
81 | } | ||
82 | } | ||
83 | irq_tab[irq].handler = handler; | ||
84 | irq_tab[irq].flags = flags; | ||
85 | irq_tab[irq].dev_id = dev_id; | ||
86 | irq_tab[irq].devname = devname; | ||
87 | return 0; | ||
88 | } | ||
89 | |||
90 | void mvme147_free_irq(unsigned int irq, void *dev_id) | ||
91 | { | ||
92 | if (irq > 255) { | ||
93 | printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq); | ||
94 | return; | ||
95 | } | ||
96 | if (irq_tab[irq].dev_id != dev_id) | ||
97 | printk("%s: Removing probably wrong IRQ %d from %s\n", | ||
98 | __FUNCTION__, irq, irq_tab[irq].devname); | ||
99 | |||
100 | irq_tab[irq].handler = mvme147_defhand; | ||
101 | irq_tab[irq].flags = IRQ_FLG_STD; | ||
102 | irq_tab[irq].dev_id = NULL; | ||
103 | irq_tab[irq].devname = NULL; | ||
104 | } | ||
105 | |||
106 | irqreturn_t mvme147_process_int (unsigned long vec, struct pt_regs *fp) | ||
107 | { | ||
108 | if (vec > 255) { | ||
109 | printk ("mvme147_process_int: Illegal vector %ld\n", vec); | ||
110 | return IRQ_NONE; | ||
111 | } else { | ||
112 | irq_tab[vec].count++; | ||
113 | irq_tab[vec].handler(vec, irq_tab[vec].dev_id, fp); | ||
114 | return IRQ_HANDLED; | ||
115 | } | ||
116 | } | ||
117 | |||
118 | int show_mvme147_interrupts (struct seq_file *p, void *v) | ||
119 | { | ||
120 | int i; | ||
121 | |||
122 | for (i = 0; i < 256; i++) { | ||
123 | if (irq_tab[i].count) | ||
124 | seq_printf(p, "Vec 0x%02x: %8d %s\n", | ||
125 | i, irq_tab[i].count, | ||
126 | irq_tab[i].devname ? irq_tab[i].devname : "free"); | ||
127 | } | ||
128 | return 0; | ||
129 | } | ||
130 | |||
131 | |||
132 | static irqreturn_t mvme147_defhand (int irq, void *dev_id, struct pt_regs *fp) | ||
133 | { | ||
134 | printk ("Unknown interrupt 0x%02x\n", irq); | ||
135 | return IRQ_NONE; | ||
136 | } | ||
137 | |||
138 | void mvme147_enable_irq (unsigned int irq) | ||
139 | { | ||
140 | } | ||
141 | |||
142 | |||
143 | void mvme147_disable_irq (unsigned int irq) | ||
144 | { | ||
145 | } | ||
146 | |||
diff --git a/arch/m68k/mvme147/Makefile b/arch/m68k/mvme147/Makefile index f0153ed3efa5..a36d38dbfbbc 100644 --- a/arch/m68k/mvme147/Makefile +++ b/arch/m68k/mvme147/Makefile | |||
@@ -2,4 +2,4 @@ | |||
2 | # Makefile for Linux arch/m68k/mvme147 source directory | 2 | # Makefile for Linux arch/m68k/mvme147 source directory |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := config.o 147ints.o | 5 | obj-y := config.o |
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c index 0fcf9720c2fe..0cd0e5bddcee 100644 --- a/arch/m68k/mvme147/config.c +++ b/arch/m68k/mvme147/config.c | |||
@@ -36,15 +36,8 @@ | |||
36 | #include <asm/mvme147hw.h> | 36 | #include <asm/mvme147hw.h> |
37 | 37 | ||
38 | 38 | ||
39 | extern irqreturn_t mvme147_process_int (int level, struct pt_regs *regs); | ||
40 | extern void mvme147_init_IRQ (void); | ||
41 | extern void mvme147_free_irq (unsigned int, void *); | ||
42 | extern int show_mvme147_interrupts (struct seq_file *, void *); | ||
43 | extern void mvme147_enable_irq (unsigned int); | ||
44 | extern void mvme147_disable_irq (unsigned int); | ||
45 | static void mvme147_get_model(char *model); | 39 | static void mvme147_get_model(char *model); |
46 | static int mvme147_get_hardware_list(char *buffer); | 40 | static int mvme147_get_hardware_list(char *buffer); |
47 | extern int mvme147_request_irq (unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id); | ||
48 | extern void mvme147_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); | 41 | extern void mvme147_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); |
49 | extern unsigned long mvme147_gettimeoffset (void); | 42 | extern unsigned long mvme147_gettimeoffset (void); |
50 | extern int mvme147_hwclk (int, struct rtc_time *); | 43 | extern int mvme147_hwclk (int, struct rtc_time *); |
@@ -91,6 +84,15 @@ static int mvme147_get_hardware_list(char *buffer) | |||
91 | return 0; | 84 | return 0; |
92 | } | 85 | } |
93 | 86 | ||
87 | /* | ||
88 | * This function is called during kernel startup to initialize | ||
89 | * the mvme147 IRQ handling routines. | ||
90 | */ | ||
91 | |||
92 | void mvme147_init_IRQ(void) | ||
93 | { | ||
94 | m68k_setup_user_interrupt(VEC_USER, 192, NULL); | ||
95 | } | ||
94 | 96 | ||
95 | void __init config_mvme147(void) | 97 | void __init config_mvme147(void) |
96 | { | 98 | { |
@@ -101,12 +103,6 @@ void __init config_mvme147(void) | |||
101 | mach_hwclk = mvme147_hwclk; | 103 | mach_hwclk = mvme147_hwclk; |
102 | mach_set_clock_mmss = mvme147_set_clock_mmss; | 104 | mach_set_clock_mmss = mvme147_set_clock_mmss; |
103 | mach_reset = mvme147_reset; | 105 | mach_reset = mvme147_reset; |
104 | mach_free_irq = mvme147_free_irq; | ||
105 | mach_process_int = mvme147_process_int; | ||
106 | mach_get_irq_list = show_mvme147_interrupts; | ||
107 | mach_request_irq = mvme147_request_irq; | ||
108 | enable_irq = mvme147_enable_irq; | ||
109 | disable_irq = mvme147_disable_irq; | ||
110 | mach_get_model = mvme147_get_model; | 106 | mach_get_model = mvme147_get_model; |
111 | mach_get_hardware_list = mvme147_get_hardware_list; | 107 | mach_get_hardware_list = mvme147_get_hardware_list; |
112 | 108 | ||
diff --git a/arch/m68k/mvme16x/16xints.c b/arch/m68k/mvme16x/16xints.c deleted file mode 100644 index 81afada90dd2..000000000000 --- a/arch/m68k/mvme16x/16xints.c +++ /dev/null | |||
@@ -1,150 +0,0 @@ | |||
1 | /* | ||
2 | * arch/m68k/mvme16x/16xints.c | ||
3 | * | ||
4 | * Copyright (C) 1995 Richard Hirst [richard@sleepie.demon.co.uk] | ||
5 | * | ||
6 | * based on amiints.c -- Amiga Linux interrupt handling code | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file README.legal in the main directory of this archive | ||
10 | * for more details. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/errno.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/seq_file.h> | ||
19 | |||
20 | #include <asm/system.h> | ||
21 | #include <asm/ptrace.h> | ||
22 | #include <asm/irq.h> | ||
23 | |||
24 | static irqreturn_t mvme16x_defhand (int irq, void *dev_id, struct pt_regs *fp); | ||
25 | |||
26 | /* | ||
27 | * This should ideally be 4 elements only, for speed. | ||
28 | */ | ||
29 | |||
30 | static struct { | ||
31 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | ||
32 | unsigned long flags; | ||
33 | void *dev_id; | ||
34 | const char *devname; | ||
35 | unsigned count; | ||
36 | } irq_tab[192]; | ||
37 | |||
38 | /* | ||
39 | * void mvme16x_init_IRQ (void) | ||
40 | * | ||
41 | * Parameters: None | ||
42 | * | ||
43 | * Returns: Nothing | ||
44 | * | ||
45 | * This function is called during kernel startup to initialize | ||
46 | * the mvme16x IRQ handling routines. Should probably ensure | ||
47 | * that the base vectors for the VMEChip2 and PCCChip2 are valid. | ||
48 | */ | ||
49 | |||
50 | void mvme16x_init_IRQ (void) | ||
51 | { | ||
52 | int i; | ||
53 | |||
54 | for (i = 0; i < 192; i++) { | ||
55 | irq_tab[i].handler = mvme16x_defhand; | ||
56 | irq_tab[i].flags = IRQ_FLG_STD; | ||
57 | irq_tab[i].dev_id = NULL; | ||
58 | irq_tab[i].devname = NULL; | ||
59 | irq_tab[i].count = 0; | ||
60 | } | ||
61 | } | ||
62 | |||
63 | int mvme16x_request_irq(unsigned int irq, | ||
64 | irqreturn_t (*handler)(int, void *, struct pt_regs *), | ||
65 | unsigned long flags, const char *devname, void *dev_id) | ||
66 | { | ||
67 | if (irq < 64 || irq > 255) { | ||
68 | printk("%s: Incorrect IRQ %d from %s\n", __FUNCTION__, irq, devname); | ||
69 | return -ENXIO; | ||
70 | } | ||
71 | |||
72 | if (!(irq_tab[irq-64].flags & IRQ_FLG_STD)) { | ||
73 | if (irq_tab[irq-64].flags & IRQ_FLG_LOCK) { | ||
74 | printk("%s: IRQ %d from %s is not replaceable\n", | ||
75 | __FUNCTION__, irq, irq_tab[irq-64].devname); | ||
76 | return -EBUSY; | ||
77 | } | ||
78 | if (flags & IRQ_FLG_REPLACE) { | ||
79 | printk("%s: %s can't replace IRQ %d from %s\n", | ||
80 | __FUNCTION__, devname, irq, irq_tab[irq-64].devname); | ||
81 | return -EBUSY; | ||
82 | } | ||
83 | } | ||
84 | irq_tab[irq-64].handler = handler; | ||
85 | irq_tab[irq-64].flags = flags; | ||
86 | irq_tab[irq-64].dev_id = dev_id; | ||
87 | irq_tab[irq-64].devname = devname; | ||
88 | return 0; | ||
89 | } | ||
90 | |||
91 | void mvme16x_free_irq(unsigned int irq, void *dev_id) | ||
92 | { | ||
93 | if (irq < 64 || irq > 255) { | ||
94 | printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq); | ||
95 | return; | ||
96 | } | ||
97 | |||
98 | if (irq_tab[irq-64].dev_id != dev_id) | ||
99 | printk("%s: Removing probably wrong IRQ %d from %s\n", | ||
100 | __FUNCTION__, irq, irq_tab[irq-64].devname); | ||
101 | |||
102 | irq_tab[irq-64].handler = mvme16x_defhand; | ||
103 | irq_tab[irq-64].flags = IRQ_FLG_STD; | ||
104 | irq_tab[irq-64].dev_id = NULL; | ||
105 | irq_tab[irq-64].devname = NULL; | ||
106 | } | ||
107 | |||
108 | irqreturn_t mvme16x_process_int (unsigned long vec, struct pt_regs *fp) | ||
109 | { | ||
110 | if (vec < 64 || vec > 255) { | ||
111 | printk ("mvme16x_process_int: Illegal vector %ld", vec); | ||
112 | return IRQ_NONE; | ||
113 | } else { | ||
114 | irq_tab[vec-64].count++; | ||
115 | irq_tab[vec-64].handler(vec, irq_tab[vec-64].dev_id, fp); | ||
116 | return IRQ_HANDLED; | ||
117 | } | ||
118 | } | ||
119 | |||
120 | int show_mvme16x_interrupts (struct seq_file *p, void *v) | ||
121 | { | ||
122 | int i; | ||
123 | |||
124 | for (i = 0; i < 192; i++) { | ||
125 | if (irq_tab[i].count) | ||
126 | seq_printf(p, "Vec 0x%02x: %8d %s\n", | ||
127 | i+64, irq_tab[i].count, | ||
128 | irq_tab[i].devname ? irq_tab[i].devname : "free"); | ||
129 | } | ||
130 | return 0; | ||
131 | } | ||
132 | |||
133 | |||
134 | static irqreturn_t mvme16x_defhand (int irq, void *dev_id, struct pt_regs *fp) | ||
135 | { | ||
136 | printk ("Unknown interrupt 0x%02x\n", irq); | ||
137 | return IRQ_NONE; | ||
138 | } | ||
139 | |||
140 | |||
141 | void mvme16x_enable_irq (unsigned int irq) | ||
142 | { | ||
143 | } | ||
144 | |||
145 | |||
146 | void mvme16x_disable_irq (unsigned int irq) | ||
147 | { | ||
148 | } | ||
149 | |||
150 | |||
diff --git a/arch/m68k/mvme16x/Makefile b/arch/m68k/mvme16x/Makefile index 5129f56b64a3..950e82f21640 100644 --- a/arch/m68k/mvme16x/Makefile +++ b/arch/m68k/mvme16x/Makefile | |||
@@ -2,4 +2,4 @@ | |||
2 | # Makefile for Linux arch/m68k/mvme16x source directory | 2 | # Makefile for Linux arch/m68k/mvme16x source directory |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := config.o 16xints.o rtc.o mvme16x_ksyms.o | 5 | obj-y := config.o rtc.o mvme16x_ksyms.o |
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index 26ce81c1337d..ce2727ed1bc0 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c | |||
@@ -40,15 +40,8 @@ extern t_bdid mvme_bdid; | |||
40 | 40 | ||
41 | static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; | 41 | static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; |
42 | 42 | ||
43 | extern irqreturn_t mvme16x_process_int (int level, struct pt_regs *regs); | ||
44 | extern void mvme16x_init_IRQ (void); | ||
45 | extern void mvme16x_free_irq (unsigned int, void *); | ||
46 | extern int show_mvme16x_interrupts (struct seq_file *, void *); | ||
47 | extern void mvme16x_enable_irq (unsigned int); | ||
48 | extern void mvme16x_disable_irq (unsigned int); | ||
49 | static void mvme16x_get_model(char *model); | 43 | static void mvme16x_get_model(char *model); |
50 | static int mvme16x_get_hardware_list(char *buffer); | 44 | static int mvme16x_get_hardware_list(char *buffer); |
51 | extern int mvme16x_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id); | ||
52 | extern void mvme16x_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); | 45 | extern void mvme16x_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); |
53 | extern unsigned long mvme16x_gettimeoffset (void); | 46 | extern unsigned long mvme16x_gettimeoffset (void); |
54 | extern int mvme16x_hwclk (int, struct rtc_time *); | 47 | extern int mvme16x_hwclk (int, struct rtc_time *); |
@@ -120,6 +113,16 @@ static int mvme16x_get_hardware_list(char *buffer) | |||
120 | return (len); | 113 | return (len); |
121 | } | 114 | } |
122 | 115 | ||
116 | /* | ||
117 | * This function is called during kernel startup to initialize | ||
118 | * the mvme16x IRQ handling routines. Should probably ensure | ||
119 | * that the base vectors for the VMEChip2 and PCCChip2 are valid. | ||
120 | */ | ||
121 | |||
122 | static void mvme16x_init_IRQ (void) | ||
123 | { | ||
124 | m68k_setup_user_interrupt(VEC_USER, 192, NULL); | ||
125 | } | ||
123 | 126 | ||
124 | #define pcc2chip ((volatile u_char *)0xfff42000) | 127 | #define pcc2chip ((volatile u_char *)0xfff42000) |
125 | #define PccSCCMICR 0x1d | 128 | #define PccSCCMICR 0x1d |
@@ -138,12 +141,6 @@ void __init config_mvme16x(void) | |||
138 | mach_hwclk = mvme16x_hwclk; | 141 | mach_hwclk = mvme16x_hwclk; |
139 | mach_set_clock_mmss = mvme16x_set_clock_mmss; | 142 | mach_set_clock_mmss = mvme16x_set_clock_mmss; |
140 | mach_reset = mvme16x_reset; | 143 | mach_reset = mvme16x_reset; |
141 | mach_free_irq = mvme16x_free_irq; | ||
142 | mach_process_int = mvme16x_process_int; | ||
143 | mach_get_irq_list = show_mvme16x_interrupts; | ||
144 | mach_request_irq = mvme16x_request_irq; | ||
145 | enable_irq = mvme16x_enable_irq; | ||
146 | disable_irq = mvme16x_disable_irq; | ||
147 | mach_get_model = mvme16x_get_model; | 144 | mach_get_model = mvme16x_get_model; |
148 | mach_get_hardware_list = mvme16x_get_hardware_list; | 145 | mach_get_hardware_list = mvme16x_get_hardware_list; |
149 | 146 | ||
diff --git a/include/asm-m68k/bvme6000hw.h b/include/asm-m68k/bvme6000hw.h index 28a859b03959..f40d2f8510ee 100644 --- a/include/asm-m68k/bvme6000hw.h +++ b/include/asm-m68k/bvme6000hw.h | |||
@@ -109,23 +109,23 @@ typedef struct { | |||
109 | 109 | ||
110 | #define BVME_IRQ_TYPE_PRIO 0 | 110 | #define BVME_IRQ_TYPE_PRIO 0 |
111 | 111 | ||
112 | #define BVME_IRQ_PRN 0x54 | 112 | #define BVME_IRQ_PRN (IRQ_USER+20) |
113 | #define BVME_IRQ_I596 0x1a | 113 | #define BVME_IRQ_TIMER (IRQ_USER+25) |
114 | #define BVME_IRQ_SCSI 0x1b | 114 | #define BVME_IRQ_I596 IRQ_AUTO_2 |
115 | #define BVME_IRQ_TIMER 0x59 | 115 | #define BVME_IRQ_SCSI IRQ_AUTO_3 |
116 | #define BVME_IRQ_RTC 0x1e | 116 | #define BVME_IRQ_RTC IRQ_AUTO_6 |
117 | #define BVME_IRQ_ABORT 0x1f | 117 | #define BVME_IRQ_ABORT IRQ_AUTO_7 |
118 | 118 | ||
119 | /* SCC interrupts */ | 119 | /* SCC interrupts */ |
120 | #define BVME_IRQ_SCC_BASE 0x40 | 120 | #define BVME_IRQ_SCC_BASE IRQ_USER |
121 | #define BVME_IRQ_SCCB_TX 0x40 | 121 | #define BVME_IRQ_SCCB_TX IRQ_USER |
122 | #define BVME_IRQ_SCCB_STAT 0x42 | 122 | #define BVME_IRQ_SCCB_STAT (IRQ_USER+2) |
123 | #define BVME_IRQ_SCCB_RX 0x44 | 123 | #define BVME_IRQ_SCCB_RX (IRQ_USER+4) |
124 | #define BVME_IRQ_SCCB_SPCOND 0x46 | 124 | #define BVME_IRQ_SCCB_SPCOND (IRQ_USER+6) |
125 | #define BVME_IRQ_SCCA_TX 0x48 | 125 | #define BVME_IRQ_SCCA_TX (IRQ_USER+8) |
126 | #define BVME_IRQ_SCCA_STAT 0x4a | 126 | #define BVME_IRQ_SCCA_STAT (IRQ_USER+10) |
127 | #define BVME_IRQ_SCCA_RX 0x4c | 127 | #define BVME_IRQ_SCCA_RX (IRQ_USER+12) |
128 | #define BVME_IRQ_SCCA_SPCOND 0x4e | 128 | #define BVME_IRQ_SCCA_SPCOND (IRQ_USER+14) |
129 | 129 | ||
130 | /* Address control registers */ | 130 | /* Address control registers */ |
131 | 131 | ||
diff --git a/include/asm-m68k/mvme147hw.h b/include/asm-m68k/mvme147hw.h index f245139f3671..b81043108472 100644 --- a/include/asm-m68k/mvme147hw.h +++ b/include/asm-m68k/mvme147hw.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _MVME147HW_H_ | 1 | #ifndef _MVME147HW_H_ |
2 | #define _MVME147HW_H_ | 2 | #define _MVME147HW_H_ |
3 | 3 | ||
4 | #include <asm/irq.h> | ||
5 | |||
4 | typedef struct { | 6 | typedef struct { |
5 | unsigned char | 7 | unsigned char |
6 | ctrl, | 8 | ctrl, |
@@ -72,39 +74,39 @@ struct pcc_regs { | |||
72 | #define PCC_LEVEL_SCSI_PORT 0x04 | 74 | #define PCC_LEVEL_SCSI_PORT 0x04 |
73 | #define PCC_LEVEL_SCSI_DMA 0x04 | 75 | #define PCC_LEVEL_SCSI_DMA 0x04 |
74 | 76 | ||
75 | #define PCC_IRQ_AC_FAIL 0x40 | 77 | #define PCC_IRQ_AC_FAIL (IRQ_USER+0) |
76 | #define PCC_IRQ_BERR 0x41 | 78 | #define PCC_IRQ_BERR (IRQ_USER+1) |
77 | #define PCC_IRQ_ABORT 0x42 | 79 | #define PCC_IRQ_ABORT (IRQ_USER+2) |
78 | /* #define PCC_IRQ_SERIAL 0x43 */ | 80 | /* #define PCC_IRQ_SERIAL (IRQ_USER+3) */ |
79 | #define PCC_IRQ_PRINTER 0x47 | 81 | #define PCC_IRQ_PRINTER (IRQ_USER+7) |
80 | #define PCC_IRQ_TIMER1 0x48 | 82 | #define PCC_IRQ_TIMER1 (IRQ_USER+8) |
81 | #define PCC_IRQ_TIMER2 0x49 | 83 | #define PCC_IRQ_TIMER2 (IRQ_USER+9) |
82 | #define PCC_IRQ_SOFTWARE1 0x4a | 84 | #define PCC_IRQ_SOFTWARE1 (IRQ_USER+10) |
83 | #define PCC_IRQ_SOFTWARE2 0x4b | 85 | #define PCC_IRQ_SOFTWARE2 (IRQ_USER+11) |
84 | 86 | ||
85 | 87 | ||
86 | #define M147_SCC_A_ADDR 0xfffe3002 | 88 | #define M147_SCC_A_ADDR 0xfffe3002 |
87 | #define M147_SCC_B_ADDR 0xfffe3000 | 89 | #define M147_SCC_B_ADDR 0xfffe3000 |
88 | #define M147_SCC_PCLK 5000000 | 90 | #define M147_SCC_PCLK 5000000 |
89 | 91 | ||
90 | #define MVME147_IRQ_SCSI_PORT 0x45 | 92 | #define MVME147_IRQ_SCSI_PORT (IRQ_USER+0x45) |
91 | #define MVME147_IRQ_SCSI_DMA 0x46 | 93 | #define MVME147_IRQ_SCSI_DMA (IRQ_USER+0x46) |
92 | 94 | ||
93 | /* SCC interrupts, for MVME147 */ | 95 | /* SCC interrupts, for MVME147 */ |
94 | 96 | ||
95 | #define MVME147_IRQ_TYPE_PRIO 0 | 97 | #define MVME147_IRQ_TYPE_PRIO 0 |
96 | #define MVME147_IRQ_SCC_BASE 0x60 | 98 | #define MVME147_IRQ_SCC_BASE (IRQ_USER+32) |
97 | #define MVME147_IRQ_SCCB_TX 0x60 | 99 | #define MVME147_IRQ_SCCB_TX (IRQ_USER+32) |
98 | #define MVME147_IRQ_SCCB_STAT 0x62 | 100 | #define MVME147_IRQ_SCCB_STAT (IRQ_USER+34) |
99 | #define MVME147_IRQ_SCCB_RX 0x64 | 101 | #define MVME147_IRQ_SCCB_RX (IRQ_USER+36) |
100 | #define MVME147_IRQ_SCCB_SPCOND 0x66 | 102 | #define MVME147_IRQ_SCCB_SPCOND (IRQ_USER+38) |
101 | #define MVME147_IRQ_SCCA_TX 0x68 | 103 | #define MVME147_IRQ_SCCA_TX (IRQ_USER+40) |
102 | #define MVME147_IRQ_SCCA_STAT 0x6a | 104 | #define MVME147_IRQ_SCCA_STAT (IRQ_USER+42) |
103 | #define MVME147_IRQ_SCCA_RX 0x6c | 105 | #define MVME147_IRQ_SCCA_RX (IRQ_USER+44) |
104 | #define MVME147_IRQ_SCCA_SPCOND 0x6e | 106 | #define MVME147_IRQ_SCCA_SPCOND (IRQ_USER+46) |
105 | 107 | ||
106 | #define MVME147_LANCE_BASE 0xfffe1800 | 108 | #define MVME147_LANCE_BASE 0xfffe1800 |
107 | #define MVME147_LANCE_IRQ 0x44 | 109 | #define MVME147_LANCE_IRQ (IRQ_USER+4) |
108 | 110 | ||
109 | #define ETHERNET_ADDRESS 0xfffe0778 | 111 | #define ETHERNET_ADDRESS 0xfffe0778 |
110 | 112 | ||
diff --git a/include/asm-m68k/mvme16xhw.h b/include/asm-m68k/mvme16xhw.h index 5d07231d2426..6117f56653d2 100644 --- a/include/asm-m68k/mvme16xhw.h +++ b/include/asm-m68k/mvme16xhw.h | |||
@@ -66,28 +66,28 @@ typedef struct { | |||
66 | 66 | ||
67 | #define MVME162_IRQ_TYPE_PRIO 0 | 67 | #define MVME162_IRQ_TYPE_PRIO 0 |
68 | 68 | ||
69 | #define MVME167_IRQ_PRN 0x54 | 69 | #define MVME167_IRQ_PRN (IRQ_USER+20) |
70 | #define MVME16x_IRQ_I596 0x57 | 70 | #define MVME16x_IRQ_I596 (IRQ_USER+23) |
71 | #define MVME16x_IRQ_SCSI 0x55 | 71 | #define MVME16x_IRQ_SCSI (IRQ_USER+21) |
72 | #define MVME16x_IRQ_FLY 0x7f | 72 | #define MVME16x_IRQ_FLY (IRQ_USER+63) |
73 | #define MVME167_IRQ_SER_ERR 0x5c | 73 | #define MVME167_IRQ_SER_ERR (IRQ_USER+28) |
74 | #define MVME167_IRQ_SER_MODEM 0x5d | 74 | #define MVME167_IRQ_SER_MODEM (IRQ_USER+29) |
75 | #define MVME167_IRQ_SER_TX 0x5e | 75 | #define MVME167_IRQ_SER_TX (IRQ_USER+30) |
76 | #define MVME167_IRQ_SER_RX 0x5f | 76 | #define MVME167_IRQ_SER_RX (IRQ_USER+31) |
77 | #define MVME16x_IRQ_TIMER 0x59 | 77 | #define MVME16x_IRQ_TIMER (IRQ_USER+25) |
78 | #define MVME167_IRQ_ABORT 0x6e | 78 | #define MVME167_IRQ_ABORT (IRQ_USER+46) |
79 | #define MVME162_IRQ_ABORT 0x5e | 79 | #define MVME162_IRQ_ABORT (IRQ_USER+30) |
80 | 80 | ||
81 | /* SCC interrupts, for MVME162 */ | 81 | /* SCC interrupts, for MVME162 */ |
82 | #define MVME162_IRQ_SCC_BASE 0x40 | 82 | #define MVME162_IRQ_SCC_BASE (IRQ_USER+0) |
83 | #define MVME162_IRQ_SCCB_TX 0x40 | 83 | #define MVME162_IRQ_SCCB_TX (IRQ_USER+0) |
84 | #define MVME162_IRQ_SCCB_STAT 0x42 | 84 | #define MVME162_IRQ_SCCB_STAT (IRQ_USER+2) |
85 | #define MVME162_IRQ_SCCB_RX 0x44 | 85 | #define MVME162_IRQ_SCCB_RX (IRQ_USER+4) |
86 | #define MVME162_IRQ_SCCB_SPCOND 0x46 | 86 | #define MVME162_IRQ_SCCB_SPCOND (IRQ_USER+6) |
87 | #define MVME162_IRQ_SCCA_TX 0x48 | 87 | #define MVME162_IRQ_SCCA_TX (IRQ_USER+8) |
88 | #define MVME162_IRQ_SCCA_STAT 0x4a | 88 | #define MVME162_IRQ_SCCA_STAT (IRQ_USER+10) |
89 | #define MVME162_IRQ_SCCA_RX 0x4c | 89 | #define MVME162_IRQ_SCCA_RX (IRQ_USER+12) |
90 | #define MVME162_IRQ_SCCA_SPCOND 0x4e | 90 | #define MVME162_IRQ_SCCA_SPCOND (IRQ_USER+14) |
91 | 91 | ||
92 | /* MVME162 version register */ | 92 | /* MVME162 version register */ |
93 | 93 | ||