summaryrefslogtreecommitdiff
path: root/arch/powerpc/purgatory
diff options
context:
space:
mode:
authorHari Bathini <hbathini@linux.ibm.com>2020-07-29 17:14:06 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2020-07-29 23:47:55 +1000
commit2e6bd221d96fcfd9bd1eed5cd9c008e7959daed7 (patch)
treeaece224f682c4aeb57729b9a2866bed79ccaa823 /arch/powerpc/purgatory
parentb5667d13be8d0928a02b46e0c6f7ab891d32f697 (diff)
powerpc/kexec_file: Enable early kernel OPAL calls
Kernels built with CONFIG_PPC_EARLY_DEBUG_OPAL enabled expects r8 & r9 to be filled with OPAL base & entry addresses respectively. Setting these registers allows the kernel to perform OPAL calls before the device tree is parsed. Signed-off-by: Hari Bathini <hbathini@linux.ibm.com> Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/159602303975.575379.5032301944162937479.stgit@hbathini
Diffstat (limited to 'arch/powerpc/purgatory')
-rw-r--r--arch/powerpc/purgatory/trampoline_64.S16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/powerpc/purgatory/trampoline_64.S b/arch/powerpc/purgatory/trampoline_64.S
index b567da56dde1..d956b8a35fd1 100644
--- a/arch/powerpc/purgatory/trampoline_64.S
+++ b/arch/powerpc/purgatory/trampoline_64.S
@@ -87,6 +87,10 @@ master:
li %r4,28
STWX_BE %r17,%r3,%r4 /* Store my cpu as __be32 at byte 28 */
1:
+ /* Load opal base and entry values in r8 & r9 respectively */
+ ld %r8,(opal_base - 0b)(%r18)
+ ld %r9,(opal_entry - 0b)(%r18)
+
/* load the kernel address */
ld %r4,(kernel - 0b)(%r18)
@@ -133,6 +137,18 @@ backup_start:
.8byte 0x0
.size backup_start, . - backup_start
+ .balign 8
+ .globl opal_base
+opal_base:
+ .8byte 0x0
+ .size opal_base, . - opal_base
+
+ .balign 8
+ .globl opal_entry
+opal_entry:
+ .8byte 0x0
+ .size opal_entry, . - opal_entry
+
.data
.balign 8
.globl purgatory_sha256_digest