aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-12-30 21:54:13 -0500
committerPaul Mackerras <paulus@samba.org>2007-12-30 21:54:13 -0500
commit4f43143f9fbbb679c38d2ff99e44d3aaa00d0fe1 (patch)
tree4472ccce19c5ee2b8c78262d41df8cbcee1aafc3
parent533b1928b5c37dbdaabec3e7ff073aee8d7af3eb (diff)
parent90c26375b48e764a099bb5b606a74bb54bb5a3a7 (diff)
Merge branch 'for-2.6.25' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/pasemi
-rw-r--r--arch/powerpc/configs/pasemi_defconfig30
-rw-r--r--arch/powerpc/platforms/pasemi/setup.c30
-rw-r--r--arch/powerpc/sysdev/mpic.c31
-rw-r--r--arch/powerpc/sysdev/mpic.h3
-rw-r--r--include/asm-powerpc/mpic.h20
5 files changed, 100 insertions, 14 deletions
diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig
index 292de3d6ce92..9d21b083ae12 100644
--- a/arch/powerpc/configs/pasemi_defconfig
+++ b/arch/powerpc/configs/pasemi_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24-rc4 3# Linux kernel version: 2.6.24-rc6
4# Thu Dec 6 16:49:03 2007 4# Fri Dec 28 11:01:53 2007
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7 7
@@ -256,7 +256,7 @@ CONFIG_PCI_DOMAINS=y
256CONFIG_PCI_SYSCALL=y 256CONFIG_PCI_SYSCALL=y
257# CONFIG_PCIEPORTBUS is not set 257# CONFIG_PCIEPORTBUS is not set
258CONFIG_ARCH_SUPPORTS_MSI=y 258CONFIG_ARCH_SUPPORTS_MSI=y
259# CONFIG_PCI_MSI is not set 259CONFIG_PCI_MSI=y
260CONFIG_PCI_LEGACY=y 260CONFIG_PCI_LEGACY=y
261# CONFIG_PCI_DEBUG is not set 261# CONFIG_PCI_DEBUG is not set
262CONFIG_PCCARD=y 262CONFIG_PCCARD=y
@@ -663,7 +663,25 @@ CONFIG_PATA_PCMCIA=y
663# CONFIG_PATA_VIA is not set 663# CONFIG_PATA_VIA is not set
664# CONFIG_PATA_WINBOND is not set 664# CONFIG_PATA_WINBOND is not set
665CONFIG_PATA_PLATFORM=y 665CONFIG_PATA_PLATFORM=y
666# CONFIG_MD is not set 666CONFIG_MD=y
667CONFIG_BLK_DEV_MD=y
668CONFIG_MD_LINEAR=y
669CONFIG_MD_RAID0=y
670CONFIG_MD_RAID1=y
671CONFIG_MD_RAID10=y
672CONFIG_MD_RAID456=y
673CONFIG_MD_RAID5_RESHAPE=y
674# CONFIG_MD_MULTIPATH is not set
675# CONFIG_MD_FAULTY is not set
676CONFIG_BLK_DEV_DM=y
677# CONFIG_DM_DEBUG is not set
678CONFIG_DM_CRYPT=y
679# CONFIG_DM_SNAPSHOT is not set
680# CONFIG_DM_MIRROR is not set
681# CONFIG_DM_ZERO is not set
682# CONFIG_DM_MULTIPATH is not set
683# CONFIG_DM_DELAY is not set
684# CONFIG_DM_UEVENT is not set
667# CONFIG_FUSION is not set 685# CONFIG_FUSION is not set
668 686
669# 687#
@@ -1686,6 +1704,10 @@ CONFIG_XMON_DISASSEMBLY=y
1686# CONFIG_KEYS is not set 1704# CONFIG_KEYS is not set
1687# CONFIG_SECURITY is not set 1705# CONFIG_SECURITY is not set
1688# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1706# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1707CONFIG_XOR_BLOCKS=y
1708CONFIG_ASYNC_CORE=y
1709CONFIG_ASYNC_MEMCPY=y
1710CONFIG_ASYNC_XOR=y
1689CONFIG_CRYPTO=y 1711CONFIG_CRYPTO=y
1690CONFIG_CRYPTO_ALGAPI=y 1712CONFIG_CRYPTO_ALGAPI=y
1691CONFIG_CRYPTO_BLKCIPHER=y 1713CONFIG_CRYPTO_BLKCIPHER=y
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
62static struct mce_regs mce_regs[MAX_MCE_REGS]; 62static struct mce_regs mce_regs[MAX_MCE_REGS];
63static int num_mce_regs; 63static int num_mce_regs;
64static int nmi_virq = NO_IRQ;
64 65
65 66
66static void pas_restart(char *cmd) 67static 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 337out:
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}
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index f74fe26b787e..f88ff09c4711 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -83,6 +83,7 @@ static u32 mpic_infos[][MPIC_IDX_END] = {
83 MPIC_CPU_WHOAMI, 83 MPIC_CPU_WHOAMI,
84 MPIC_CPU_INTACK, 84 MPIC_CPU_INTACK,
85 MPIC_CPU_EOI, 85 MPIC_CPU_EOI,
86 MPIC_CPU_MCACK,
86 87
87 MPIC_IRQ_BASE, 88 MPIC_IRQ_BASE,
88 MPIC_IRQ_STRIDE, 89 MPIC_IRQ_STRIDE,
@@ -121,6 +122,7 @@ static u32 mpic_infos[][MPIC_IDX_END] = {
121 TSI108_CPU_WHOAMI, 122 TSI108_CPU_WHOAMI,
122 TSI108_CPU_INTACK, 123 TSI108_CPU_INTACK,
123 TSI108_CPU_EOI, 124 TSI108_CPU_EOI,
125 TSI108_CPU_MCACK,
124 126
125 TSI108_IRQ_BASE, 127 TSI108_IRQ_BASE,
126 TSI108_IRQ_STRIDE, 128 TSI108_IRQ_STRIDE,
@@ -1126,6 +1128,11 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1126 mb(); 1128 mb();
1127 } 1129 }
1128 1130
1131 if (flags & MPIC_ENABLE_MCK)
1132 mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0),
1133 mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
1134 | MPIC_GREG_GCONF_MCK);
1135
1129 /* Read feature register, calculate num CPUs and, for non-ISU 1136 /* Read feature register, calculate num CPUs and, for non-ISU
1130 * MPICs, num sources as well. On ISU MPICs, sources are counted 1137 * MPICs, num sources as well. On ISU MPICs, sources are counted
1131 * as ISUs are added 1138 * as ISUs are added
@@ -1272,6 +1279,11 @@ void __init mpic_init(struct mpic *mpic)
1272 mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) 1279 mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
1273 | MPIC_GREG_GCONF_8259_PTHROU_DIS); 1280 | MPIC_GREG_GCONF_8259_PTHROU_DIS);
1274 1281
1282 if (mpic->flags & MPIC_NO_BIAS)
1283 mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0),
1284 mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
1285 | MPIC_GREG_GCONF_NO_BIAS);
1286
1275 /* Set current processor priority to 0 */ 1287 /* Set current processor priority to 0 */
1276 mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0); 1288 mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0);
1277 1289
@@ -1438,13 +1450,13 @@ void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask)
1438 mpic_physmask(cpu_mask & cpus_addr(cpu_online_map)[0])); 1450 mpic_physmask(cpu_mask & cpus_addr(cpu_online_map)[0]));
1439} 1451}
1440 1452
1441unsigned int mpic_get_one_irq(struct mpic *mpic) 1453static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg)
1442{ 1454{
1443 u32 src; 1455 u32 src;
1444 1456
1445 src = mpic_cpu_read(MPIC_INFO(CPU_INTACK)) & MPIC_INFO(VECPRI_VECTOR_MASK); 1457 src = mpic_cpu_read(reg) & MPIC_INFO(VECPRI_VECTOR_MASK);
1446#ifdef DEBUG_LOW 1458#ifdef DEBUG_LOW
1447 DBG("%s: get_one_irq(): %d\n", mpic->name, src); 1459 DBG("%s: get_one_irq(reg 0x%x): %d\n", mpic->name, reg, src);
1448#endif 1460#endif
1449 if (unlikely(src == mpic->spurious_vec)) { 1461 if (unlikely(src == mpic->spurious_vec)) {
1450 if (mpic->flags & MPIC_SPV_EOI) 1462 if (mpic->flags & MPIC_SPV_EOI)
@@ -1462,6 +1474,11 @@ unsigned int mpic_get_one_irq(struct mpic *mpic)
1462 return irq_linear_revmap(mpic->irqhost, src); 1474 return irq_linear_revmap(mpic->irqhost, src);
1463} 1475}
1464 1476
1477unsigned int mpic_get_one_irq(struct mpic *mpic)
1478{
1479 return _mpic_get_one_irq(mpic, MPIC_INFO(CPU_INTACK));
1480}
1481
1465unsigned int mpic_get_irq(void) 1482unsigned int mpic_get_irq(void)
1466{ 1483{
1467 struct mpic *mpic = mpic_primary; 1484 struct mpic *mpic = mpic_primary;
@@ -1471,6 +1488,14 @@ unsigned int mpic_get_irq(void)
1471 return mpic_get_one_irq(mpic); 1488 return mpic_get_one_irq(mpic);
1472} 1489}
1473 1490
1491unsigned int mpic_get_mcirq(void)
1492{
1493 struct mpic *mpic = mpic_primary;
1494
1495 BUG_ON(mpic == NULL);
1496
1497 return _mpic_get_one_irq(mpic, MPIC_INFO(CPU_MCACK));
1498}
1474 1499
1475#ifdef CONFIG_SMP 1500#ifdef CONFIG_SMP
1476void mpic_request_ipis(void) 1501void mpic_request_ipis(void)
diff --git a/arch/powerpc/sysdev/mpic.h b/arch/powerpc/sysdev/mpic.h
index 4783c6e9f30d..fbf8a266941c 100644
--- a/arch/powerpc/sysdev/mpic.h
+++ b/arch/powerpc/sysdev/mpic.h
@@ -38,9 +38,6 @@ static inline int mpic_pasemi_msi_init(struct mpic *mpic)
38 38
39extern int mpic_set_irq_type(unsigned int virq, unsigned int flow_type); 39extern int mpic_set_irq_type(unsigned int virq, unsigned int flow_type);
40extern void mpic_set_vector(unsigned int virq, unsigned int vector); 40extern void mpic_set_vector(unsigned int virq, unsigned int vector);
41extern void mpic_end_irq(unsigned int irq);
42extern void mpic_mask_irq(unsigned int irq);
43extern void mpic_unmask_irq(unsigned int irq);
44extern void mpic_set_affinity(unsigned int irq, cpumask_t cpumask); 41extern void mpic_set_affinity(unsigned int irq, cpumask_t cpumask);
45 42
46#endif /* _POWERPC_SYSDEV_MPIC_H */ 43#endif /* _POWERPC_SYSDEV_MPIC_H */
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index ae84dde3bc7f..943c5a3fac8a 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -22,7 +22,9 @@
22#define MPIC_GREG_GLOBAL_CONF_0 0x00020 22#define MPIC_GREG_GLOBAL_CONF_0 0x00020
23#define MPIC_GREG_GCONF_RESET 0x80000000 23#define MPIC_GREG_GCONF_RESET 0x80000000
24#define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000 24#define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000
25#define MPIC_GREG_GCONF_NO_BIAS 0x10000000
25#define MPIC_GREG_GCONF_BASE_MASK 0x000fffff 26#define MPIC_GREG_GCONF_BASE_MASK 0x000fffff
27#define MPIC_GREG_GCONF_MCK 0x08000000
26#define MPIC_GREG_GLOBAL_CONF_1 0x00030 28#define MPIC_GREG_GLOBAL_CONF_1 0x00030
27#define MPIC_GREG_GLOBAL_CONF_1_SIE 0x08000000 29#define MPIC_GREG_GLOBAL_CONF_1_SIE 0x08000000
28#define MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK 0x70000000 30#define MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK 0x70000000
@@ -78,6 +80,7 @@
78#define MPIC_CPU_WHOAMI_MASK 0x0000001f 80#define MPIC_CPU_WHOAMI_MASK 0x0000001f
79#define MPIC_CPU_INTACK 0x000a0 81#define MPIC_CPU_INTACK 0x000a0
80#define MPIC_CPU_EOI 0x000b0 82#define MPIC_CPU_EOI 0x000b0
83#define MPIC_CPU_MCACK 0x000c0
81 84
82/* 85/*
83 * Per-source registers 86 * Per-source registers
@@ -141,6 +144,7 @@
141#define TSI108_CPU_WHOAMI 0xffffffff 144#define TSI108_CPU_WHOAMI 0xffffffff
142#define TSI108_CPU_INTACK 0x00004 145#define TSI108_CPU_INTACK 0x00004
143#define TSI108_CPU_EOI 0x00008 146#define TSI108_CPU_EOI 0x00008
147#define TSI108_CPU_MCACK 0x00004 /* Doesn't really exist here */
144 148
145/* 149/*
146 * Per-source registers 150 * Per-source registers
@@ -183,6 +187,7 @@ enum {
183 MPIC_IDX_CPU_WHOAMI, 187 MPIC_IDX_CPU_WHOAMI,
184 MPIC_IDX_CPU_INTACK, 188 MPIC_IDX_CPU_INTACK,
185 MPIC_IDX_CPU_EOI, 189 MPIC_IDX_CPU_EOI,
190 MPIC_IDX_CPU_MCACK,
186 191
187 MPIC_IDX_IRQ_BASE, 192 MPIC_IDX_IRQ_BASE,
188 MPIC_IDX_IRQ_STRIDE, 193 MPIC_IDX_IRQ_STRIDE,
@@ -344,6 +349,10 @@ struct mpic
344#define MPIC_USES_DCR 0x00000080 349#define MPIC_USES_DCR 0x00000080
345/* MPIC has 11-bit vector fields (or larger) */ 350/* MPIC has 11-bit vector fields (or larger) */
346#define MPIC_LARGE_VECTORS 0x00000100 351#define MPIC_LARGE_VECTORS 0x00000100
352/* Enable delivery of prio 15 interrupts as MCK instead of EE */
353#define MPIC_ENABLE_MCK 0x00000200
354/* Disable bias among target selection, spread interrupts evenly */
355#define MPIC_NO_BIAS 0x00000400
347 356
348/* MPIC HW modification ID */ 357/* MPIC HW modification ID */
349#define MPIC_REGSET_MASK 0xf0000000 358#define MPIC_REGSET_MASK 0xf0000000
@@ -447,10 +456,19 @@ extern void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask);
447/* Send a message (IPI) to a given target (cpu number or MSG_*) */ 456/* Send a message (IPI) to a given target (cpu number or MSG_*) */
448void smp_mpic_message_pass(int target, int msg); 457void smp_mpic_message_pass(int target, int msg);
449 458
459/* Unmask a specific virq */
460extern void mpic_unmask_irq(unsigned int irq);
461/* Mask a specific virq */
462extern void mpic_mask_irq(unsigned int irq);
463/* EOI a specific virq */
464extern void mpic_end_irq(unsigned int irq);
465
450/* Fetch interrupt from a given mpic */ 466/* Fetch interrupt from a given mpic */
451extern unsigned int mpic_get_one_irq(struct mpic *mpic); 467extern unsigned int mpic_get_one_irq(struct mpic *mpic);
452/* This one gets to the primary mpic */ 468/* This one gets from the primary mpic */
453extern unsigned int mpic_get_irq(void); 469extern unsigned int mpic_get_irq(void);
470/* Fetch Machine Check interrupt from primary mpic */
471extern unsigned int mpic_get_mcirq(void);
454 472
455/* Set the EPIC clock ratio */ 473/* Set the EPIC clock ratio */
456void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio); 474void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio);