Commit fde5efd0 authored by Geoff Levand's avatar Geoff Levand Committed by Paul Mackerras

[POWERPC] PS3: System manager support

Add PS3 system manager support and the ppc_md routines restart() and
power_off().

The system manager provides an event notification mechanism for reporting
events like thermal alert and button presses.  It also provides support to
control system shutdown and startup.
Signed-off-by: default avatarGeoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent ea1547d3
...@@ -62,4 +62,14 @@ config PS3_PS3AV ...@@ -62,4 +62,14 @@ config PS3_PS3AV
This support is required for graphics and sound. In This support is required for graphics and sound. In
general, all users will say Y or M. general, all users will say Y or M.
config PS3_SYS_MANAGER
bool "PS3 System Manager driver"
select PS3_VUART
default y
help
Include support for the PS3 System Manager.
This support is required for system control. In
general, all users will say Y.
endmenu endmenu
...@@ -42,6 +42,10 @@ ...@@ -42,6 +42,10 @@
#define DBG(fmt...) do{if(0)printk(fmt);}while(0) #define DBG(fmt...) do{if(0)printk(fmt);}while(0)
#endif #endif
#if !defined(CONFIG_SMP)
static void smp_send_stop(void) {}
#endif
int ps3_get_firmware_version(union ps3_firmware_version *v) int ps3_get_firmware_version(union ps3_firmware_version *v)
{ {
int result = lv1_get_version_info(&v->raw); int result = lv1_get_version_info(&v->raw);
...@@ -66,22 +70,35 @@ static void ps3_power_save(void) ...@@ -66,22 +70,35 @@ static void ps3_power_save(void)
lv1_pause(0); lv1_pause(0);
} }
static void ps3_restart(char *cmd)
{
DBG("%s:%d cmd '%s'\n", __func__, __LINE__, cmd);
smp_send_stop();
ps3_sys_manager_restart(); /* never returns */
}
static void ps3_power_off(void)
{
DBG("%s:%d\n", __func__, __LINE__);
smp_send_stop();
ps3_sys_manager_power_off(); /* never returns */
}
static void ps3_panic(char *str) static void ps3_panic(char *str)
{ {
DBG("%s:%d %s\n", __func__, __LINE__, str); DBG("%s:%d %s\n", __func__, __LINE__, str);
#ifdef CONFIG_SMP
smp_send_stop(); smp_send_stop();
#endif
printk("\n"); printk("\n");
printk(" System does not reboot automatically.\n"); printk(" System does not reboot automatically.\n");
printk(" Please press POWER button.\n"); printk(" Please press POWER button.\n");
printk("\n"); printk("\n");
for (;;) ; while(1);
} }
static void prealloc(struct ps3_prealloc *p) static void prealloc(struct ps3_prealloc *p)
{ {
if (!p->size) if (!p->size)
...@@ -219,6 +236,8 @@ define_machine(ps3) { ...@@ -219,6 +236,8 @@ define_machine(ps3) {
.get_rtc_time = ps3_get_rtc_time, .get_rtc_time = ps3_get_rtc_time,
.calibrate_decr = ps3_calibrate_decr, .calibrate_decr = ps3_calibrate_decr,
.progress = ps3_progress, .progress = ps3_progress,
.restart = ps3_restart,
.power_off = ps3_power_off,
#if defined(CONFIG_KEXEC) #if defined(CONFIG_KEXEC)
.kexec_cpu_down = ps3_kexec_cpu_down, .kexec_cpu_down = ps3_kexec_cpu_down,
.machine_kexec = ps3_machine_kexec, .machine_kexec = ps3_machine_kexec,
......
obj-$(CONFIG_PS3_VUART) += vuart.o obj-$(CONFIG_PS3_VUART) += vuart.o
obj-$(CONFIG_PS3_PS3AV) += ps3av.o ps3av_cmd.o obj-$(CONFIG_PS3_PS3AV) += ps3av.o ps3av_cmd.o
obj-$(CONFIG_PS3_SYS_MANAGER) += sys-manager.o
This diff is collapsed.
...@@ -370,6 +370,11 @@ struct ps3_vuart_port_device { ...@@ -370,6 +370,11 @@ struct ps3_vuart_port_device {
int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev); int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev);
/* system manager */
void ps3_sys_manager_restart(void);
void ps3_sys_manager_power_off(void);
struct ps3_prealloc { struct ps3_prealloc {
const char *name; const char *name;
void *address; void *address;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment