~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/include/asm-sparc64/openprom.h

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.