3 #include <linux/config.h>
4 #include <linux/types.h>
5 #include <linux/kernel.h>
11 #include <asm/machdep.h>
17 static void dump_fir(int cpu)
19 struct cbe_pmd_regs __iomem *pregs = cbe_get_cpu_pmd_regs(cpu);
20 struct cbe_iic_regs __iomem *iregs = cbe_get_cpu_iic_regs(cpu);
25 /* Todo: do some nicer parsing of bits and based on them go down
26 * to other sub-units FIRs and not only IIC
28 printk(KERN_ERR "Global Checkstop FIR : 0x%016lx\n",
29 in_be64(&pregs->checkstop_fir));
30 printk(KERN_ERR "Global Recoverable FIR : 0x%016lx\n",
31 in_be64(&pregs->checkstop_fir));
32 printk(KERN_ERR "Global MachineCheck FIR : 0x%016lx\n",
33 in_be64(&pregs->spec_att_mchk_fir));
37 printk(KERN_ERR "IOC FIR : 0x%016lx\n",
38 in_be64(&iregs->ioc_fir));
42 void cbe_system_error_exception(struct pt_regs *regs)
44 int cpu = smp_processor_id();
46 printk(KERN_ERR "System Error Interrupt on CPU %d !\n", cpu);
51 void cbe_maintenance_exception(struct pt_regs *regs)
53 int cpu = smp_processor_id();
56 * Nothing implemented for the maintenance interrupt at this point
59 printk(KERN_ERR "Unhandled Maintenance interrupt on CPU %d !\n", cpu);
63 void cbe_thermal_exception(struct pt_regs *regs)
65 int cpu = smp_processor_id();
68 * Nothing implemented for the thermal interrupt at this point
71 printk(KERN_ERR "Unhandled Thermal interrupt on CPU %d !\n", cpu);
75 static int cbe_machine_check_handler(struct pt_regs *regs)
77 int cpu = smp_processor_id();
79 printk(KERN_ERR "Machine Check Interrupt on CPU %d !\n", cpu);
82 /* No recovery from this code now, lets continue */
86 void __init cbe_ras_init(void)
91 * Enable System Error & thermal interrupts and wakeup conditions
94 hid0 = mfspr(SPRN_HID0);
95 hid0 |= HID0_CBE_THERM_INT_EN | HID0_CBE_THERM_WAKEUP |
96 HID0_CBE_SYSERR_INT_EN | HID0_CBE_SYSERR_WAKEUP;
97 mtspr(SPRN_HID0, hid0);
101 * Install machine check handler. Leave setting of precise mode to
102 * what the firmware did for now
104 ppc_md.machine_check_exception = cbe_machine_check_handler;
108 * For now, we assume that IOC_FIR is already set to forward some
109 * error conditions to the System Error handler. If that is not true
110 * then it will have to be fixed up here.