1#ifndef __SPARC_OPENPROM_H
2#define __SPARC_OPENPROM_H
3
4
5
6
7
8
9
10
11
12#ifdef CONFIG_SUN3
13#define KADB_DEBUGGER_BEGVM 0x0fee0000
14#define LINUX_OPPROM_BEGVM 0x0fef0000
15#define LINUX_OPPROM_ENDVM 0x0ff10000
16#else
17#define KADB_DEBUGGER_BEGVM 0xffc00000
18#define LINUX_OPPROM_BEGVM 0xffd00000
19#define LINUX_OPPROM_ENDVM 0xfff00000
20#define LINUX_OPPROM_MAGIC 0x10010407
21#endif
22
23#ifndef __ASSEMBLY__
24
25struct linux_dev_v0_funcs {
26 int (*v0_devopen)(char *device_str);
27 int (*v0_devclose)(int dev_desc);
28 int (*v0_rdblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
29 int (*v0_wrblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
30 int (*v0_wrnetdev)(int dev_desc, int num_bytes, char *buf);
31 int (*v0_rdnetdev)(int dev_desc, int num_bytes, char *buf);
32 int (*v0_rdchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
33 int (*v0_wrchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
34 int (*v0_seekdev)(int dev_desc, long logical_offst, int from);
35};
36
37
38struct linux_dev_v2_funcs {
39 int (*v2_inst2pkg)(int d);
40 char * (*v2_dumb_mem_alloc)(char *va, unsigned sz);
41 void (*v2_dumb_mem_free)(char *va, unsigned sz);
42
43
44 char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned paddr, unsigned sz);
45 void (*v2_dumb_munmap)(char *virta, unsigned size);
46
47 int (*v2_dev_open)(char *devpath);
48 void (*v2_dev_close)(int d);
49 int (*v2_dev_read)(int d, char *buf, int nbytes);
50 int (*v2_dev_write)(int d, char *buf, int nbytes);
51 int (*v2_dev_seek)(int d, int hi, int lo);
52
53
54 void (*v2_wheee2)(void);
55 void (*v2_wheee3)(void);
56};
57
58struct linux_mlist_v0 {
59 struct linux_mlist_v0 *theres_more;
60 char *start_adr;
61 unsigned num_bytes;
62};
63
64struct linux_mem_v0 {
65 struct linux_mlist_v0 **v0_totphys;
66 struct linux_mlist_v0 **v0_prommap;
67 struct linux_mlist_v0 **v0_available;
68};
69
70
71struct linux_arguments_v0 {
72 char *argv[8];
73 char args[100];
74 char boot_dev[2];
75 int boot_dev_ctrl;
76 int boot_dev_unit;
77 int dev_partition;
78 char *kernel_file_name;
79 void *aieee1;
80};
81
82
83struct linux_bootargs_v2 {
84 char **bootpath;
85 char **bootargs;
86 int *fd_stdin;
87 int *fd_stdout;
88};
89
90#if defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
91struct linux_romvec {
92 char *pv_initsp;
93 int (*pv_startmon)(void);
94
95 int *diagberr;
96
97 struct linux_arguments_v0 **pv_v0bootargs;
98 unsigned *pv_sun3mem;
99
100 unsigned char (*pv_getchar)(void);
101 int (*pv_putchar)(int ch);
102 int (*pv_nbgetchar)(void);
103 int (*pv_nbputchar)(int ch);
104 unsigned char *pv_echo;
105 unsigned char *pv_insource;
106 unsigned char *pv_outsink;
107
108 int (*pv_getkey)(void);
109 int (*pv_initgetkey)(void);
110 unsigned int *pv_translation;
111 unsigned char *pv_keybid;
112 int *pv_screen_x;
113 int *pv_screen_y;
114 struct keybuf *pv_keybuf;
115
116 char *pv_monid;
117
118
119
120
121
122 int (*pv_fbwritechar)(char);
123 int *pv_fbaddr;
124 char **pv_font;
125 int (*pv_fbwritestr)(char);
126
127 void (*pv_reboot)(char *bootstr);
128
129
130
131
132
133 unsigned char *pv_linebuf;
134 unsigned char **pv_lineptr;
135 int *pv_linesize;
136 int (*pv_getline)(void);
137 unsigned char (*pv_getnextchar)(void);
138 unsigned char (*pv_peeknextchar)(void);
139 int *pv_fbthere;
140 int (*pv_getnum)(void);
141
142 void (*pv_printf)(const char *fmt, ...);
143 int (*pv_printhex)(void);
144
145 unsigned char *pv_leds;
146 int (*pv_setleds)(void);
147
148
149
150
151
152 int (*pv_nmiaddr)(void);
153 int (*pv_abortentry)(void);
154 int *pv_nmiclock;
155
156 int *pv_fbtype;
157
158
159
160
161
162 unsigned pv_romvers;
163 struct globram *pv_globram;
164 char *pv_kbdzscc;
165
166 int *pv_keyrinit;
167 unsigned char *pv_keyrtick;
168 unsigned *pv_memoryavail;
169 long *pv_resetaddr;
170 long *pv_resetmap;
171
172 void (*pv_halt)(void);
173 unsigned char *pv_memorybitmap;
174
175#ifdef CONFIG_SUN3
176 void (*pv_setctxt)(int ctxt, char *va, int pmeg);
177 void (*pv_vector_cmd)(void);
178 int dummy1z;
179 int dummy2z;
180 int dummy3z;
181 int dummy4z;
182#endif
183};
184#else
185
186struct linux_romvec {
187
188 unsigned int pv_magic_cookie;
189 unsigned int pv_romvers;
190 unsigned int pv_plugin_revision;
191 unsigned int pv_printrev;
192
193
194 struct linux_mem_v0 pv_v0mem;
195
196
197 struct linux_nodeops *pv_nodeops;
198
199 char **pv_bootstr;
200 struct linux_dev_v0_funcs pv_v0devops;
201
202 char *pv_stdin;
203 char *pv_stdout;
204#define PROMDEV_KBD 0
205#define PROMDEV_SCREEN 0
206#define PROMDEV_TTYA 1
207#define PROMDEV_TTYB 2
208
209
210 int (*pv_getchar)(void);
211 void (*pv_putchar)(int ch);
212
213
214 int (*pv_nbgetchar)(void);
215 int (*pv_nbputchar)(int ch);
216
217 void (*pv_putstr)(char *str, int len);
218
219
220 void (*pv_reboot)(char *bootstr);
221 void (*pv_printf)(__const__ char *fmt, ...);
222 void (*pv_abort)(void);
223 __volatile__ int *pv_ticks;
224 void (*pv_halt)(void);
225 void (**pv_synchook)(void);
226
227
228 union {
229 void (*v0_eval)(int len, char *str);
230 void (*v2_eval)(char *str);
231 } pv_fortheval;
232
233 struct linux_arguments_v0 **pv_v0bootargs;
234
235
236 unsigned int (*pv_enaddr)(int d, char *enaddr);
237
238 struct linux_bootargs_v2 pv_v2bootargs;
239 struct linux_dev_v2_funcs pv_v2devops;
240
241 int filler[15];
242
243
244 void (*pv_setctxt)(int ctxt, char *va, int pmeg);
245
246
247
248
249
250
251
252
253
254 int (*v3_cpustart)(unsigned int whichcpu, int ctxtbl_ptr,
255 int thiscontext, char *prog_counter);
256
257
258
259
260 int (*v3_cpustop)(unsigned int whichcpu);
261
262
263
264
265 int (*v3_cpuidle)(unsigned int whichcpu);
266
267
268
269
270
271 int (*v3_cpuresume)(unsigned int whichcpu);
272};
273#endif
274
275
276struct linux_nodeops {
277 int (*no_nextnode)(int node);
278 int (*no_child)(int node);
279 int (*no_proplen)(int node, char *name);
280 int (*no_getprop)(int node, char *name, char *val);
281 int (*no_setprop)(int node, char *name, char *val, int len);
282 char * (*no_nextprop)(int node, char *name);
283};
284
285
286#define PROMREG_MAX 16
287#define PROMVADDR_MAX 16
288#define PROMINTR_MAX 15
289
290struct linux_prom_registers {
291 int which_io;
292 char *phys_addr;
293 int reg_size;
294};
295
296struct linux_prom_irqs {
297 int pri;
298 int vector;
299};
300
301
302struct linux_prom_ranges {
303 unsigned int ot_child_space;
304 unsigned int ot_child_base;
305 unsigned int ot_parent_space;
306 unsigned int ot_parent_base;
307 unsigned int or_size;
308};
309
310#endif
311
312#endif
313