aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>2012-10-05 04:07:15 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-01-09 22:43:46 -0500
commit1e18c17adf32b86474fd903071b0181de9334bd4 (patch)
treeceee7b61403c3e074ba08ad6c82a385062430e71 /arch
parentfb9125680d0e7c23eae7c6000acc91ea26acab9c (diff)
powerpc: Enable the Watchdog vector for 405
The watchdog and FIT code has been #if 0'd for ever, if the CPU takes an exception to either of those vectors it will jump into the middle of the PIT or Data TLB code and surely crash. At least some (all?) 405 cores have both the WDT and FIT vectors defined, so lets have proper entry points for them. Tested that the WDT vector works on a 405F6 core. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/head_40x.S47
-rw-r--r--arch/powerpc/kernel/traps.c2
2 files changed, 30 insertions, 19 deletions
diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
index 4989661b710b..8a9b6f59822d 100644
--- a/arch/powerpc/kernel/head_40x.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -430,30 +430,18 @@ label:
430 EXCEPTION(0x0F00, Trap_0F, unknown_exception, EXC_XFER_EE) 430 EXCEPTION(0x0F00, Trap_0F, unknown_exception, EXC_XFER_EE)
431 431
432/* 0x1000 - Programmable Interval Timer (PIT) Exception */ 432/* 0x1000 - Programmable Interval Timer (PIT) Exception */
433 START_EXCEPTION(0x1000, Decrementer) 433 . = 0x1000
434 NORMAL_EXCEPTION_PROLOG 434 b Decrementer
435 lis r0,TSR_PIS@h
436 mtspr SPRN_TSR,r0 /* Clear the PIT exception */
437 addi r3,r1,STACK_FRAME_OVERHEAD
438 EXC_XFER_LITE(0x1000, timer_interrupt)
439
440#if 0
441/* NOTE:
442 * FIT and WDT handlers are not implemented yet.
443 */
444 435
445/* 0x1010 - Fixed Interval Timer (FIT) Exception 436/* 0x1010 - Fixed Interval Timer (FIT) Exception
446*/ 437*/
447 STND_EXCEPTION(0x1010, FITException, unknown_exception) 438 . = 0x1010
439 b FITException
448 440
449/* 0x1020 - Watchdog Timer (WDT) Exception 441/* 0x1020 - Watchdog Timer (WDT) Exception
450*/ 442*/
451#ifdef CONFIG_BOOKE_WDT 443 . = 0x1020
452 CRITICAL_EXCEPTION(0x1020, WDTException, WatchdogException) 444 b WDTException
453#else
454 CRITICAL_EXCEPTION(0x1020, WDTException, unknown_exception)
455#endif
456#endif
457 445
458/* 0x1100 - Data TLB Miss Exception 446/* 0x1100 - Data TLB Miss Exception
459 * As the name implies, translation is not in the MMU, so search the 447 * As the name implies, translation is not in the MMU, so search the
@@ -738,6 +726,29 @@ label:
738 (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ 726 (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
739 NOCOPY, crit_transfer_to_handler, ret_from_crit_exc) 727 NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
740 728
729 /* Programmable Interval Timer (PIT) Exception. (from 0x1000) */
730Decrementer:
731 NORMAL_EXCEPTION_PROLOG
732 lis r0,TSR_PIS@h
733 mtspr SPRN_TSR,r0 /* Clear the PIT exception */
734 addi r3,r1,STACK_FRAME_OVERHEAD
735 EXC_XFER_LITE(0x1000, timer_interrupt)
736
737 /* Fixed Interval Timer (FIT) Exception. (from 0x1010) */
738FITException:
739 NORMAL_EXCEPTION_PROLOG
740 addi r3,r1,STACK_FRAME_OVERHEAD;
741 EXC_XFER_EE(0x1010, unknown_exception)
742
743 /* Watchdog Timer (WDT) Exception. (from 0x1020) */
744WDTException:
745 CRITICAL_EXCEPTION_PROLOG;
746 addi r3,r1,STACK_FRAME_OVERHEAD;
747 EXC_XFER_TEMPLATE(WatchdogException, 0x1020+2,
748 (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)),
749 NOCOPY, crit_transfer_to_handler,
750 ret_from_crit_exc)
751
741/* 752/*
742 * The other Data TLB exceptions bail out to this point 753 * The other Data TLB exceptions bail out to this point
743 * if they can't resolve the lightweight TLB fault. 754 * if they can't resolve the lightweight TLB fault.
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 32518401af68..114ea241916f 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1515,7 +1515,7 @@ void unrecoverable_exception(struct pt_regs *regs)
1515 die("Unrecoverable exception", regs, SIGABRT); 1515 die("Unrecoverable exception", regs, SIGABRT);
1516} 1516}
1517 1517
1518#ifdef CONFIG_BOOKE_WDT 1518#if defined(CONFIG_BOOKE_WDT) || defined(CONFIG_40x)
1519/* 1519/*
1520 * Default handler for a Watchdog exception, 1520 * Default handler for a Watchdog exception,
1521 * spins until a reboot occurs 1521 * spins until a reboot occurs