diff options
author | Paul Mackerras <paulus@samba.org> | 2007-12-30 21:54:13 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-30 21:54:13 -0500 |
commit | 4f43143f9fbbb679c38d2ff99e44d3aaa00d0fe1 (patch) | |
tree | 4472ccce19c5ee2b8c78262d41df8cbcee1aafc3 /arch/powerpc/platforms | |
parent | 533b1928b5c37dbdaabec3e7ff073aee8d7af3eb (diff) | |
parent | 90c26375b48e764a099bb5b606a74bb54bb5a3a7 (diff) |
Merge branch 'for-2.6.25' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/pasemi
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/pasemi/setup.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index b5dfd4252110..1940e678878e 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c | |||
@@ -61,6 +61,7 @@ struct mce_regs { | |||
61 | 61 | ||
62 | static struct mce_regs mce_regs[MAX_MCE_REGS]; | 62 | static struct mce_regs mce_regs[MAX_MCE_REGS]; |
63 | static int num_mce_regs; | 63 | static int num_mce_regs; |
64 | static int nmi_virq = NO_IRQ; | ||
64 | 65 | ||
65 | 66 | ||
66 | static void pas_restart(char *cmd) | 67 | static void pas_restart(char *cmd) |
@@ -189,6 +190,8 @@ static __init void pas_init_IRQ(void) | |||
189 | unsigned long openpic_addr; | 190 | unsigned long openpic_addr; |
190 | const unsigned int *opprop; | 191 | const unsigned int *opprop; |
191 | int naddr, opplen; | 192 | int naddr, opplen; |
193 | int mpic_flags; | ||
194 | const unsigned int *nmiprop; | ||
192 | struct mpic *mpic; | 195 | struct mpic *mpic; |
193 | 196 | ||
194 | mpic_node = NULL; | 197 | mpic_node = NULL; |
@@ -221,13 +224,26 @@ static __init void pas_init_IRQ(void) | |||
221 | openpic_addr = of_read_number(opprop, naddr); | 224 | openpic_addr = of_read_number(opprop, naddr); |
222 | printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); | 225 | printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); |
223 | 226 | ||
227 | mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS | MPIC_NO_BIAS; | ||
228 | |||
229 | nmiprop = of_get_property(mpic_node, "nmi-source", NULL); | ||
230 | if (nmiprop) | ||
231 | mpic_flags |= MPIC_ENABLE_MCK; | ||
232 | |||
224 | mpic = mpic_alloc(mpic_node, openpic_addr, | 233 | mpic = mpic_alloc(mpic_node, openpic_addr, |
225 | MPIC_PRIMARY|MPIC_LARGE_VECTORS, | 234 | mpic_flags, 0, 0, "PASEMI-OPIC"); |
226 | 0, 0, "PASEMI-OPIC"); | ||
227 | BUG_ON(!mpic); | 235 | BUG_ON(!mpic); |
228 | 236 | ||
229 | mpic_assign_isu(mpic, 0, openpic_addr + 0x10000); | 237 | mpic_assign_isu(mpic, 0, openpic_addr + 0x10000); |
230 | mpic_init(mpic); | 238 | mpic_init(mpic); |
239 | /* The NMI/MCK source needs to be prio 15 */ | ||
240 | if (nmiprop) { | ||
241 | nmi_virq = irq_create_mapping(NULL, *nmiprop); | ||
242 | mpic_irq_set_priority(nmi_virq, 15); | ||
243 | set_irq_type(nmi_virq, IRQ_TYPE_EDGE_RISING); | ||
244 | mpic_unmask_irq(nmi_virq); | ||
245 | } | ||
246 | |||
231 | of_node_put(mpic_node); | 247 | of_node_put(mpic_node); |
232 | of_node_put(root); | 248 | of_node_put(root); |
233 | } | 249 | } |
@@ -247,6 +263,14 @@ static int pas_machine_check_handler(struct pt_regs *regs) | |||
247 | 263 | ||
248 | srr0 = regs->nip; | 264 | srr0 = regs->nip; |
249 | srr1 = regs->msr; | 265 | srr1 = regs->msr; |
266 | |||
267 | if (mpic_get_mcirq() == nmi_virq) { | ||
268 | printk(KERN_ERR "NMI delivered\n"); | ||
269 | debugger(regs); | ||
270 | mpic_end_irq(nmi_virq); | ||
271 | goto out; | ||
272 | } | ||
273 | |||
250 | dsisr = mfspr(SPRN_DSISR); | 274 | dsisr = mfspr(SPRN_DSISR); |
251 | printk(KERN_ERR "Machine Check on CPU %d\n", cpu); | 275 | printk(KERN_ERR "Machine Check on CPU %d\n", cpu); |
252 | printk(KERN_ERR "SRR0 0x%016lx SRR1 0x%016lx\n", srr0, srr1); | 276 | printk(KERN_ERR "SRR0 0x%016lx SRR1 0x%016lx\n", srr0, srr1); |
@@ -310,7 +334,7 @@ static int pas_machine_check_handler(struct pt_regs *regs) | |||
310 | } | 334 | } |
311 | } | 335 | } |
312 | 336 | ||
313 | 337 | out: | |
314 | /* SRR1[62] is from MSR[62] if recoverable, so pass that back */ | 338 | /* SRR1[62] is from MSR[62] if recoverable, so pass that back */ |
315 | return !!(srr1 & 0x2); | 339 | return !!(srr1 & 0x2); |
316 | } | 340 | } |