mirror of https://gitee.com/openkylin/linux.git
[POWERPC] maple: Use RTAS for reboot and halt
On maple, use the RTAS "system-reboot" and "power-off" methods if they are available. Signed-off-by: Nathan Lynch <ntl@pobox.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
f2d6d2d8bb
commit
9e254c45fb
|
@ -60,6 +60,7 @@
|
||||||
#include <asm/of_device.h>
|
#include <asm/of_device.h>
|
||||||
#include <asm/lmb.h>
|
#include <asm/lmb.h>
|
||||||
#include <asm/mpic.h>
|
#include <asm/mpic.h>
|
||||||
|
#include <asm/rtas.h>
|
||||||
#include <asm/udbg.h>
|
#include <asm/udbg.h>
|
||||||
|
|
||||||
#include "maple.h"
|
#include "maple.h"
|
||||||
|
@ -166,6 +167,16 @@ struct smp_ops_t maple_smp_ops = {
|
||||||
};
|
};
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
|
|
||||||
|
static void __init maple_use_rtas_reboot_and_halt_if_present(void)
|
||||||
|
{
|
||||||
|
if (rtas_service_present("system-reboot") &&
|
||||||
|
rtas_service_present("power-off")) {
|
||||||
|
ppc_md.restart = rtas_restart;
|
||||||
|
ppc_md.power_off = rtas_power_off;
|
||||||
|
ppc_md.halt = rtas_halt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void __init maple_setup_arch(void)
|
void __init maple_setup_arch(void)
|
||||||
{
|
{
|
||||||
/* init to some ~sane value until calibrate_delay() runs */
|
/* init to some ~sane value until calibrate_delay() runs */
|
||||||
|
@ -181,6 +192,7 @@ void __init maple_setup_arch(void)
|
||||||
#ifdef CONFIG_DUMMY_CONSOLE
|
#ifdef CONFIG_DUMMY_CONSOLE
|
||||||
conswitchp = &dummy_con;
|
conswitchp = &dummy_con;
|
||||||
#endif
|
#endif
|
||||||
|
maple_use_rtas_reboot_and_halt_if_present();
|
||||||
|
|
||||||
printk(KERN_DEBUG "Using native/NAP idle loop\n");
|
printk(KERN_DEBUG "Using native/NAP idle loop\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue