aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/prom/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/prom/misc.c')
-rw-r--r--arch/sparc64/prom/misc.c46
1 files changed, 16 insertions, 30 deletions
diff --git a/arch/sparc64/prom/misc.c b/arch/sparc64/prom/misc.c
index 19c44e97e9ee..87f5cfce23bb 100644
--- a/arch/sparc64/prom/misc.c
+++ b/arch/sparc64/prom/misc.c
@@ -17,14 +17,14 @@
17#include <asm/system.h> 17#include <asm/system.h>
18 18
19/* Reset and reboot the machine with the command 'bcommand'. */ 19/* Reset and reboot the machine with the command 'bcommand'. */
20void prom_reboot(char *bcommand) 20void prom_reboot(const char *bcommand)
21{ 21{
22 p1275_cmd("boot", P1275_ARG(0, P1275_ARG_IN_STRING) | 22 p1275_cmd("boot", P1275_ARG(0, P1275_ARG_IN_STRING) |
23 P1275_INOUT(1, 0), bcommand); 23 P1275_INOUT(1, 0), bcommand);
24} 24}
25 25
26/* Forth evaluate the expression contained in 'fstring'. */ 26/* Forth evaluate the expression contained in 'fstring'. */
27void prom_feval(char *fstring) 27void prom_feval(const char *fstring)
28{ 28{
29 if (!fstring || fstring[0] == 0) 29 if (!fstring || fstring[0] == 0)
30 return; 30 return;
@@ -68,19 +68,11 @@ void prom_cmdline(void)
68 local_irq_restore(flags); 68 local_irq_restore(flags);
69} 69}
70 70
71#ifdef CONFIG_SMP
72extern void smp_promstop_others(void);
73#endif
74
75/* Drop into the prom, but completely terminate the program. 71/* Drop into the prom, but completely terminate the program.
76 * No chance of continuing. 72 * No chance of continuing.
77 */ 73 */
78void prom_halt(void) 74void prom_halt(void)
79{ 75{
80#ifdef CONFIG_SMP
81 smp_promstop_others();
82 udelay(8000);
83#endif
84again: 76again:
85 p1275_cmd("exit", P1275_INOUT(0, 0)); 77 p1275_cmd("exit", P1275_INOUT(0, 0));
86 goto again; /* PROM is out to get me -DaveM */ 78 goto again; /* PROM is out to get me -DaveM */
@@ -88,10 +80,6 @@ again:
88 80
89void prom_halt_power_off(void) 81void prom_halt_power_off(void)
90{ 82{
91#ifdef CONFIG_SMP
92 smp_promstop_others();
93 udelay(8000);
94#endif
95 p1275_cmd("SUNW,power-off", P1275_INOUT(0, 0)); 83 p1275_cmd("SUNW,power-off", P1275_INOUT(0, 0));
96 84
97 /* if nothing else helps, we just halt */ 85 /* if nothing else helps, we just halt */
@@ -148,21 +136,19 @@ void prom_set_trap_table(unsigned long tba)
148 p1275_cmd("SUNW,set-trap-table", P1275_INOUT(1, 0), tba); 136 p1275_cmd("SUNW,set-trap-table", P1275_INOUT(1, 0), tba);
149} 137}
150 138
151int mmu_ihandle_cache = 0;
152
153int prom_get_mmu_ihandle(void) 139int prom_get_mmu_ihandle(void)
154{ 140{
155 int node, ret; 141 int node, ret;
156 142
157 if (mmu_ihandle_cache != 0) 143 if (prom_mmu_ihandle_cache != 0)
158 return mmu_ihandle_cache; 144 return prom_mmu_ihandle_cache;
159 145
160 node = prom_finddevice("/chosen"); 146 node = prom_finddevice(prom_chosen_path);
161 ret = prom_getint(node, "mmu"); 147 ret = prom_getint(node, prom_mmu_name);
162 if (ret == -1 || ret == 0) 148 if (ret == -1 || ret == 0)
163 mmu_ihandle_cache = -1; 149 prom_mmu_ihandle_cache = -1;
164 else 150 else
165 mmu_ihandle_cache = ret; 151 prom_mmu_ihandle_cache = ret;
166 152
167 return ret; 153 return ret;
168} 154}
@@ -190,7 +176,7 @@ long prom_itlb_load(unsigned long index,
190 unsigned long tte_data, 176 unsigned long tte_data,
191 unsigned long vaddr) 177 unsigned long vaddr)
192{ 178{
193 return p1275_cmd("call-method", 179 return p1275_cmd(prom_callmethod_name,
194 (P1275_ARG(0, P1275_ARG_IN_STRING) | 180 (P1275_ARG(0, P1275_ARG_IN_STRING) |
195 P1275_ARG(2, P1275_ARG_IN_64B) | 181 P1275_ARG(2, P1275_ARG_IN_64B) |
196 P1275_ARG(3, P1275_ARG_IN_64B) | 182 P1275_ARG(3, P1275_ARG_IN_64B) |
@@ -207,7 +193,7 @@ long prom_dtlb_load(unsigned long index,
207 unsigned long tte_data, 193 unsigned long tte_data,
208 unsigned long vaddr) 194 unsigned long vaddr)
209{ 195{
210 return p1275_cmd("call-method", 196 return p1275_cmd(prom_callmethod_name,
211 (P1275_ARG(0, P1275_ARG_IN_STRING) | 197 (P1275_ARG(0, P1275_ARG_IN_STRING) |
212 P1275_ARG(2, P1275_ARG_IN_64B) | 198 P1275_ARG(2, P1275_ARG_IN_64B) |
213 P1275_ARG(3, P1275_ARG_IN_64B) | 199 P1275_ARG(3, P1275_ARG_IN_64B) |
@@ -223,13 +209,13 @@ long prom_dtlb_load(unsigned long index,
223int prom_map(int mode, unsigned long size, 209int prom_map(int mode, unsigned long size,
224 unsigned long vaddr, unsigned long paddr) 210 unsigned long vaddr, unsigned long paddr)
225{ 211{
226 int ret = p1275_cmd("call-method", 212 int ret = p1275_cmd(prom_callmethod_name,
227 (P1275_ARG(0, P1275_ARG_IN_STRING) | 213 (P1275_ARG(0, P1275_ARG_IN_STRING) |
228 P1275_ARG(3, P1275_ARG_IN_64B) | 214 P1275_ARG(3, P1275_ARG_IN_64B) |
229 P1275_ARG(4, P1275_ARG_IN_64B) | 215 P1275_ARG(4, P1275_ARG_IN_64B) |
230 P1275_ARG(6, P1275_ARG_IN_64B) | 216 P1275_ARG(6, P1275_ARG_IN_64B) |
231 P1275_INOUT(7, 1)), 217 P1275_INOUT(7, 1)),
232 "map", 218 prom_map_name,
233 prom_get_mmu_ihandle(), 219 prom_get_mmu_ihandle(),
234 mode, 220 mode,
235 size, 221 size,
@@ -244,12 +230,12 @@ int prom_map(int mode, unsigned long size,
244 230
245void prom_unmap(unsigned long size, unsigned long vaddr) 231void prom_unmap(unsigned long size, unsigned long vaddr)
246{ 232{
247 p1275_cmd("call-method", 233 p1275_cmd(prom_callmethod_name,
248 (P1275_ARG(0, P1275_ARG_IN_STRING) | 234 (P1275_ARG(0, P1275_ARG_IN_STRING) |
249 P1275_ARG(2, P1275_ARG_IN_64B) | 235 P1275_ARG(2, P1275_ARG_IN_64B) |
250 P1275_ARG(3, P1275_ARG_IN_64B) | 236 P1275_ARG(3, P1275_ARG_IN_64B) |
251 P1275_INOUT(4, 0)), 237 P1275_INOUT(4, 0)),
252 "unmap", 238 prom_unmap_name,
253 prom_get_mmu_ihandle(), 239 prom_get_mmu_ihandle(),
254 size, 240 size,
255 vaddr); 241 vaddr);
@@ -258,7 +244,7 @@ void prom_unmap(unsigned long size, unsigned long vaddr)
258/* Set aside physical memory which is not touched or modified 244/* Set aside physical memory which is not touched or modified
259 * across soft resets. 245 * across soft resets.
260 */ 246 */
261unsigned long prom_retain(char *name, 247unsigned long prom_retain(const char *name,
262 unsigned long pa_low, unsigned long pa_high, 248 unsigned long pa_low, unsigned long pa_high,
263 long size, long align) 249 long size, long align)
264{ 250{
@@ -290,7 +276,7 @@ int prom_getunumber(int syndrome_code,
290 unsigned long phys_addr, 276 unsigned long phys_addr,
291 char *buf, int buflen) 277 char *buf, int buflen)
292{ 278{
293 return p1275_cmd("call-method", 279 return p1275_cmd(prom_callmethod_name,
294 (P1275_ARG(0, P1275_ARG_IN_STRING) | 280 (P1275_ARG(0, P1275_ARG_IN_STRING) |
295 P1275_ARG(3, P1275_ARG_OUT_BUF) | 281 P1275_ARG(3, P1275_ARG_OUT_BUF) |
296 P1275_ARG(6, P1275_ARG_IN_64B) | 282 P1275_ARG(6, P1275_ARG_IN_64B) |