25 #include <linux/errno.h>
26 #include <linux/kernel.h>
29 #include <linux/export.h>
30 #include <linux/pci.h>
35 #include <asm/iommu.h>
36 #include <asm/machdep.h>
41 #include <asm/debug.h>
54 #define MAX_MCE_REGS 32
61 static int num_mce_regs;
62 static int nmi_virq =
NO_IRQ;
65 static void pas_restart(
char *
cmd)
77 static unsigned long timebase;
79 static void __devinit pas_give_timebase(
void)
86 mtspr(SPRN_TBCTL, TBCTL_FREEZE);
93 mtspr(SPRN_TBCTL, TBCTL_RESTART);
97 static void __devinit pas_take_timebase(
void)
103 set_tb(timebase >> 32, timebase & 0xffffffff);
108 struct smp_ops_t pas_smp_ops = {
109 .probe = smp_mpic_probe,
110 .message_pass = smp_mpic_message_pass,
111 .kick_cpu = smp_generic_kick_cpu,
112 .setup_cpu = smp_mpic_setup_cpu,
113 .give_timebase = pas_give_timebase,
114 .take_timebase = pas_take_timebase,
127 #ifdef CONFIG_DUMMY_CONSOLE
136 static int __init pas_setup_mce_regs(
void)
148 "mc%d_mcdebug_errsta", reg);
186 static __init void pas_init_IRQ(
void)
190 unsigned long openpic_addr;
191 const unsigned int *opprop;
194 const unsigned int *nmiprop;
199 for_each_node_by_type(np,
"interrupt-controller")
205 for_each_node_by_type(np,
"open-pic") {
211 "Failed to locate the MPIC interrupt controller\n");
224 openpic_addr = of_read_number(opprop, naddr);
227 mpic_flags = MPIC_LARGE_VECTORS | MPIC_NO_BIAS | MPIC_NO_RESET;
231 mpic_flags |= MPIC_ENABLE_MCK;
234 mpic_flags, 0, 0,
"PASEMI-OPIC");
247 of_node_put(mpic_node);
251 static void __init pas_progress(
char *
s,
unsigned short hex)
253 printk(
"[%04x] : %s\n", hex, s ? s :
"");
257 static int pas_machine_check_handler(
struct pt_regs *
regs)
260 unsigned long srr0, srr1, dsisr;
274 dsisr =
mfspr(SPRN_DSISR);
279 mfspr(SPRN_PA6T_MER));
281 mfspr(SPRN_PA6T_DER));
287 if (srr1 & 0x100000) {
293 if (dsisr & 0x2000) {
300 printk(
KERN_ERR "Recoverable D-cache parity error count overflow\n");
308 if (srr1 & 0x40000) {
316 if (num_mce_regs == 0)
321 for (i = 0; i < num_mce_regs; i++)
331 asm volatile(
"slbmfee %0,%1" :
"=r" (
e) :
"r" (i));
332 asm volatile(
"slbmfev %0,%1" :
"=r" (
v) :
"r" (i));
339 return !!(srr1 & 0x2);
342 static void __init pas_init_early(
void)
353 struct pcmcia_device *
pdev = to_pcmcia_dev(dev);
359 parent = pdev->socket->dev.
parent;
380 static inline void pasemi_pcmcia_init(
void)
389 static inline void pasemi_pcmcia_init(
void)
398 { .type =
"localbus", },
401 { .compatible =
"pasemi,localbus", },
402 { .compatible =
"pasemi,sdc", },
406 static int __init pasemi_publish_devices(
void)
408 pasemi_pcmcia_init();
411 of_platform_bus_probe(
NULL, pasemi_bus_ids,
NULL);
421 static int __init pas_probe(
void)
423 unsigned long root = of_get_flat_dt_root();
425 if (!of_flat_dt_is_compatible(root,
"PA6T-1682M") &&
426 !of_flat_dt_is_compatible(root,
"pasemi,pwrficient"))
437 .name =
"PA Semi PWRficient",
440 .init_early = pas_init_early,
441 .init_IRQ = pas_init_IRQ,
443 .restart = pas_restart,
446 .progress = pas_progress,
447 .machine_check_exception = pas_machine_check_handler,