diff options
author | Greg Ungerer <gerg@uclinux.org> | 2009-05-01 02:54:49 -0400 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2009-09-15 19:43:45 -0400 |
commit | 1985d2538cccdcdb444d03bc5994be82e85e1f60 (patch) | |
tree | 9081f253cab22ff7481727e847ed28d1b73c8074 | |
parent | 33a21263bf74177209c11f08246fc308916d9ffa (diff) |
m68knommu: complete interrupt controller code for the 68328 CPU's
Define the interrupt controller structures along with the interrupt
controller code for the 68328 CPU family. This brings the interrupt
setup and control into one place for this CPU family.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
-rw-r--r-- | arch/m68knommu/platform/68328/ints.c | 72 |
1 files changed, 40 insertions, 32 deletions
diff --git a/arch/m68knommu/platform/68328/ints.c b/arch/m68knommu/platform/68328/ints.c index 72e56d554f4f..b91ee85d4b5d 100644 --- a/arch/m68knommu/platform/68328/ints.c +++ b/arch/m68knommu/platform/68328/ints.c | |||
@@ -73,34 +73,6 @@ extern e_vector *_ramvec; | |||
73 | /* The number of spurious interrupts */ | 73 | /* The number of spurious interrupts */ |
74 | volatile unsigned int num_spurious; | 74 | volatile unsigned int num_spurious; |
75 | 75 | ||
76 | /* | ||
77 | * This function should be called during kernel startup to initialize | ||
78 | * the machine vector table. | ||
79 | */ | ||
80 | void __init init_vectors(void) | ||
81 | { | ||
82 | int i; | ||
83 | |||
84 | /* set up the vectors */ | ||
85 | for (i = 72; i < 256; ++i) | ||
86 | _ramvec[i] = (e_vector) bad_interrupt; | ||
87 | |||
88 | _ramvec[32] = system_call; | ||
89 | |||
90 | _ramvec[65] = (e_vector) inthandler1; | ||
91 | _ramvec[66] = (e_vector) inthandler2; | ||
92 | _ramvec[67] = (e_vector) inthandler3; | ||
93 | _ramvec[68] = (e_vector) inthandler4; | ||
94 | _ramvec[69] = (e_vector) inthandler5; | ||
95 | _ramvec[70] = (e_vector) inthandler6; | ||
96 | _ramvec[71] = (e_vector) inthandler7; | ||
97 | |||
98 | IVR = 0x40; /* Set DragonBall IVR (interrupt base) to 64 */ | ||
99 | |||
100 | /* turn off all interrupts */ | ||
101 | IMR = ~0; | ||
102 | } | ||
103 | |||
104 | /* The 68k family did not have a good way to determine the source | 76 | /* The 68k family did not have a good way to determine the source |
105 | * of interrupts until later in the family. The EC000 core does | 77 | * of interrupts until later in the family. The EC000 core does |
106 | * not provide the vector number on the stack, we vector everything | 78 | * not provide the vector number on the stack, we vector everything |
@@ -163,18 +135,54 @@ void process_int(int vec, struct pt_regs *fp) | |||
163 | } | 135 | } |
164 | } | 136 | } |
165 | 137 | ||
166 | void enable_vector(unsigned int irq) | 138 | static void intc_irq_unmask(unsigned int irq) |
167 | { | 139 | { |
168 | IMR &= ~(1<<irq); | 140 | IMR &= ~(1<<irq); |
169 | } | 141 | } |
170 | 142 | ||
171 | void disable_vector(unsigned int irq) | 143 | static void intc_irq_mask(unsigned int irq) |
172 | { | 144 | { |
173 | IMR |= (1<<irq); | 145 | IMR |= (1<<irq); |
174 | } | 146 | } |
175 | 147 | ||
176 | void ack_vector(unsigned int irq) | 148 | static struct irq_chip intc_irq_chip = { |
149 | .name = "M68K-INTC", | ||
150 | .mask = intc_irq_mask, | ||
151 | .unmask = intc_irq_unmask, | ||
152 | }; | ||
153 | |||
154 | /* | ||
155 | * This function should be called during kernel startup to initialize | ||
156 | * the machine vector table. | ||
157 | */ | ||
158 | void __init init_IRQ(void) | ||
177 | { | 159 | { |
178 | /* Nothing needed */ | 160 | int i; |
161 | |||
162 | /* set up the vectors */ | ||
163 | for (i = 72; i < 256; ++i) | ||
164 | _ramvec[i] = (e_vector) bad_interrupt; | ||
165 | |||
166 | _ramvec[32] = system_call; | ||
167 | |||
168 | _ramvec[65] = (e_vector) inthandler1; | ||
169 | _ramvec[66] = (e_vector) inthandler2; | ||
170 | _ramvec[67] = (e_vector) inthandler3; | ||
171 | _ramvec[68] = (e_vector) inthandler4; | ||
172 | _ramvec[69] = (e_vector) inthandler5; | ||
173 | _ramvec[70] = (e_vector) inthandler6; | ||
174 | _ramvec[71] = (e_vector) inthandler7; | ||
175 | |||
176 | IVR = 0x40; /* Set DragonBall IVR (interrupt base) to 64 */ | ||
177 | |||
178 | /* turn off all interrupts */ | ||
179 | IMR = ~0; | ||
180 | |||
181 | for (i = 0; (i < NR_IRQS); i++) { | ||
182 | irq_desc[i].status = IRQ_DISABLED; | ||
183 | irq_desc[i].action = NULL; | ||
184 | irq_desc[i].depth = 1; | ||
185 | irq_desc[i].chip = &intc_irq_chip; | ||
186 | } | ||
179 | } | 187 | } |
180 | 188 | ||