Hi Ralf,
This patch has updated reset operations for Cobalt.
Yoichi
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
diff -pruN -X mips/Documentation/dontdiff
mips-orig/arch/mips/gt64120/cobalt/reset.c mips/arch/mips/gt64120/cobalt/reset.c
--- mips-orig/arch/mips/gt64120/cobalt/reset.c 2006-08-19 00:03:23.634606250
+0900
+++ mips/arch/mips/gt64120/cobalt/reset.c 2006-08-18 23:51:45.647500500
+0900
@@ -8,17 +8,15 @@
* Copyright (C) 1995, 1996, 1997 by Ralf Baechle
* Copyright (C) 2001 by Liam Davies (ldavies@agile.tv)
*/
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <asm/cacheflush.h>
-#include <asm/io.h>
-#include <asm/processor.h>
+#include <linux/init.h>
+#include <linux/jiffies.h>
+#include <linux/pm.h>
+
#include <asm/reboot.h>
-#include <asm/system.h>
-#include <asm/mipsregs.h>
-#include <asm/mach-cobalt/cobalt.h>
-void cobalt_machine_halt(void)
+#include <cobalt.h>
+
+static void cobalt_machine_halt(void)
{
int state, last, diff;
unsigned long mark;
@@ -39,7 +37,8 @@ void cobalt_machine_halt(void)
diff = COBALT_KEY_PORT ^ last;
last ^= diff;
- if((diff & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)) && !(~last &
(COBALT_KEY_ENTER | COBALT_KEY_SELECT)))
+ if((diff & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)) &&
+ !(~last & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)))
COBALT_LED_PORT = COBALT_LED_RESET;
for (mark = jiffies; jiffies - mark < HZ;)
@@ -47,7 +46,7 @@ void cobalt_machine_halt(void)
}
}
-void cobalt_machine_restart(char *command)
+static void cobalt_machine_restart(char *command)
{
COBALT_LED_PORT = COBALT_LED_RESET;
@@ -58,8 +57,19 @@ void cobalt_machine_restart(char *comman
/*
* This triggers the luser mode device driver for the power switch ;-)
*/
-void cobalt_machine_power_off(void)
+static void cobalt_machine_power_off(void)
{
printk("You can switch the machine off now.\n");
cobalt_machine_halt();
}
+
+static int __init cobalt_reset_init(void)
+{
+ _machine_restart = cobalt_machine_restart;
+ _machine_halt = cobalt_machine_halt;
+ pm_power_off = cobalt_machine_power_off;
+
+ return 0;
+}
+
+arch_initcall(cobalt_reset_init);
diff -pruN -X mips/Documentation/dontdiff
mips-orig/arch/mips/gt64120/cobalt/setup.c mips/arch/mips/gt64120/cobalt/setup.c
--- mips-orig/arch/mips/gt64120/cobalt/setup.c 2006-08-19 00:03:23.710573000
+0900
+++ mips/arch/mips/gt64120/cobalt/setup.c 2006-08-19 00:01:35.813798500
+0900
@@ -12,7 +12,6 @@
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/init.h>
-#include <linux/pm.h>
#include <linux/serial.h>
#include <linux/serial_core.h>
@@ -21,15 +20,11 @@
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/processor.h>
-#include <asm/reboot.h>
#include <asm/gt64120.h>
#include <asm/serial.h>
#include <cobalt.h>
-extern void cobalt_machine_restart(char *command);
-extern void cobalt_machine_halt(void);
-extern void cobalt_machine_power_off(void);
extern void cobalt_early_console(void);
int cobalt_board_id;
@@ -116,10 +111,6 @@ void __init plat_mem_setup(void)
unsigned int devfn = PCI_DEVFN(COBALT_PCICONF_VIA, 0);
int i;
- _machine_restart = cobalt_machine_restart;
- _machine_halt = cobalt_machine_halt;
- pm_power_off = cobalt_machine_power_off;
-
gt641xx_disable_alltimers();
board_time_init = gt641xx_timer3_init;
|