diff options
Diffstat (limited to 'arch/sparc/include')
-rw-r--r-- | arch/sparc/include/asm/Kbuild | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/openprom.h | 277 | ||||
-rw-r--r-- | arch/sparc/include/asm/openprom_32.h | 234 | ||||
-rw-r--r-- | arch/sparc/include/asm/openprom_64.h | 248 |
4 files changed, 273 insertions, 488 deletions
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild index 930ba022c628..58f9b3a905be 100644 --- a/arch/sparc/include/asm/Kbuild +++ b/arch/sparc/include/asm/Kbuild | |||
@@ -11,8 +11,6 @@ header-y += envctrl.h | |||
11 | header-y += fbio.h | 11 | header-y += fbio.h |
12 | header-y += jsflash.h | 12 | header-y += jsflash.h |
13 | header-y += openprom.h | 13 | header-y += openprom.h |
14 | header-y += openprom_32.h | ||
15 | header-y += openprom_64.h | ||
16 | header-y += openpromio.h | 14 | header-y += openpromio.h |
17 | header-y += perfctr.h | 15 | header-y += perfctr.h |
18 | header-y += psrcompat.h | 16 | header-y += psrcompat.h |
diff --git a/arch/sparc/include/asm/openprom.h b/arch/sparc/include/asm/openprom.h index aaeae905ed3f..963e1a45c35f 100644 --- a/arch/sparc/include/asm/openprom.h +++ b/arch/sparc/include/asm/openprom.h | |||
@@ -1,8 +1,277 @@ | |||
1 | #ifndef ___ASM_SPARC_OPENPROM_H | 1 | #ifndef __SPARC_OPENPROM_H |
2 | #define ___ASM_SPARC_OPENPROM_H | 2 | #define __SPARC_OPENPROM_H |
3 | |||
4 | /* openprom.h: Prom structures and defines for access to the OPENBOOT | ||
5 | * prom routines and data areas. | ||
6 | * | ||
7 | * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu) | ||
8 | */ | ||
9 | |||
10 | /* Empirical constants... */ | ||
11 | #define LINUX_OPPROM_MAGIC 0x10010407 | ||
12 | |||
13 | #ifndef __ASSEMBLY__ | ||
14 | /* V0 prom device operations. */ | ||
15 | struct linux_dev_v0_funcs { | ||
16 | int (*v0_devopen)(char *device_str); | ||
17 | int (*v0_devclose)(int dev_desc); | ||
18 | int (*v0_rdblkdev)(int dev_desc, int num_blks, int blk_st, char *buf); | ||
19 | int (*v0_wrblkdev)(int dev_desc, int num_blks, int blk_st, char *buf); | ||
20 | int (*v0_wrnetdev)(int dev_desc, int num_bytes, char *buf); | ||
21 | int (*v0_rdnetdev)(int dev_desc, int num_bytes, char *buf); | ||
22 | int (*v0_rdchardev)(int dev_desc, int num_bytes, int dummy, char *buf); | ||
23 | int (*v0_wrchardev)(int dev_desc, int num_bytes, int dummy, char *buf); | ||
24 | int (*v0_seekdev)(int dev_desc, long logical_offst, int from); | ||
25 | }; | ||
26 | |||
27 | /* V2 and later prom device operations. */ | ||
28 | struct linux_dev_v2_funcs { | ||
29 | int (*v2_inst2pkg)(int d); /* Convert ihandle to phandle */ | ||
30 | char * (*v2_dumb_mem_alloc)(char *va, unsigned sz); | ||
31 | void (*v2_dumb_mem_free)(char *va, unsigned sz); | ||
32 | |||
33 | /* To map devices into virtual I/O space. */ | ||
34 | char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned paddr, unsigned sz); | ||
35 | void (*v2_dumb_munmap)(char *virta, unsigned size); | ||
36 | |||
37 | int (*v2_dev_open)(char *devpath); | ||
38 | void (*v2_dev_close)(int d); | ||
39 | int (*v2_dev_read)(int d, char *buf, int nbytes); | ||
40 | int (*v2_dev_write)(int d, char *buf, int nbytes); | ||
41 | int (*v2_dev_seek)(int d, int hi, int lo); | ||
42 | |||
43 | /* Never issued (multistage load support) */ | ||
44 | void (*v2_wheee2)(void); | ||
45 | void (*v2_wheee3)(void); | ||
46 | }; | ||
47 | |||
48 | struct linux_mlist_v0 { | ||
49 | struct linux_mlist_v0 *theres_more; | ||
50 | unsigned int start_adr; | ||
51 | unsigned num_bytes; | ||
52 | }; | ||
53 | |||
54 | struct linux_mem_v0 { | ||
55 | struct linux_mlist_v0 **v0_totphys; | ||
56 | struct linux_mlist_v0 **v0_prommap; | ||
57 | struct linux_mlist_v0 **v0_available; /* What we can use */ | ||
58 | }; | ||
59 | |||
60 | /* Arguments sent to the kernel from the boot prompt. */ | ||
61 | struct linux_arguments_v0 { | ||
62 | char *argv[8]; | ||
63 | char args[100]; | ||
64 | char boot_dev[2]; | ||
65 | int boot_dev_ctrl; | ||
66 | int boot_dev_unit; | ||
67 | int dev_partition; | ||
68 | char *kernel_file_name; | ||
69 | void *aieee1; /* XXX */ | ||
70 | }; | ||
71 | |||
72 | /* V2 and up boot things. */ | ||
73 | struct linux_bootargs_v2 { | ||
74 | char **bootpath; | ||
75 | char **bootargs; | ||
76 | int *fd_stdin; | ||
77 | int *fd_stdout; | ||
78 | }; | ||
79 | |||
80 | /* The top level PROM vector. */ | ||
81 | struct linux_romvec { | ||
82 | /* Version numbers. */ | ||
83 | unsigned int pv_magic_cookie; | ||
84 | unsigned int pv_romvers; | ||
85 | unsigned int pv_plugin_revision; | ||
86 | unsigned int pv_printrev; | ||
87 | |||
88 | /* Version 0 memory descriptors. */ | ||
89 | struct linux_mem_v0 pv_v0mem; | ||
90 | |||
91 | /* Node operations. */ | ||
92 | struct linux_nodeops *pv_nodeops; | ||
93 | |||
94 | char **pv_bootstr; | ||
95 | struct linux_dev_v0_funcs pv_v0devops; | ||
96 | |||
97 | char *pv_stdin; | ||
98 | char *pv_stdout; | ||
99 | #define PROMDEV_KBD 0 /* input from keyboard */ | ||
100 | #define PROMDEV_SCREEN 0 /* output to screen */ | ||
101 | #define PROMDEV_TTYA 1 /* in/out to ttya */ | ||
102 | #define PROMDEV_TTYB 2 /* in/out to ttyb */ | ||
103 | |||
104 | /* Blocking getchar/putchar. NOT REENTRANT! (grr) */ | ||
105 | int (*pv_getchar)(void); | ||
106 | void (*pv_putchar)(int ch); | ||
107 | |||
108 | /* Non-blocking variants. */ | ||
109 | int (*pv_nbgetchar)(void); | ||
110 | int (*pv_nbputchar)(int ch); | ||
111 | |||
112 | void (*pv_putstr)(char *str, int len); | ||
113 | |||
114 | /* Miscellany. */ | ||
115 | void (*pv_reboot)(char *bootstr); | ||
116 | void (*pv_printf)(__const__ char *fmt, ...); | ||
117 | void (*pv_abort)(void); | ||
118 | __volatile__ int *pv_ticks; | ||
119 | void (*pv_halt)(void); | ||
120 | void (**pv_synchook)(void); | ||
121 | |||
122 | /* Evaluate a forth string, not different proto for V0 and V2->up. */ | ||
123 | union { | ||
124 | void (*v0_eval)(int len, char *str); | ||
125 | void (*v2_eval)(char *str); | ||
126 | } pv_fortheval; | ||
127 | |||
128 | struct linux_arguments_v0 **pv_v0bootargs; | ||
129 | |||
130 | /* Get ether address. */ | ||
131 | unsigned int (*pv_enaddr)(int d, char *enaddr); | ||
132 | |||
133 | struct linux_bootargs_v2 pv_v2bootargs; | ||
134 | struct linux_dev_v2_funcs pv_v2devops; | ||
135 | |||
136 | int filler[15]; | ||
137 | |||
138 | /* This one is sun4c/sun4 only. */ | ||
139 | void (*pv_setctxt)(int ctxt, char *va, int pmeg); | ||
140 | |||
141 | /* Prom version 3 Multiprocessor routines. This stuff is crazy. | ||
142 | * No joke. Calling these when there is only one cpu probably | ||
143 | * crashes the machine, have to test this. :-) | ||
144 | */ | ||
145 | |||
146 | /* v3_cpustart() will start the cpu 'whichcpu' in mmu-context | ||
147 | * 'thiscontext' executing at address 'prog_counter' | ||
148 | */ | ||
149 | int (*v3_cpustart)(unsigned int whichcpu, int ctxtbl_ptr, | ||
150 | int thiscontext, char *prog_counter); | ||
151 | |||
152 | /* v3_cpustop() will cause cpu 'whichcpu' to stop executing | ||
153 | * until a resume cpu call is made. | ||
154 | */ | ||
155 | int (*v3_cpustop)(unsigned int whichcpu); | ||
156 | |||
157 | /* v3_cpuidle() will idle cpu 'whichcpu' until a stop or | ||
158 | * resume cpu call is made. | ||
159 | */ | ||
160 | int (*v3_cpuidle)(unsigned int whichcpu); | ||
161 | |||
162 | /* v3_cpuresume() will resume processor 'whichcpu' executing | ||
163 | * starting with whatever 'pc' and 'npc' were left at the | ||
164 | * last 'idle' or 'stop' call. | ||
165 | */ | ||
166 | int (*v3_cpuresume)(unsigned int whichcpu); | ||
167 | }; | ||
168 | |||
169 | /* Routines for traversing the prom device tree. */ | ||
170 | struct linux_nodeops { | ||
171 | int (*no_nextnode)(int node); | ||
172 | int (*no_child)(int node); | ||
173 | int (*no_proplen)(int node, const char *name); | ||
174 | int (*no_getprop)(int node, const char *name, char *val); | ||
175 | int (*no_setprop)(int node, const char *name, char *val, int len); | ||
176 | char * (*no_nextprop)(int node, char *name); | ||
177 | }; | ||
178 | |||
179 | /* More fun PROM structures for device probing. */ | ||
3 | #if defined(__sparc__) && defined(__arch64__) | 180 | #if defined(__sparc__) && defined(__arch64__) |
4 | #include <asm/openprom_64.h> | 181 | #define PROMREG_MAX 24 |
182 | #define PROMVADDR_MAX 16 | ||
183 | #define PROMINTR_MAX 32 | ||
5 | #else | 184 | #else |
6 | #include <asm/openprom_32.h> | 185 | #define PROMREG_MAX 16 |
186 | #define PROMVADDR_MAX 16 | ||
187 | #define PROMINTR_MAX 15 | ||
7 | #endif | 188 | #endif |
189 | |||
190 | struct linux_prom_registers { | ||
191 | unsigned int which_io; /* hi part of physical address */ | ||
192 | unsigned int phys_addr; /* The physical address of this register */ | ||
193 | unsigned int reg_size; /* How many bytes does this register take up? */ | ||
194 | }; | ||
195 | |||
196 | struct linux_prom64_registers { | ||
197 | unsigned long phys_addr; | ||
198 | unsigned long reg_size; | ||
199 | }; | ||
200 | |||
201 | struct linux_prom_irqs { | ||
202 | int pri; /* IRQ priority */ | ||
203 | int vector; /* This is foobar, what does it do? */ | ||
204 | }; | ||
205 | |||
206 | /* Element of the "ranges" vector */ | ||
207 | struct linux_prom_ranges { | ||
208 | unsigned int ot_child_space; | ||
209 | unsigned int ot_child_base; /* Bus feels this */ | ||
210 | unsigned int ot_parent_space; | ||
211 | unsigned int ot_parent_base; /* CPU looks from here */ | ||
212 | unsigned int or_size; | ||
213 | }; | ||
214 | |||
215 | /* | ||
216 | * Ranges and reg properties are a bit different for PCI. | ||
217 | */ | ||
218 | #if defined(__sparc__) && defined(__arch64__) | ||
219 | struct linux_prom_pci_registers { | ||
220 | unsigned int phys_hi; | ||
221 | unsigned int phys_mid; | ||
222 | unsigned int phys_lo; | ||
223 | |||
224 | unsigned int size_hi; | ||
225 | unsigned int size_lo; | ||
226 | }; | ||
227 | #else | ||
228 | struct linux_prom_pci_registers { | ||
229 | /* | ||
230 | * We don't know what information this field contain. | ||
231 | * We guess, PCI device function is in bits 15:8 | ||
232 | * So, ... | ||
233 | */ | ||
234 | unsigned int which_io; /* Let it be which_io */ | ||
235 | |||
236 | unsigned int phys_hi; | ||
237 | unsigned int phys_lo; | ||
238 | |||
239 | unsigned int size_hi; | ||
240 | unsigned int size_lo; | ||
241 | }; | ||
242 | |||
8 | #endif | 243 | #endif |
244 | |||
245 | struct linux_prom_pci_ranges { | ||
246 | unsigned int child_phys_hi; /* Only certain bits are encoded here. */ | ||
247 | unsigned int child_phys_mid; | ||
248 | unsigned int child_phys_lo; | ||
249 | |||
250 | unsigned int parent_phys_hi; | ||
251 | unsigned int parent_phys_lo; | ||
252 | |||
253 | unsigned int size_hi; | ||
254 | unsigned int size_lo; | ||
255 | }; | ||
256 | |||
257 | struct linux_prom_pci_intmap { | ||
258 | unsigned int phys_hi; | ||
259 | unsigned int phys_mid; | ||
260 | unsigned int phys_lo; | ||
261 | |||
262 | unsigned int interrupt; | ||
263 | |||
264 | int cnode; | ||
265 | unsigned int cinterrupt; | ||
266 | }; | ||
267 | |||
268 | struct linux_prom_pci_intmask { | ||
269 | unsigned int phys_hi; | ||
270 | unsigned int phys_mid; | ||
271 | unsigned int phys_lo; | ||
272 | unsigned int interrupt; | ||
273 | }; | ||
274 | |||
275 | #endif /* !(__ASSEMBLY__) */ | ||
276 | |||
277 | #endif /* !(__SPARC_OPENPROM_H) */ | ||
diff --git a/arch/sparc/include/asm/openprom_32.h b/arch/sparc/include/asm/openprom_32.h deleted file mode 100644 index 2e58db557198..000000000000 --- a/arch/sparc/include/asm/openprom_32.h +++ /dev/null | |||
@@ -1,234 +0,0 @@ | |||
1 | #ifndef __SPARC_OPENPROM_H | ||
2 | #define __SPARC_OPENPROM_H | ||
3 | |||
4 | /* openprom.h: Prom structures and defines for access to the OPENBOOT | ||
5 | * prom routines and data areas. | ||
6 | * | ||
7 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) | ||
8 | */ | ||
9 | |||
10 | /* Empirical constants... */ | ||
11 | #define LINUX_OPPROM_MAGIC 0x10010407 | ||
12 | |||
13 | #ifndef __ASSEMBLY__ | ||
14 | /* V0 prom device operations. */ | ||
15 | struct linux_dev_v0_funcs { | ||
16 | int (*v0_devopen)(char *device_str); | ||
17 | int (*v0_devclose)(int dev_desc); | ||
18 | int (*v0_rdblkdev)(int dev_desc, int num_blks, int blk_st, char *buf); | ||
19 | int (*v0_wrblkdev)(int dev_desc, int num_blks, int blk_st, char *buf); | ||
20 | int (*v0_wrnetdev)(int dev_desc, int num_bytes, char *buf); | ||
21 | int (*v0_rdnetdev)(int dev_desc, int num_bytes, char *buf); | ||
22 | int (*v0_rdchardev)(int dev_desc, int num_bytes, int dummy, char *buf); | ||
23 | int (*v0_wrchardev)(int dev_desc, int num_bytes, int dummy, char *buf); | ||
24 | int (*v0_seekdev)(int dev_desc, long logical_offst, int from); | ||
25 | }; | ||
26 | |||
27 | /* V2 and later prom device operations. */ | ||
28 | struct linux_dev_v2_funcs { | ||
29 | int (*v2_inst2pkg)(int d); /* Convert ihandle to phandle */ | ||
30 | char * (*v2_dumb_mem_alloc)(char *va, unsigned sz); | ||
31 | void (*v2_dumb_mem_free)(char *va, unsigned sz); | ||
32 | |||
33 | /* To map devices into virtual I/O space. */ | ||
34 | char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned paddr, unsigned sz); | ||
35 | void (*v2_dumb_munmap)(char *virta, unsigned size); | ||
36 | |||
37 | int (*v2_dev_open)(char *devpath); | ||
38 | void (*v2_dev_close)(int d); | ||
39 | int (*v2_dev_read)(int d, char *buf, int nbytes); | ||
40 | int (*v2_dev_write)(int d, char *buf, int nbytes); | ||
41 | int (*v2_dev_seek)(int d, int hi, int lo); | ||
42 | |||
43 | /* Never issued (multistage load support) */ | ||
44 | void (*v2_wheee2)(void); | ||
45 | void (*v2_wheee3)(void); | ||
46 | }; | ||
47 | |||
48 | struct linux_mlist_v0 { | ||
49 | struct linux_mlist_v0 *theres_more; | ||
50 | unsigned int start_adr; | ||
51 | unsigned num_bytes; | ||
52 | }; | ||
53 | |||
54 | struct linux_mem_v0 { | ||
55 | struct linux_mlist_v0 **v0_totphys; | ||
56 | struct linux_mlist_v0 **v0_prommap; | ||
57 | struct linux_mlist_v0 **v0_available; /* What we can use */ | ||
58 | }; | ||
59 | |||
60 | /* Arguments sent to the kernel from the boot prompt. */ | ||
61 | struct linux_arguments_v0 { | ||
62 | char *argv[8]; | ||
63 | char args[100]; | ||
64 | char boot_dev[2]; | ||
65 | int boot_dev_ctrl; | ||
66 | int boot_dev_unit; | ||
67 | int dev_partition; | ||
68 | char *kernel_file_name; | ||
69 | void *aieee1; /* XXX */ | ||
70 | }; | ||
71 | |||
72 | /* V2 and up boot things. */ | ||
73 | struct linux_bootargs_v2 { | ||
74 | char **bootpath; | ||
75 | char **bootargs; | ||
76 | int *fd_stdin; | ||
77 | int *fd_stdout; | ||
78 | }; | ||
79 | |||
80 | /* The top level PROM vector. */ | ||
81 | struct linux_romvec { | ||
82 | /* Version numbers. */ | ||
83 | unsigned int pv_magic_cookie; | ||
84 | unsigned int pv_romvers; | ||
85 | unsigned int pv_plugin_revision; | ||
86 | unsigned int pv_printrev; | ||
87 | |||
88 | /* Version 0 memory descriptors. */ | ||
89 | struct linux_mem_v0 pv_v0mem; | ||
90 | |||
91 | /* Node operations. */ | ||
92 | struct linux_nodeops *pv_nodeops; | ||
93 | |||
94 | char **pv_bootstr; | ||
95 | struct linux_dev_v0_funcs pv_v0devops; | ||
96 | |||
97 | char *pv_stdin; | ||
98 | char *pv_stdout; | ||
99 | #define PROMDEV_KBD 0 /* input from keyboard */ | ||
100 | #define PROMDEV_SCREEN 0 /* output to screen */ | ||
101 | #define PROMDEV_TTYA 1 /* in/out to ttya */ | ||
102 | #define PROMDEV_TTYB 2 /* in/out to ttyb */ | ||
103 | |||
104 | /* Blocking getchar/putchar. NOT REENTRANT! (grr) */ | ||
105 | int (*pv_getchar)(void); | ||
106 | void (*pv_putchar)(int ch); | ||
107 | |||
108 | /* Non-blocking variants. */ | ||
109 | int (*pv_nbgetchar)(void); | ||
110 | int (*pv_nbputchar)(int ch); | ||
111 | |||
112 | void (*pv_putstr)(char *str, int len); | ||
113 | |||
114 | /* Miscellany. */ | ||
115 | void (*pv_reboot)(char *bootstr); | ||
116 | void (*pv_printf)(__const__ char *fmt, ...); | ||
117 | void (*pv_abort)(void); | ||
118 | __volatile__ int *pv_ticks; | ||
119 | void (*pv_halt)(void); | ||
120 | void (**pv_synchook)(void); | ||
121 | |||
122 | /* Evaluate a forth string, not different proto for V0 and V2->up. */ | ||
123 | union { | ||
124 | void (*v0_eval)(int len, char *str); | ||
125 | void (*v2_eval)(char *str); | ||
126 | } pv_fortheval; | ||
127 | |||
128 | struct linux_arguments_v0 **pv_v0bootargs; | ||
129 | |||
130 | /* Get ether address. */ | ||
131 | unsigned int (*pv_enaddr)(int d, char *enaddr); | ||
132 | |||
133 | struct linux_bootargs_v2 pv_v2bootargs; | ||
134 | struct linux_dev_v2_funcs pv_v2devops; | ||
135 | |||
136 | int filler[15]; | ||
137 | |||
138 | /* This one is sun4c/sun4 only. */ | ||
139 | void (*pv_setctxt)(int ctxt, char *va, int pmeg); | ||
140 | |||
141 | /* Prom version 3 Multiprocessor routines. This stuff is crazy. | ||
142 | * No joke. Calling these when there is only one cpu probably | ||
143 | * crashes the machine, have to test this. :-) | ||
144 | */ | ||
145 | |||
146 | /* v3_cpustart() will start the cpu 'whichcpu' in mmu-context | ||
147 | * 'thiscontext' executing at address 'prog_counter' | ||
148 | */ | ||
149 | int (*v3_cpustart)(unsigned int whichcpu, int ctxtbl_ptr, | ||
150 | int thiscontext, char *prog_counter); | ||
151 | |||
152 | /* v3_cpustop() will cause cpu 'whichcpu' to stop executing | ||
153 | * until a resume cpu call is made. | ||
154 | */ | ||
155 | int (*v3_cpustop)(unsigned int whichcpu); | ||
156 | |||
157 | /* v3_cpuidle() will idle cpu 'whichcpu' until a stop or | ||
158 | * resume cpu call is made. | ||
159 | */ | ||
160 | int (*v3_cpuidle)(unsigned int whichcpu); | ||
161 | |||
162 | /* v3_cpuresume() will resume processor 'whichcpu' executing | ||
163 | * starting with whatever 'pc' and 'npc' were left at the | ||
164 | * last 'idle' or 'stop' call. | ||
165 | */ | ||
166 | int (*v3_cpuresume)(unsigned int whichcpu); | ||
167 | }; | ||
168 | |||
169 | /* Routines for traversing the prom device tree. */ | ||
170 | struct linux_nodeops { | ||
171 | int (*no_nextnode)(int node); | ||
172 | int (*no_child)(int node); | ||
173 | int (*no_proplen)(int node, const char *name); | ||
174 | int (*no_getprop)(int node, const char *name, char *val); | ||
175 | int (*no_setprop)(int node, const char *name, char *val, int len); | ||
176 | char * (*no_nextprop)(int node, char *name); | ||
177 | }; | ||
178 | |||
179 | /* More fun PROM structures for device probing. */ | ||
180 | #define PROMREG_MAX 16 | ||
181 | #define PROMVADDR_MAX 16 | ||
182 | #define PROMINTR_MAX 15 | ||
183 | |||
184 | struct linux_prom_registers { | ||
185 | unsigned int which_io; /* is this in OBIO space? */ | ||
186 | unsigned int phys_addr; /* The physical address of this register */ | ||
187 | unsigned int reg_size; /* How many bytes does this register take up? */ | ||
188 | }; | ||
189 | |||
190 | struct linux_prom_irqs { | ||
191 | int pri; /* IRQ priority */ | ||
192 | int vector; /* This is foobar, what does it do? */ | ||
193 | }; | ||
194 | |||
195 | /* Element of the "ranges" vector */ | ||
196 | struct linux_prom_ranges { | ||
197 | unsigned int ot_child_space; | ||
198 | unsigned int ot_child_base; /* Bus feels this */ | ||
199 | unsigned int ot_parent_space; | ||
200 | unsigned int ot_parent_base; /* CPU looks from here */ | ||
201 | unsigned int or_size; | ||
202 | }; | ||
203 | |||
204 | /* Ranges and reg properties are a bit different for PCI. */ | ||
205 | struct linux_prom_pci_registers { | ||
206 | /* | ||
207 | * We don't know what information this field contain. | ||
208 | * We guess, PCI device function is in bits 15:8 | ||
209 | * So, ... | ||
210 | */ | ||
211 | unsigned int which_io; /* Let it be which_io */ | ||
212 | |||
213 | unsigned int phys_hi; | ||
214 | unsigned int phys_lo; | ||
215 | |||
216 | unsigned int size_hi; | ||
217 | unsigned int size_lo; | ||
218 | }; | ||
219 | |||
220 | struct linux_prom_pci_ranges { | ||
221 | unsigned int child_phys_hi; /* Only certain bits are encoded here. */ | ||
222 | unsigned int child_phys_mid; | ||
223 | unsigned int child_phys_lo; | ||
224 | |||
225 | unsigned int parent_phys_hi; | ||
226 | unsigned int parent_phys_lo; | ||
227 | |||
228 | unsigned int size_hi; | ||
229 | unsigned int size_lo; | ||
230 | }; | ||
231 | |||
232 | #endif /* !(__ASSEMBLY__) */ | ||
233 | |||
234 | #endif /* !(__SPARC_OPENPROM_H) */ | ||
diff --git a/arch/sparc/include/asm/openprom_64.h b/arch/sparc/include/asm/openprom_64.h deleted file mode 100644 index 8148900901cb..000000000000 --- a/arch/sparc/include/asm/openprom_64.h +++ /dev/null | |||
@@ -1,248 +0,0 @@ | |||
1 | #ifndef __SPARC64_OPENPROM_H | ||
2 | #define __SPARC64_OPENPROM_H | ||
3 | |||
4 | /* openprom.h: Prom structures and defines for access to the OPENBOOT | ||
5 | * prom routines and data areas. | ||
6 | * | ||
7 | * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) | ||
8 | */ | ||
9 | |||
10 | #ifndef __ASSEMBLY__ | ||
11 | /* V0 prom device operations. */ | ||
12 | struct linux_dev_v0_funcs { | ||
13 | int (*v0_devopen)(char *device_str); | ||
14 | int (*v0_devclose)(int dev_desc); | ||
15 | int (*v0_rdblkdev)(int dev_desc, int num_blks, int blk_st, char *buf); | ||
16 | int (*v0_wrblkdev)(int dev_desc, int num_blks, int blk_st, char *buf); | ||
17 | int (*v0_wrnetdev)(int dev_desc, int num_bytes, char *buf); | ||
18 | int (*v0_rdnetdev)(int dev_desc, int num_bytes, char *buf); | ||
19 | int (*v0_rdchardev)(int dev_desc, int num_bytes, int dummy, char *buf); | ||
20 | int (*v0_wrchardev)(int dev_desc, int num_bytes, int dummy, char *buf); | ||
21 | int (*v0_seekdev)(int dev_desc, long logical_offst, int from); | ||
22 | }; | ||
23 | |||
24 | /* V2 and later prom device operations. */ | ||
25 | struct linux_dev_v2_funcs { | ||
26 | int (*v2_inst2pkg)(int d); /* Convert ihandle to phandle */ | ||
27 | char * (*v2_dumb_mem_alloc)(char *va, unsigned sz); | ||
28 | void (*v2_dumb_mem_free)(char *va, unsigned sz); | ||
29 | |||
30 | /* To map devices into virtual I/O space. */ | ||
31 | char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned paddr, unsigned sz); | ||
32 | void (*v2_dumb_munmap)(char *virta, unsigned size); | ||
33 | |||
34 | int (*v2_dev_open)(char *devpath); | ||
35 | void (*v2_dev_close)(int d); | ||
36 | int (*v2_dev_read)(int d, char *buf, int nbytes); | ||
37 | int (*v2_dev_write)(int d, char *buf, int nbytes); | ||
38 | int (*v2_dev_seek)(int d, int hi, int lo); | ||
39 | |||
40 | /* Never issued (multistage load support) */ | ||
41 | void (*v2_wheee2)(void); | ||
42 | void (*v2_wheee3)(void); | ||
43 | }; | ||
44 | |||
45 | struct linux_mlist_v0 { | ||
46 | struct linux_mlist_v0 *theres_more; | ||
47 | unsigned int start_adr; | ||
48 | unsigned num_bytes; | ||
49 | }; | ||
50 | |||
51 | struct linux_mem_v0 { | ||
52 | struct linux_mlist_v0 **v0_totphys; | ||
53 | struct linux_mlist_v0 **v0_prommap; | ||
54 | struct linux_mlist_v0 **v0_available; /* What we can use */ | ||
55 | }; | ||
56 | |||
57 | /* Arguments sent to the kernel from the boot prompt. */ | ||
58 | struct linux_arguments_v0 { | ||
59 | char *argv[8]; | ||
60 | char args[100]; | ||
61 | char boot_dev[2]; | ||
62 | int boot_dev_ctrl; | ||
63 | int boot_dev_unit; | ||
64 | int dev_partition; | ||
65 | char *kernel_file_name; | ||
66 | void *aieee1; /* XXX */ | ||
67 | }; | ||
68 | |||
69 | /* V2 and up boot things. */ | ||
70 | struct linux_bootargs_v2 { | ||
71 | char **bootpath; | ||
72 | char **bootargs; | ||
73 | int *fd_stdin; | ||
74 | int *fd_stdout; | ||
75 | }; | ||
76 | |||
77 | /* The top level PROM vector. */ | ||
78 | struct linux_romvec { | ||
79 | /* Version numbers. */ | ||
80 | unsigned int pv_magic_cookie; | ||
81 | unsigned int pv_romvers; | ||
82 | unsigned int pv_plugin_revision; | ||
83 | unsigned int pv_printrev; | ||
84 | |||
85 | /* Version 0 memory descriptors. */ | ||
86 | struct linux_mem_v0 pv_v0mem; | ||
87 | |||
88 | /* Node operations. */ | ||
89 | struct linux_nodeops *pv_nodeops; | ||
90 | |||
91 | char **pv_bootstr; | ||
92 | struct linux_dev_v0_funcs pv_v0devops; | ||
93 | |||
94 | char *pv_stdin; | ||
95 | char *pv_stdout; | ||
96 | #define PROMDEV_KBD 0 /* input from keyboard */ | ||
97 | #define PROMDEV_SCREEN 0 /* output to screen */ | ||
98 | #define PROMDEV_TTYA 1 /* in/out to ttya */ | ||
99 | #define PROMDEV_TTYB 2 /* in/out to ttyb */ | ||
100 | |||
101 | /* Blocking getchar/putchar. NOT REENTRANT! (grr) */ | ||
102 | int (*pv_getchar)(void); | ||
103 | void (*pv_putchar)(int ch); | ||
104 | |||
105 | /* Non-blocking variants. */ | ||
106 | int (*pv_nbgetchar)(void); | ||
107 | int (*pv_nbputchar)(int ch); | ||
108 | |||
109 | void (*pv_putstr)(char *str, int len); | ||
110 | |||
111 | /* Miscellany. */ | ||
112 | void (*pv_reboot)(char *bootstr); | ||
113 | void (*pv_printf)(__const__ char *fmt, ...); | ||
114 | void (*pv_abort)(void); | ||
115 | __volatile__ int *pv_ticks; | ||
116 | void (*pv_halt)(void); | ||
117 | void (**pv_synchook)(void); | ||
118 | |||
119 | /* Evaluate a forth string, not different proto for V0 and V2->up. */ | ||
120 | union { | ||
121 | void (*v0_eval)(int len, char *str); | ||
122 | void (*v2_eval)(char *str); | ||
123 | } pv_fortheval; | ||
124 | |||
125 | struct linux_arguments_v0 **pv_v0bootargs; | ||
126 | |||
127 | /* Get ether address. */ | ||
128 | unsigned int (*pv_enaddr)(int d, char *enaddr); | ||
129 | |||
130 | struct linux_bootargs_v2 pv_v2bootargs; | ||
131 | struct linux_dev_v2_funcs pv_v2devops; | ||
132 | |||
133 | int filler[15]; | ||
134 | |||
135 | /* This one is sun4c/sun4 only. */ | ||
136 | void (*pv_setctxt)(int ctxt, char *va, int pmeg); | ||
137 | |||
138 | /* Prom version 3 Multiprocessor routines. This stuff is crazy. | ||
139 | * No joke. Calling these when there is only one cpu probably | ||
140 | * crashes the machine, have to test this. :-) | ||
141 | */ | ||
142 | |||
143 | /* v3_cpustart() will start the cpu 'whichcpu' in mmu-context | ||
144 | * 'thiscontext' executing at address 'prog_counter' | ||
145 | */ | ||
146 | int (*v3_cpustart)(unsigned int whichcpu, int ctxtbl_ptr, | ||
147 | int thiscontext, char *prog_counter); | ||
148 | |||
149 | /* v3_cpustop() will cause cpu 'whichcpu' to stop executing | ||
150 | * until a resume cpu call is made. | ||
151 | */ | ||
152 | int (*v3_cpustop)(unsigned int whichcpu); | ||
153 | |||
154 | /* v3_cpuidle() will idle cpu 'whichcpu' until a stop or | ||
155 | * resume cpu call is made. | ||
156 | */ | ||
157 | int (*v3_cpuidle)(unsigned int whichcpu); | ||
158 | |||
159 | /* v3_cpuresume() will resume processor 'whichcpu' executing | ||
160 | * starting with whatever 'pc' and 'npc' were left at the | ||
161 | * last 'idle' or 'stop' call. | ||
162 | */ | ||
163 | int (*v3_cpuresume)(unsigned int whichcpu); | ||
164 | }; | ||
165 | |||
166 | /* Routines for traversing the prom device tree. */ | ||
167 | struct linux_nodeops { | ||
168 | int (*no_nextnode)(int node); | ||
169 | int (*no_child)(int node); | ||
170 | int (*no_proplen)(int node, const char *name); | ||
171 | int (*no_getprop)(int node, const char *name, char *val); | ||
172 | int (*no_setprop)(int node, const char *name, char *val, int len); | ||
173 | char * (*no_nextprop)(int node, char *name); | ||
174 | }; | ||
175 | |||
176 | /* More fun PROM structures for device probing. */ | ||
177 | #define PROMREG_MAX 24 | ||
178 | #define PROMVADDR_MAX 16 | ||
179 | #define PROMINTR_MAX 32 | ||
180 | |||
181 | struct linux_prom_registers { | ||
182 | unsigned int which_io; /* hi part of physical address */ | ||
183 | unsigned int phys_addr; /* The physical address of this register */ | ||
184 | unsigned int reg_size; /* How many bytes does this register take up? */ | ||
185 | }; | ||
186 | |||
187 | struct linux_prom64_registers { | ||
188 | unsigned long phys_addr; | ||
189 | unsigned long reg_size; | ||
190 | }; | ||
191 | |||
192 | struct linux_prom_irqs { | ||
193 | int pri; /* IRQ priority */ | ||
194 | int vector; /* This is foobar, what does it do? */ | ||
195 | }; | ||
196 | |||
197 | /* Element of the "ranges" vector */ | ||
198 | struct linux_prom_ranges { | ||
199 | unsigned int ot_child_space; | ||
200 | unsigned int ot_child_base; /* Bus feels this */ | ||
201 | unsigned int ot_parent_space; | ||
202 | unsigned int ot_parent_base; /* CPU looks from here */ | ||
203 | unsigned int or_size; | ||
204 | }; | ||
205 | |||
206 | /* Ranges and reg properties are a bit different for PCI. */ | ||
207 | struct linux_prom_pci_registers { | ||
208 | unsigned int phys_hi; | ||
209 | unsigned int phys_mid; | ||
210 | unsigned int phys_lo; | ||
211 | |||
212 | unsigned int size_hi; | ||
213 | unsigned int size_lo; | ||
214 | }; | ||
215 | |||
216 | struct linux_prom_pci_ranges { | ||
217 | unsigned int child_phys_hi; /* Only certain bits are encoded here. */ | ||
218 | unsigned int child_phys_mid; | ||
219 | unsigned int child_phys_lo; | ||
220 | |||
221 | unsigned int parent_phys_hi; | ||
222 | unsigned int parent_phys_lo; | ||
223 | |||
224 | unsigned int size_hi; | ||
225 | unsigned int size_lo; | ||
226 | }; | ||
227 | |||
228 | struct linux_prom_pci_intmap { | ||
229 | unsigned int phys_hi; | ||
230 | unsigned int phys_mid; | ||
231 | unsigned int phys_lo; | ||
232 | |||
233 | unsigned int interrupt; | ||
234 | |||
235 | int cnode; | ||
236 | unsigned int cinterrupt; | ||
237 | }; | ||
238 | |||
239 | struct linux_prom_pci_intmask { | ||
240 | unsigned int phys_hi; | ||
241 | unsigned int phys_mid; | ||
242 | unsigned int phys_lo; | ||
243 | unsigned int interrupt; | ||
244 | }; | ||
245 | |||
246 | #endif /* !(__ASSEMBLY__) */ | ||
247 | |||
248 | #endif /* !(__SPARC64_OPENPROM_H) */ | ||