]>
Commit | Line | Data |
---|---|---|
7282bee7 CZ |
1 | /* |
2 | * | |
3 | * arch/xtensa/platform-iss/setup.c | |
4 | * | |
5 | * Platform specific initialization. | |
6 | * | |
7 | * Authors: Chris Zankel <chris@zankel.net> | |
8 | * Joe Taylor <joe@tensilica.com> | |
9 | * | |
10 | * Copyright 2001 - 2005 Tensilica Inc. | |
11 | * | |
12 | * This program is free software; you can redistribute it and/or modify it | |
13 | * under the terms of the GNU General Public License as published by the | |
14 | * Free Software Foundation; either version 2 of the License, or (at your | |
15 | * option) any later version. | |
16 | * | |
17 | */ | |
7282bee7 CZ |
18 | #include <linux/stddef.h> |
19 | #include <linux/kernel.h> | |
20 | #include <linux/init.h> | |
21 | #include <linux/errno.h> | |
22 | #include <linux/reboot.h> | |
7282bee7 CZ |
23 | #include <linux/kdev_t.h> |
24 | #include <linux/types.h> | |
25 | #include <linux/major.h> | |
26 | #include <linux/blkdev.h> | |
27 | #include <linux/console.h> | |
28 | #include <linux/delay.h> | |
29 | #include <linux/stringify.h> | |
30 | #include <linux/notifier.h> | |
31 | ||
32 | #include <asm/platform.h> | |
33 | #include <asm/bootparam.h> | |
34 | ||
35 | ||
36 | void __init platform_init(bp_tag_t* bootparam) | |
37 | { | |
38 | ||
39 | } | |
40 | ||
41 | void platform_halt(void) | |
42 | { | |
23753171 MF |
43 | pr_info(" ** Called platform_halt() **\n"); |
44 | __asm__ __volatile__("movi a2, 1\nsimcall\n"); | |
7282bee7 CZ |
45 | } |
46 | ||
47 | void platform_power_off(void) | |
48 | { | |
23753171 MF |
49 | pr_info(" ** Called platform_power_off() **\n"); |
50 | __asm__ __volatile__("movi a2, 1\nsimcall\n"); | |
7282bee7 CZ |
51 | } |
52 | void platform_restart(void) | |
53 | { | |
54 | /* Flush and reset the mmu, simulate a processor reset, and | |
55 | * jump to the reset vector. */ | |
56 | ||
57 | __asm__ __volatile__("movi a2, 15\n\t" | |
bc5378fc | 58 | "wsr a2, icountlevel\n\t" |
7282bee7 | 59 | "movi a2, 0\n\t" |
bc5378fc | 60 | "wsr a2, icount\n\t" |
d83ff0bb | 61 | #if XCHAL_NUM_IBREAK > 0 |
bc5378fc | 62 | "wsr a2, ibreakenable\n\t" |
d83ff0bb | 63 | #endif |
bc5378fc | 64 | "wsr a2, lcount\n\t" |
7282bee7 | 65 | "movi a2, 0x1f\n\t" |
bc5378fc | 66 | "wsr a2, ps\n\t" |
7282bee7 CZ |
67 | "isync\n\t" |
68 | "jx %0\n\t" | |
69 | : | |
70 | : "a" (XCHAL_RESET_VECTOR_VADDR) | |
71 | : "a2"); | |
72 | ||
73 | /* control never gets here */ | |
74 | } | |
75 | ||
76 | extern void iss_net_poll(void); | |
77 | ||
78 | const char twirl[]="|/-\\|/-\\"; | |
79 | ||
80 | void platform_heartbeat(void) | |
81 | { | |
82 | #if 0 | |
83 | static int i = 0, j = 0; | |
84 | ||
85 | if (--i < 0) { | |
86 | i = 99; | |
87 | printk("\r%c\r", twirl[j++]); | |
88 | if (j == 8) | |
89 | j = 0; | |
90 | } | |
91 | #endif | |
92 | } | |
93 | ||
94 | ||
95 | ||
96 | static int | |
97 | iss_panic_event(struct notifier_block *this, unsigned long event, void *ptr) | |
98 | { | |
99 | __asm__ __volatile__("movi a2, -1; simcall\n"); | |
100 | return NOTIFY_DONE; | |
101 | } | |
102 | ||
103 | static struct notifier_block iss_panic_block = { | |
104 | iss_panic_event, | |
105 | NULL, | |
106 | 0 | |
107 | }; | |
108 | ||
109 | void __init platform_setup(char **p_cmdline) | |
110 | { | |
e041c683 | 111 | atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block); |
7282bee7 | 112 | } |