Commit cdb3592a authored by David S. Miller's avatar David S. Miller

sparc64: Move reboot handling into seperate file and kill power reg programming.

We should always use prom_power_off().
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e822358a
#ifndef _SPARC64_REBOOT_H
#define _SPARC64_REBOOT_H
extern void machine_alt_power_off(void);
#endif /* _SPARC64_REBOOT_H */
...@@ -7,7 +7,7 @@ EXTRA_CFLAGS := -Werror ...@@ -7,7 +7,7 @@ EXTRA_CFLAGS := -Werror
extra-y := head.o init_task.o vmlinux.lds extra-y := head.o init_task.o vmlinux.lds
obj-y := process.o setup.o cpu.o idprom.o \ obj-y := process.o setup.o cpu.o idprom.o reboot.o \
traps.o auxio.o una_asm.o sysfs.o iommu.o \ traps.o auxio.o una_asm.o sysfs.o iommu.o \
irq.o ptrace.o time.o sys_sparc.o signal.o \ irq.o ptrace.o time.o sys_sparc.o signal.o \
unaligned.o central.o starfire.o \ unaligned.o central.o starfire.o \
......
...@@ -7,21 +7,11 @@ ...@@ -7,21 +7,11 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pm.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <asm/auxio.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/sstate.h>
#include <asm/reboot.h>
/*
* sysctl - toggle power-off restriction for serial console
* systems in machine_power_off()
*/
int scons_pwroff = 1;
static void __iomem *power_reg; static void __iomem *power_reg;
...@@ -33,31 +23,6 @@ static irqreturn_t power_handler(int irq, void *dev_id) ...@@ -33,31 +23,6 @@ static irqreturn_t power_handler(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static void (*poweroff_method)(void) = machine_alt_power_off;
void machine_power_off(void)
{
sstate_poweroff();
if (strcmp(of_console_device->type, "serial") || scons_pwroff) {
if (power_reg) {
/* Both register bits seem to have the
* same effect, so until I figure out
* what the difference is...
*/
writel(AUXIO_PCIO_CPWR_OFF | AUXIO_PCIO_SPWR_OFF, power_reg);
} else {
if (poweroff_method != NULL) {
poweroff_method();
/* not reached */
}
}
}
machine_halt();
}
void (*pm_power_off)(void) = machine_power_off;
EXPORT_SYMBOL(pm_power_off);
static int __init has_button_interrupt(unsigned int irq, struct device_node *dp) static int __init has_button_interrupt(unsigned int irq, struct device_node *dp)
{ {
if (irq == 0xffffffff) if (irq == 0xffffffff)
...@@ -78,8 +43,6 @@ static int __devinit power_probe(struct of_device *op, const struct of_device_id ...@@ -78,8 +43,6 @@ static int __devinit power_probe(struct of_device *op, const struct of_device_id
printk(KERN_INFO "%s: Control reg at %lx\n", printk(KERN_INFO "%s: Control reg at %lx\n",
op->node->name, res->start); op->node->name, res->start);
poweroff_method = machine_halt; /* able to use the standard halt */
if (has_button_interrupt(irq, op->node)) { if (has_button_interrupt(irq, op->node)) {
if (request_irq(irq, if (request_irq(irq,
power_handler, 0, "power", NULL) < 0) power_handler, 0, "power", NULL) < 0)
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/user.h> #include <linux/user.h>
#include <linux/reboot.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/tick.h> #include <linux/tick.h>
...@@ -31,7 +30,6 @@ ...@@ -31,7 +30,6 @@
#include <linux/elfcore.h> #include <linux/elfcore.h>
#include <linux/sysrq.h> #include <linux/sysrq.h>
#include <asm/oplib.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/page.h> #include <asm/page.h>
...@@ -46,8 +44,6 @@ ...@@ -46,8 +44,6 @@
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <asm/hypervisor.h> #include <asm/hypervisor.h>
#include <asm/sstate.h>
#include <asm/reboot.h>
#include <asm/syscalls.h> #include <asm/syscalls.h>
#include <asm/irq_regs.h> #include <asm/irq_regs.h>
#include <asm/smp.h> #include <asm/smp.h>
...@@ -115,35 +111,6 @@ void cpu_idle(void) ...@@ -115,35 +111,6 @@ void cpu_idle(void)
} }
} }
void machine_halt(void)
{
sstate_halt();
prom_halt();
panic("Halt failed!");
}
void machine_alt_power_off(void)
{
sstate_poweroff();
prom_halt_power_off();
panic("Power-off failed!");
}
void machine_restart(char * cmd)
{
char *p;
sstate_reboot();
p = strchr (reboot_command, '\n');
if (p) *p = 0;
if (cmd)
prom_reboot(cmd);
if (*reboot_command)
prom_reboot(reboot_command);
prom_reboot("");
panic("Reboot failed!");
}
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
static void show_regwindow32(struct pt_regs *regs) static void show_regwindow32(struct pt_regs *regs)
{ {
......
/* reboot.c: reboot/shutdown/halt/poweroff handling
*
* Copyright (C) 2008 David S. Miller <davem@davemloft.net>
*/
#include <linux/kernel.h>
#include <linux/reboot.h>
#include <linux/module.h>
#include <linux/pm.h>
#include <asm/sstate.h>
#include <asm/oplib.h>
#include <asm/prom.h>
/* sysctl - toggle power-off restriction for serial console
* systems in machine_power_off()
*/
int scons_pwroff = 1;
/* This isn't actually used, it exists merely to satisfy the
* reference in kernel/sys.c
*/
void (*pm_power_off)(void) = machine_power_off;
EXPORT_SYMBOL(pm_power_off);
void machine_power_off(void)
{
sstate_poweroff();
if (strcmp(of_console_device->type, "serial") || scons_pwroff)
prom_halt_power_off();
prom_halt();
}
void machine_halt(void)
{
sstate_halt();
prom_halt();
panic("Halt failed!");
}
void machine_restart(char *cmd)
{
char *p;
sstate_reboot();
p = strchr(reboot_command, '\n');
if (p)
*p = 0;
if (cmd)
prom_reboot(cmd);
if (*reboot_command)
prom_reboot(reboot_command);
prom_reboot("");
panic("Reboot failed!");
}
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