3 #include <linux/types.h>
4 #include <linux/kernel.h>
10 #include <asm/machdep.h>
16 static void dump_fir(int cpu)
18 struct cbe_pmd_regs __iomem *pregs = cbe_get_cpu_pmd_regs(cpu);
19 struct cbe_iic_regs __iomem *iregs = cbe_get_cpu_iic_regs(cpu);
24 /* Todo: do some nicer parsing of bits and based on them go down
25 * to other sub-units FIRs and not only IIC
27 printk(KERN_ERR "Global Checkstop FIR : 0x%016lx\n",
28 in_be64(&pregs->checkstop_fir));
29 printk(KERN_ERR "Global Recoverable FIR : 0x%016lx\n",
30 in_be64(&pregs->checkstop_fir));
31 printk(KERN_ERR "Global MachineCheck FIR : 0x%016lx\n",
32 in_be64(&pregs->spec_att_mchk_fir));
36 printk(KERN_ERR "IOC FIR : 0x%016lx\n",
37 in_be64(&iregs->ioc_fir));
41 void cbe_system_error_exception(struct pt_regs *regs)
43 int cpu = smp_processor_id();
45 printk(KERN_ERR "System Error Interrupt on CPU %d !\n", cpu);
50 void cbe_maintenance_exception(struct pt_regs *regs)
52 int cpu = smp_processor_id();
55 * Nothing implemented for the maintenance interrupt at this point
58 printk(KERN_ERR "Unhandled Maintenance interrupt on CPU %d !\n", cpu);
62 void cbe_thermal_exception(struct pt_regs *regs)
64 int cpu = smp_processor_id();
67 * Nothing implemented for the thermal interrupt at this point
70 printk(KERN_ERR "Unhandled Thermal interrupt on CPU %d !\n", cpu);
74 static int cbe_machine_check_handler(struct pt_regs *regs)
76 int cpu = smp_processor_id();
78 printk(KERN_ERR "Machine Check Interrupt on CPU %d !\n", cpu);
81 /* No recovery from this code now, lets continue */
85 void __init cbe_ras_init(void)
90 * Enable System Error & thermal interrupts and wakeup conditions
93 hid0 = mfspr(SPRN_HID0);
94 hid0 |= HID0_CBE_THERM_INT_EN | HID0_CBE_THERM_WAKEUP |
95 HID0_CBE_SYSERR_INT_EN | HID0_CBE_SYSERR_WAKEUP;
96 mtspr(SPRN_HID0, hid0);
100 * Install machine check handler. Leave setting of precise mode to
101 * what the firmware did for now
103 ppc_md.machine_check_exception = cbe_machine_check_handler;
107 * For now, we assume that IOC_FIR is already set to forward some
108 * error conditions to the System Error handler. If that is not true
109 * then it will have to be fixed up here.