Re: [PATCH 3/3] PS3: System manager support
From: Michael Ellerman <hidden>
Date: 2007-02-07 00:00:35
On Tue, 2007-02-06 at 14:23 -0800, Geoff Levand wrote:
quoted hunk ↗ jump to hunk
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 <redacted> --- arch/powerpc/platforms/ps3/Kconfig | 10 arch/powerpc/platforms/ps3/setup.c | 27 + drivers/ps3/Makefile | 1 drivers/ps3/sys-manager.c | 621 +++++++++++++++++++++++++++++++++++++ include/asm-powerpc/ps3.h | 5 5 files changed, 660 insertions(+), 4 deletions(-)--- ps3-linux-dev.orig/arch/powerpc/platforms/ps3/Kconfig +++ ps3-linux-dev/arch/powerpc/platforms/ps3/Kconfig@@ -61,4 +61,14 @@ config PS3_PS3AV This support is required for graphics and sound. In general, all users will say Y or M. +config PS3_SYS_MANAGER + tristate "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 or M. + endmenu --- ps3-linux-dev.orig/arch/powerpc/platforms/ps3/setup.c +++ ps3-linux-dev/arch/powerpc/platforms/ps3/setup.c@@ -42,6 +42,10 @@ #define DBG(fmt...) do{if(0)printk(fmt);}while(0) #endif +#if !defined(CONFIG_SMP) +static void smp_send_stop(void) {} +#endif + int ps3_get_firmware_version(union ps3_firmware_version *v) { int result = lv1_get_version_info(&v->raw);@@ -66,22 +70,35 @@ static void ps3_power_save(void) 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 */ +}
What happens here when the sys manager stuff is built as a module ? cheers -- Michael Ellerman OzLabs, IBM Australia Development Lab wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person
Attachments
- signature.asc [application/pgp-signature] 189 bytes