]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/boot: Fix the early OPAL console wrappers
authorOliver O'Halloran <oohall@gmail.com>
Wed, 23 Nov 2016 02:55:13 +0000 (13:55 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 24 Nov 2016 06:34:01 +0000 (17:34 +1100)
commita9a56f1f06697a8a98d7a11bf39b25b02c97746f
tree531cebbcf7a6788ca1e140a93e5923ec117ffd5c
parent67d68b469b1d971516905a8145d0ab9ae2b16d10
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: 83f79d14aaac ("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>
arch/powerpc/boot/main.c
arch/powerpc/boot/opal-calls.S
arch/powerpc/boot/opal.c
arch/powerpc/boot/ops.h