powerpc/xmon: Allow passing an argument to ppc_md.restart()
PATCH 1/2 powerpc/xmon: Allow passing an argument to ppc_md.restart()
On PowerNV a few different kinds of reboot are supported. We'd like to be able to exercise these from xmon so allow 'zr' to take an argument, and pass that to the ppc_md.restart() function.
--- arch/powerpc/xmon/xmon.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
arch/powerpc/xmon/xmon.c +7 -4
@@ -1147,16 +1147,19 @@ static int do_step(struct pt_regs *regs)static void bootcmds (void ) { +char tmp[64 ];int cmd; cmd =inchar (); -if (cmd =='r' ) - ppc_md.restart (NULL ); -else if (cmd =='h' ) +if (cmd =='r' ) { +getstring (tmp,64 ); + ppc_md.restart (tmp); + }else if (cmd =='h' ) { ppc_md.halt (); -else if (cmd =='p' ) + }else if (cmd =='p' ) {if (pm_power_off)pm_power_off (); + } }static int cpu_cmd (void )
Signature · 1 line
2.9.5
PATCH 2/2 powerpc/powernv: Allow manually invoking special reboots
OPAL provides several different kinds of reboot for the kernel to use, namely forcing a full reboot, platform error reboot and MPIPL. Right now triggering the alternative resets requires some ad-hoc method such as triggering a kernel crash and hoping the stars align. It's sometimes handy to be able to trigger one of these resets directly, so add a way to do that.
--- arch/powerpc/platforms/powernv/setup.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/powerpc/platforms/powernv/setup.c +4 -0
@@ -233,6 +233,10 @@ static void __noreturn pnv_restart(char *cmd) rc =opal_cec_reboot (); else if (strcmp(cmd, "full") == 0) rc =opal_cec_reboot2 (OPAL_REBOOT_FULL_IPL ,NULL ); + else if (strcmp(cmd, "mpipl") == 0) + rc =opal_cec_reboot2 (OPAL_REBOOT_MPIPL ,NULL ); + else if (strcmp(cmd, "error") == 0) + rc =opal_cec_reboot2 (OPAL_REBOOT_PLATFORM_ERROR ,NULL ); else rc =OPAL_UNSUPPORTED ;
Signature · 1 line
2.9.5
Quoted 5 lines · Oliver O'Halloran
On PowerNV a few different kinds of reboot are supported. We'd like to be able to exercise these from xmon so allow 'zr' to take an argument, and pass that to the
ppc_md.restart()function.Signed-off-by Oliver O'Halloran <[email protected]>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/2d9b332d99b24f27f77e9ba38ce3c8beb11a81c0
cheers