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