summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/main.c
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2016-11-23 13:55:13 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2016-11-24 17:34:01 +1100
commita1ff57416af9a7971a801d553cd53edd8afb28d6 (patch)
tree531cebbcf7a6788ca1e140a93e5923ec117ffd5c /arch/powerpc/boot/main.c
parent9e5f68842276672a05737c23e407250f776cbf35 (diff)
downloadlinux-a1ff57416af9a7971a801d553cd53edd8afb28d6.tar.bz2
powerpc/boot: Fix the early OPAL console wrappers
When configured with CONFIG_PPC_EARLY_DEBUG_OPAL=y the kernel expects the OPAL entry and base addresses to be passed in r8 and r9 respectively. Currently the wrapper does not attempt to restore these values before entering the decompressed kernel which causes the kernel to branch into whatever happens to be in r9 when doing a write to the OPAL console in early boot. This patch adds a platform_ops hook that can be used to branch into the new kernel. The OPAL console driver patches this at runtime so that if the console is used it will be restored just prior to entering the kernel. Fixes: 656ad58ef19e ("powerpc/boot: Add OPAL console to epapr wrappers") Cc: stable@vger.kernel.org # v4.8+ Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/boot/main.c')
-rw-r--r--arch/powerpc/boot/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 57d42d129033..78aaf4ffd7ab 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -232,8 +232,12 @@ void start(void)
console_ops.close();
kentry = (kernel_entry_t) vmlinux.addr;
- if (ft_addr)
- kentry(ft_addr, 0, NULL);
+ if (ft_addr) {
+ if(platform_ops.kentry)
+ platform_ops.kentry(ft_addr, vmlinux.addr);
+ else
+ kentry(ft_addr, 0, NULL);
+ }
else
kentry((unsigned long)initrd.addr, initrd.size,
loader_info.promptr);