aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/txx9/rbtx4938/setup.c
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2008-07-23 11:25:17 -0400
committerRalf Baechle <ralf@linux-mips.org>2008-07-30 16:54:38 -0400
commita49297e8fc8a9a835ac4ec124aa83028abdcc7d5 (patch)
tree04b9c04589033206888789122d436e287953480c /arch/mips/txx9/rbtx4938/setup.c
parent455cc256eb23915100e203fb33ee143afd127954 (diff)
[MIPS] TXx9: Cleanup restart/halt/power_off
Unify machine_restart/machine_halt/pm_power_off and add fallback machine_halt routine. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/txx9/rbtx4938/setup.c')
-rw-r--r--arch/mips/txx9/rbtx4938/setup.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/arch/mips/txx9/rbtx4938/setup.c b/arch/mips/txx9/rbtx4938/setup.c
index 4454b7901cd..e1177b3b910 100644
--- a/arch/mips/txx9/rbtx4938/setup.c
+++ b/arch/mips/txx9/rbtx4938/setup.c
@@ -15,7 +15,6 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/console.h> 17#include <linux/console.h>
18#include <linux/pm.h>
19#include <linux/platform_device.h> 18#include <linux/platform_device.h>
20#include <linux/gpio.h> 19#include <linux/gpio.h>
21 20
@@ -28,33 +27,14 @@
28#include <asm/txx9/spi.h> 27#include <asm/txx9/spi.h>
29#include <asm/txx9pio.h> 28#include <asm/txx9pio.h>
30 29
31static void rbtx4938_machine_halt(void)
32{
33 printk(KERN_NOTICE "System Halted\n");
34 local_irq_disable();
35
36 while (1)
37 __asm__(".set\tmips3\n\t"
38 "wait\n\t"
39 ".set\tmips0");
40}
41
42static void rbtx4938_machine_power_off(void)
43{
44 rbtx4938_machine_halt();
45 /* no return */
46}
47
48static void rbtx4938_machine_restart(char *command) 30static void rbtx4938_machine_restart(char *command)
49{ 31{
50 local_irq_disable(); 32 local_irq_disable();
51
52 printk("Rebooting...");
53 writeb(1, rbtx4938_softresetlock_addr); 33 writeb(1, rbtx4938_softresetlock_addr);
54 writeb(1, rbtx4938_sfvol_addr); 34 writeb(1, rbtx4938_sfvol_addr);
55 writeb(1, rbtx4938_softreset_addr); 35 writeb(1, rbtx4938_softreset_addr);
56 while(1) 36 /* fallback */
57 ; 37 (*_machine_halt)();
58} 38}
59 39
60static void __init rbtx4938_pci_setup(void) 40static void __init rbtx4938_pci_setup(void)
@@ -263,8 +243,6 @@ static void __init rbtx4938_mem_setup(void)
263 printk("request resource for fpga failed\n"); 243 printk("request resource for fpga failed\n");
264 244
265 _machine_restart = rbtx4938_machine_restart; 245 _machine_restart = rbtx4938_machine_restart;
266 _machine_halt = rbtx4938_machine_halt;
267 pm_power_off = rbtx4938_machine_power_off;
268 246
269 writeb(0xff, rbtx4938_led_addr); 247 writeb(0xff, rbtx4938_led_addr);
270 printk(KERN_INFO "RBTX4938 --- FPGA(Rev %02x) DIPSW:%02x,%02x\n", 248 printk(KERN_INFO "RBTX4938 --- FPGA(Rev %02x) DIPSW:%02x,%02x\n",