summaryrefslogtreecommitdiffstats
path: root/asm/head.S
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2019-01-08 00:04:26 +1000
committerStewart Smith <stewart@linux.ibm.com>2019-02-13 14:36:44 +1100
commit8a43bf86b7d4346521bd4ebc15eb3809d3d27adb (patch)
treed17ac162d4037ecff73d27477ffc61945a37ac4e /asm/head.S
parent4ebb78cffda897c4175f6659e98e6722ea60703f (diff)
downloadblackbird-skiboot-8a43bf86b7d4346521bd4ebc15eb3809d3d27adb.tar.gz
blackbird-skiboot-8a43bf86b7d4346521bd4ebc15eb3809d3d27adb.zip
core/exceptions: implement an exception handler for non-powersave sresets
Detect non-powersave sresets and send them to the normal exception handler which prints registers and stack. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'asm/head.S')
-rw-r--r--asm/head.S20
1 files changed, 19 insertions, 1 deletions
diff --git a/asm/head.S b/asm/head.S
index 29560c38..27f104dc 100644
--- a/asm/head.S
+++ b/asm/head.S
@@ -107,6 +107,7 @@ hir_trigger:
* used for recovering from rvw or nap mode
*/
. = 0x100
+sreset_vector:
/* BML entry, load up r3 with device tree location */
li %r3, 0
oris %r3, %r3, 0xa
@@ -668,8 +669,25 @@ enter_p9_pm_state:
*/
.global reset_patch_start
reset_patch_start:
+ mtsprg0 %r3
+ mtsprg1 %r4
+ mfspr %r3,SPR_SRR1
+ mfcr %r4
+ rldicl. %r3,%r3,48,62
+ bne 1f /* powersave wakeup (CFAR not required) */
+ mtcr %r4
+ mfspr %r3,SPR_CFAR
+ li %r4,0x100
+ b _exception + (reset_patch_start - sreset_vector)
+1:
LOAD_IMM64(%r30, SKIBOOT_BASE)
+ cmpdi %r3,0x1
+ bne 2f /* state loss */
+ LOAD_IMM32(%r3, reset_resume - __head)
+ b 3f
+2:
LOAD_IMM32(%r3, reset_wakeup - __head)
+3:
add %r3,%r30,%r3
mtctr %r3
bctr
@@ -715,7 +733,7 @@ reset_wakeup:
REST_GPR(29,%r1)
REST_GPR(30,%r1)
REST_GPR(31,%r1)
-
+reset_resume:
/* Get LR back, pop stack and return */
addi %r1,%r1,STACK_FRAMESIZE
ld %r0,16(%r1)
OpenPOWER on IntegriCloud