diff options
Diffstat (limited to 'arch/powerpc/platforms/cell/ras.c')
-rw-r--r-- | arch/powerpc/platforms/cell/ras.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c index 505f9b9bdf0c..2a14b052abcd 100644 --- a/arch/powerpc/platforms/cell/ras.c +++ b/arch/powerpc/platforms/cell/ras.c | |||
@@ -236,6 +236,52 @@ static struct notifier_block cbe_ptcal_reboot_notifier = { | |||
236 | .notifier_call = cbe_ptcal_notify_reboot | 236 | .notifier_call = cbe_ptcal_notify_reboot |
237 | }; | 237 | }; |
238 | 238 | ||
239 | #ifdef CONFIG_PPC_IBM_CELL_RESETBUTTON | ||
240 | static int sysreset_hack; | ||
241 | |||
242 | static int __init cbe_sysreset_init(void) | ||
243 | { | ||
244 | struct cbe_pmd_regs __iomem *regs; | ||
245 | |||
246 | sysreset_hack = machine_is_compatible("IBM,CBPLUS-1.0"); | ||
247 | if (!sysreset_hack) | ||
248 | return 0; | ||
249 | |||
250 | regs = cbe_get_cpu_pmd_regs(0); | ||
251 | if (!regs) | ||
252 | return 0; | ||
253 | |||
254 | /* Enable JTAG system-reset hack */ | ||
255 | out_be32(®s->fir_mode_reg, | ||
256 | in_be32(®s->fir_mode_reg) | | ||
257 | CBE_PMD_FIR_MODE_M8); | ||
258 | |||
259 | return 0; | ||
260 | } | ||
261 | device_initcall(cbe_sysreset_init); | ||
262 | |||
263 | int cbe_sysreset_hack(void) | ||
264 | { | ||
265 | struct cbe_pmd_regs __iomem *regs; | ||
266 | |||
267 | /* | ||
268 | * The BMC can inject user triggered system reset exceptions, | ||
269 | * but cannot set the system reset reason in srr1, | ||
270 | * so check an extra register here. | ||
271 | */ | ||
272 | if (sysreset_hack && (smp_processor_id() == 0)) { | ||
273 | regs = cbe_get_cpu_pmd_regs(0); | ||
274 | if (!regs) | ||
275 | return 0; | ||
276 | if (in_be64(®s->ras_esc_0) & 0x0000ffff) { | ||
277 | out_be64(®s->ras_esc_0, 0); | ||
278 | return 0; | ||
279 | } | ||
280 | } | ||
281 | return 1; | ||
282 | } | ||
283 | #endif /* CONFIG_PPC_IBM_CELL_RESETBUTTON */ | ||
284 | |||
239 | int __init cbe_ptcal_init(void) | 285 | int __init cbe_ptcal_init(void) |
240 | { | 286 | { |
241 | int ret; | 287 | int ret; |