diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2007-02-07 15:20:01 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-02-15 22:00:19 -0500 |
commit | fde5efd0e50e026f3f69629fc5790a4f0533dcaa (patch) | |
tree | 865d49e09e04691a9e66c5cb75f14862bee311ed /arch/powerpc | |
parent | ea1547d31153f8c3bdd32646f17d096d3108c838 (diff) |
[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: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/ps3/Kconfig | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/setup.c | 27 |
2 files changed, 33 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/ps3/Kconfig b/arch/powerpc/platforms/ps3/Kconfig index 4be3943d1c0d..d270a1e374d5 100644 --- a/arch/powerpc/platforms/ps3/Kconfig +++ b/arch/powerpc/platforms/ps3/Kconfig | |||
@@ -62,4 +62,14 @@ config PS3_PS3AV | |||
62 | This support is required for graphics and sound. In | 62 | This support is required for graphics and sound. In |
63 | general, all users will say Y or M. | 63 | general, all users will say Y or M. |
64 | 64 | ||
65 | config PS3_SYS_MANAGER | ||
66 | bool "PS3 System Manager driver" | ||
67 | select PS3_VUART | ||
68 | default y | ||
69 | help | ||
70 | Include support for the PS3 System Manager. | ||
71 | |||
72 | This support is required for system control. In | ||
73 | general, all users will say Y. | ||
74 | |||
65 | endmenu | 75 | endmenu |
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c index 13d669a8ecae..ac5df9688dcb 100644 --- a/arch/powerpc/platforms/ps3/setup.c +++ b/arch/powerpc/platforms/ps3/setup.c | |||
@@ -42,6 +42,10 @@ | |||
42 | #define DBG(fmt...) do{if(0)printk(fmt);}while(0) | 42 | #define DBG(fmt...) do{if(0)printk(fmt);}while(0) |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | #if !defined(CONFIG_SMP) | ||
46 | static void smp_send_stop(void) {} | ||
47 | #endif | ||
48 | |||
45 | int ps3_get_firmware_version(union ps3_firmware_version *v) | 49 | int ps3_get_firmware_version(union ps3_firmware_version *v) |
46 | { | 50 | { |
47 | int result = lv1_get_version_info(&v->raw); | 51 | int result = lv1_get_version_info(&v->raw); |
@@ -66,22 +70,35 @@ static void ps3_power_save(void) | |||
66 | lv1_pause(0); | 70 | lv1_pause(0); |
67 | } | 71 | } |
68 | 72 | ||
73 | static void ps3_restart(char *cmd) | ||
74 | { | ||
75 | DBG("%s:%d cmd '%s'\n", __func__, __LINE__, cmd); | ||
76 | |||
77 | smp_send_stop(); | ||
78 | ps3_sys_manager_restart(); /* never returns */ | ||
79 | } | ||
80 | |||
81 | static void ps3_power_off(void) | ||
82 | { | ||
83 | DBG("%s:%d\n", __func__, __LINE__); | ||
84 | |||
85 | smp_send_stop(); | ||
86 | ps3_sys_manager_power_off(); /* never returns */ | ||
87 | } | ||
88 | |||
69 | static void ps3_panic(char *str) | 89 | static void ps3_panic(char *str) |
70 | { | 90 | { |
71 | DBG("%s:%d %s\n", __func__, __LINE__, str); | 91 | DBG("%s:%d %s\n", __func__, __LINE__, str); |
72 | 92 | ||
73 | #ifdef CONFIG_SMP | ||
74 | smp_send_stop(); | 93 | smp_send_stop(); |
75 | #endif | ||
76 | printk("\n"); | 94 | printk("\n"); |
77 | printk(" System does not reboot automatically.\n"); | 95 | printk(" System does not reboot automatically.\n"); |
78 | printk(" Please press POWER button.\n"); | 96 | printk(" Please press POWER button.\n"); |
79 | printk("\n"); | 97 | printk("\n"); |
80 | 98 | ||
81 | for (;;) ; | 99 | while(1); |
82 | } | 100 | } |
83 | 101 | ||
84 | |||
85 | static void prealloc(struct ps3_prealloc *p) | 102 | static void prealloc(struct ps3_prealloc *p) |
86 | { | 103 | { |
87 | if (!p->size) | 104 | if (!p->size) |
@@ -219,6 +236,8 @@ define_machine(ps3) { | |||
219 | .get_rtc_time = ps3_get_rtc_time, | 236 | .get_rtc_time = ps3_get_rtc_time, |
220 | .calibrate_decr = ps3_calibrate_decr, | 237 | .calibrate_decr = ps3_calibrate_decr, |
221 | .progress = ps3_progress, | 238 | .progress = ps3_progress, |
239 | .restart = ps3_restart, | ||
240 | .power_off = ps3_power_off, | ||
222 | #if defined(CONFIG_KEXEC) | 241 | #if defined(CONFIG_KEXEC) |
223 | .kexec_cpu_down = ps3_kexec_cpu_down, | 242 | .kexec_cpu_down = ps3_kexec_cpu_down, |
224 | .machine_kexec = ps3_machine_kexec, | 243 | .machine_kexec = ps3_machine_kexec, |