diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/mips/cobalt/reset.c |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'arch/mips/cobalt/reset.c')
-rw-r--r-- | arch/mips/cobalt/reset.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/arch/mips/cobalt/reset.c b/arch/mips/cobalt/reset.c new file mode 100644 index 000000000000..084c8e59f42c --- /dev/null +++ b/arch/mips/cobalt/reset.c | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * Cobalt Reset operations | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1995, 1996, 1997 by Ralf Baechle | ||
9 | * Copyright (C) 2001 by Liam Davies (ldavies@agile.tv) | ||
10 | */ | ||
11 | #include <linux/sched.h> | ||
12 | #include <linux/mm.h> | ||
13 | #include <asm/cacheflush.h> | ||
14 | #include <asm/io.h> | ||
15 | #include <asm/processor.h> | ||
16 | #include <asm/reboot.h> | ||
17 | #include <asm/system.h> | ||
18 | #include <asm/mipsregs.h> | ||
19 | |||
20 | void cobalt_machine_restart(char *command) | ||
21 | { | ||
22 | *(volatile char *)0xbc000000 = 0x0f; | ||
23 | |||
24 | /* | ||
25 | * Ouch, we're still alive ... This time we take the silver bullet ... | ||
26 | * ... and find that we leave the hardware in a state in which the | ||
27 | * kernel in the flush locks up somewhen during of after the PCI | ||
28 | * detection stuff. | ||
29 | */ | ||
30 | set_c0_status(ST0_BEV | ST0_ERL); | ||
31 | change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED); | ||
32 | flush_cache_all(); | ||
33 | write_c0_wired(0); | ||
34 | __asm__ __volatile__( | ||
35 | "jr\t%0" | ||
36 | : | ||
37 | : "r" (0xbfc00000)); | ||
38 | } | ||
39 | |||
40 | extern int led_state; | ||
41 | #define kLED 0xBC000000 | ||
42 | #define LEDSet(x) (*(volatile unsigned char *) kLED) = (( unsigned char)x) | ||
43 | |||
44 | void cobalt_machine_halt(void) | ||
45 | { | ||
46 | int mark; | ||
47 | |||
48 | /* Blink our cute? little LED (number 3)... */ | ||
49 | while (1) { | ||
50 | led_state = led_state | ( 1 << 3 ); | ||
51 | LEDSet(led_state); | ||
52 | mark = jiffies; | ||
53 | while (jiffies<(mark+HZ)); | ||
54 | led_state = led_state & ~( 1 << 3 ); | ||
55 | LEDSet(led_state); | ||
56 | mark = jiffies; | ||
57 | while (jiffies<(mark+HZ)); | ||
58 | } | ||
59 | } | ||
60 | |||
61 | /* | ||
62 | * This triggers the luser mode device driver for the power switch ;-) | ||
63 | */ | ||
64 | void cobalt_machine_power_off(void) | ||
65 | { | ||
66 | printk("You can switch the machine off now.\n"); | ||
67 | cobalt_machine_halt(); | ||
68 | } | ||