diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-07-03 07:36:01 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-03 07:36:01 -0400 |
commit | 0ebfff1491ef85d41ddf9c633834838be144f69f (patch) | |
tree | 5b469a6d61a9fcfbf94e7b6d411e544dbdec8dec /include/asm-powerpc/mpic.h | |
parent | f63e115fb50db39706b955b81e3375ef6bab2268 (diff) |
[POWERPC] Add new interrupt mapping core and change platforms to use it
This adds the new irq remapper core and removes the old one. Because
there are some fundamental conflicts with the old code, like the value
of NO_IRQ which I'm now setting to 0 (as per discussions with Linus),
etc..., this commit also changes the relevant platform and driver code
over to use the new remapper (so as not to cause difficulties later
in bisecting).
This patch removes the old pre-parsing of the open firmware interrupt
tree along with all the bogus assumptions it made to try to renumber
interrupts according to the platform. This is all to be handled by the
new code now.
For the pSeries XICS interrupt controller, a single remapper host is
created for the whole machine regardless of how many interrupt
presentation and source controllers are found, and it's set to match
any device node that isn't a 8259. That works fine on pSeries and
avoids having to deal with some of the complexities of split source
controllers vs. presentation controllers in the pSeries device trees.
The powerpc i8259 PIC driver now always requests the legacy interrupt
range. It also has the feature of being able to match any device node
(including NULL) if passed no device node as an input. That will help
porting over platforms with broken device-trees like Pegasos who don't
have a proper interrupt tree.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/mpic.h')
-rw-r--r-- | include/asm-powerpc/mpic.h | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h index a2277cb77ddc..eb241c99c457 100644 --- a/include/asm-powerpc/mpic.h +++ b/include/asm-powerpc/mpic.h | |||
@@ -129,6 +129,12 @@ struct mpic_irq_fixup | |||
129 | /* The instance data of a given MPIC */ | 129 | /* The instance data of a given MPIC */ |
130 | struct mpic | 130 | struct mpic |
131 | { | 131 | { |
132 | /* The device node of the interrupt controller */ | ||
133 | struct device_node *of_node; | ||
134 | |||
135 | /* The remapper for this MPIC */ | ||
136 | struct irq_host *irqhost; | ||
137 | |||
132 | /* The "linux" controller struct */ | 138 | /* The "linux" controller struct */ |
133 | struct irq_chip hc_irq; | 139 | struct irq_chip hc_irq; |
134 | #ifdef CONFIG_MPIC_BROKEN_U3 | 140 | #ifdef CONFIG_MPIC_BROKEN_U3 |
@@ -144,16 +150,12 @@ struct mpic | |||
144 | unsigned int isu_size; | 150 | unsigned int isu_size; |
145 | unsigned int isu_shift; | 151 | unsigned int isu_shift; |
146 | unsigned int isu_mask; | 152 | unsigned int isu_mask; |
147 | /* Offset of irq vector numbers */ | ||
148 | unsigned int irq_offset; | ||
149 | unsigned int irq_count; | 153 | unsigned int irq_count; |
150 | /* Offset of ipi vector numbers */ | ||
151 | unsigned int ipi_offset; | ||
152 | /* Number of sources */ | 154 | /* Number of sources */ |
153 | unsigned int num_sources; | 155 | unsigned int num_sources; |
154 | /* Number of CPUs */ | 156 | /* Number of CPUs */ |
155 | unsigned int num_cpus; | 157 | unsigned int num_cpus; |
156 | /* senses array */ | 158 | /* default senses array */ |
157 | unsigned char *senses; | 159 | unsigned char *senses; |
158 | unsigned int senses_count; | 160 | unsigned int senses_count; |
159 | 161 | ||
@@ -209,14 +211,11 @@ struct mpic | |||
209 | * The values in the array start at the first source of the MPIC, | 211 | * The values in the array start at the first source of the MPIC, |
210 | * that is senses[0] correspond to linux irq "irq_offset". | 212 | * that is senses[0] correspond to linux irq "irq_offset". |
211 | */ | 213 | */ |
212 | extern struct mpic *mpic_alloc(unsigned long phys_addr, | 214 | extern struct mpic *mpic_alloc(struct device_node *node, |
215 | unsigned long phys_addr, | ||
213 | unsigned int flags, | 216 | unsigned int flags, |
214 | unsigned int isu_size, | 217 | unsigned int isu_size, |
215 | unsigned int irq_offset, | ||
216 | unsigned int irq_count, | 218 | unsigned int irq_count, |
217 | unsigned int ipi_offset, | ||
218 | unsigned char *senses, | ||
219 | unsigned int senses_num, | ||
220 | const char *name); | 219 | const char *name); |
221 | 220 | ||
222 | /* Assign ISUs, to call before mpic_init() | 221 | /* Assign ISUs, to call before mpic_init() |
@@ -228,6 +227,22 @@ extern struct mpic *mpic_alloc(unsigned long phys_addr, | |||
228 | extern void mpic_assign_isu(struct mpic *mpic, unsigned int isu_num, | 227 | extern void mpic_assign_isu(struct mpic *mpic, unsigned int isu_num, |
229 | unsigned long phys_addr); | 228 | unsigned long phys_addr); |
230 | 229 | ||
230 | /* Set default sense codes | ||
231 | * | ||
232 | * @mpic: controller | ||
233 | * @senses: array of sense codes | ||
234 | * @count: size of above array | ||
235 | * | ||
236 | * Optionally provide an array (indexed on hardware interrupt numbers | ||
237 | * for this MPIC) of default sense codes for the chip. Those are linux | ||
238 | * sense codes IRQ_TYPE_* | ||
239 | * | ||
240 | * The driver gets ownership of the pointer, don't dispose of it or | ||
241 | * anything like that. __init only. | ||
242 | */ | ||
243 | extern void mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count); | ||
244 | |||
245 | |||
231 | /* Initialize the controller. After this has been called, none of the above | 246 | /* Initialize the controller. After this has been called, none of the above |
232 | * should be called again for this mpic | 247 | * should be called again for this mpic |
233 | */ | 248 | */ |
@@ -269,9 +284,9 @@ extern void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask); | |||
269 | void smp_mpic_message_pass(int target, int msg); | 284 | void smp_mpic_message_pass(int target, int msg); |
270 | 285 | ||
271 | /* Fetch interrupt from a given mpic */ | 286 | /* Fetch interrupt from a given mpic */ |
272 | extern int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs); | 287 | extern unsigned int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs); |
273 | /* This one gets to the primary mpic */ | 288 | /* This one gets to the primary mpic */ |
274 | extern int mpic_get_irq(struct pt_regs *regs); | 289 | extern unsigned int mpic_get_irq(struct pt_regs *regs); |
275 | 290 | ||
276 | /* Set the EPIC clock ratio */ | 291 | /* Set the EPIC clock ratio */ |
277 | void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio); | 292 | void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio); |
@@ -279,8 +294,5 @@ void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio); | |||
279 | /* Enable/Disable EPIC serial interrupt mode */ | 294 | /* Enable/Disable EPIC serial interrupt mode */ |
280 | void mpic_set_serial_int(struct mpic *mpic, int enable); | 295 | void mpic_set_serial_int(struct mpic *mpic, int enable); |
281 | 296 | ||
282 | /* global mpic for pSeries */ | ||
283 | extern struct mpic *pSeries_mpic; | ||
284 | |||
285 | #endif /* __KERNEL__ */ | 297 | #endif /* __KERNEL__ */ |
286 | #endif /* _ASM_POWERPC_MPIC_H */ | 298 | #endif /* _ASM_POWERPC_MPIC_H */ |