Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91484
b: refs/heads/master
c: ca052f7
h: refs/heads/master
v: v3
  • Loading branch information
Geert Uytterhoeven authored and Paul Mackerras committed Apr 1, 2008
1 parent 8b37c18 commit 8ba93af
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5761eaa3a5ae3c7ea796add73b86176b7c963cca
refs/heads/master: ca052f7924141f34998ab440bb4d908dc021a46b
12 changes: 11 additions & 1 deletion trunk/arch/powerpc/platforms/ps3/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ static void ps3_power_off(void)
ps3_sys_manager_power_off(); /* never returns */
}

static void ps3_halt(void)
{
DBG("%s:%d\n", __func__, __LINE__);

smp_send_stop();
ps3_sys_manager_halt(); /* never returns */
}

static void ps3_panic(char *str)
{
DBG("%s:%d %s\n", __func__, __LINE__, str);
Expand All @@ -105,7 +113,8 @@ static void ps3_panic(char *str)
printk(" Please press POWER button.\n");
printk("\n");

while(1);
while(1)
lv1_pause(1);
}

#if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) || \
Expand Down Expand Up @@ -266,6 +275,7 @@ define_machine(ps3) {
.progress = ps3_progress,
.restart = ps3_restart,
.power_off = ps3_power_off,
.halt = ps3_halt,
#if defined(CONFIG_KEXEC)
.kexec_cpu_down = ps3_kexec_cpu_down,
.machine_kexec = default_machine_kexec,
Expand Down
30 changes: 20 additions & 10 deletions trunk/drivers/ps3/ps3-sys-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/reboot.h>

#include <asm/firmware.h>
#include <asm/lv1call.h>
#include <asm/ps3.h>

#include "vuart.h"
Expand Down Expand Up @@ -581,6 +582,23 @@ static int ps3_sys_manager_handle_msg(struct ps3_system_bus_device *dev)
return -EIO;
}

static void ps3_sys_manager_fin(struct ps3_system_bus_device *dev)
{
ps3_sys_manager_send_request_shutdown(dev);

pr_emerg("System Halted, OK to turn off power\n");

while (ps3_sys_manager_handle_msg(dev)) {
/* pause until next DEC interrupt */
lv1_pause(0);
}

while (1) {
/* pause, ignoring DEC interrupt */
lv1_pause(1);
}
}

/**
* ps3_sys_manager_final_power_off - The final platform machine_power_off routine.
*
Expand All @@ -602,12 +620,8 @@ static void ps3_sys_manager_final_power_off(struct ps3_system_bus_device *dev)

ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_SHUTDOWN,
PS3_SM_WAKE_DEFAULT);
ps3_sys_manager_send_request_shutdown(dev);

pr_emerg("System Halted, OK to turn off power\n");

while (1)
ps3_sys_manager_handle_msg(dev);
ps3_sys_manager_fin(dev);
}

/**
Expand Down Expand Up @@ -639,12 +653,8 @@ static void ps3_sys_manager_final_restart(struct ps3_system_bus_device *dev)
ps3_sys_manager_send_attr(dev, 0);
ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_REBOOT,
PS3_SM_WAKE_DEFAULT);
ps3_sys_manager_send_request_shutdown(dev);

pr_emerg("System Halted, OK to turn off power\n");

while (1)
ps3_sys_manager_handle_msg(dev);
ps3_sys_manager_fin(dev);
}

/**
Expand Down
16 changes: 10 additions & 6 deletions trunk/drivers/ps3/sys-manager-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <linux/kernel.h>
#include <asm/lv1call.h>
#include <asm/ps3.h>

/**
Expand Down Expand Up @@ -50,19 +51,22 @@ void ps3_sys_manager_power_off(void)
if (ps3_sys_manager_ops.power_off)
ps3_sys_manager_ops.power_off(ps3_sys_manager_ops.dev);

printk(KERN_EMERG "System Halted, OK to turn off power\n");
local_irq_disable();
while (1)
(void)0;
ps3_sys_manager_halt();
}

void ps3_sys_manager_restart(void)
{
if (ps3_sys_manager_ops.restart)
ps3_sys_manager_ops.restart(ps3_sys_manager_ops.dev);

printk(KERN_EMERG "System Halted, OK to turn off power\n");
ps3_sys_manager_halt();
}

void ps3_sys_manager_halt(void)
{
pr_emerg("System Halted, OK to turn off power\n");
local_irq_disable();
while (1)
(void)0;
lv1_pause(1);
}

5 changes: 3 additions & 2 deletions trunk/include/asm-powerpc/ps3.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,9 @@ struct ps3_sys_manager_ops {
};

void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops);
void ps3_sys_manager_power_off(void);
void ps3_sys_manager_restart(void);
void __noreturn ps3_sys_manager_power_off(void);
void __noreturn ps3_sys_manager_restart(void);
void __noreturn ps3_sys_manager_halt(void);

struct ps3_prealloc {
const char *name;
Expand Down

0 comments on commit 8ba93af

Please sign in to comment.