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