0001
0002 #ifndef __SPARC_OPENPROM_H
0003 #define __SPARC_OPENPROM_H
0004
0005
0006
0007
0008
0009
0010
0011
0012 #define LINUX_OPPROM_MAGIC 0x10010407
0013
0014 #ifndef __ASSEMBLY__
0015 #include <linux/of.h>
0016
0017
0018 struct linux_dev_v0_funcs {
0019 int (*v0_devopen)(char *device_str);
0020 int (*v0_devclose)(int dev_desc);
0021 int (*v0_rdblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
0022 int (*v0_wrblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
0023 int (*v0_wrnetdev)(int dev_desc, int num_bytes, char *buf);
0024 int (*v0_rdnetdev)(int dev_desc, int num_bytes, char *buf);
0025 int (*v0_rdchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
0026 int (*v0_wrchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
0027 int (*v0_seekdev)(int dev_desc, long logical_offst, int from);
0028 };
0029
0030
0031 struct linux_dev_v2_funcs {
0032 phandle (*v2_inst2pkg)(int d);
0033 char * (*v2_dumb_mem_alloc)(char *va, unsigned int sz);
0034 void (*v2_dumb_mem_free)(char *va, unsigned int sz);
0035
0036
0037 char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned int paddr, unsigned int sz);
0038 void (*v2_dumb_munmap)(char *virta, unsigned int size);
0039
0040 int (*v2_dev_open)(char *devpath);
0041 void (*v2_dev_close)(int d);
0042 int (*v2_dev_read)(int d, char *buf, int nbytes);
0043 int (*v2_dev_write)(int d, const char *buf, int nbytes);
0044 int (*v2_dev_seek)(int d, int hi, int lo);
0045
0046
0047 void (*v2_wheee2)(void);
0048 void (*v2_wheee3)(void);
0049 };
0050
0051 struct linux_mlist_v0 {
0052 struct linux_mlist_v0 *theres_more;
0053 unsigned int start_adr;
0054 unsigned int num_bytes;
0055 };
0056
0057 struct linux_mem_v0 {
0058 struct linux_mlist_v0 **v0_totphys;
0059 struct linux_mlist_v0 **v0_prommap;
0060 struct linux_mlist_v0 **v0_available;
0061 };
0062
0063
0064 struct linux_arguments_v0 {
0065 char *argv[8];
0066 char args[100];
0067 char boot_dev[2];
0068 int boot_dev_ctrl;
0069 int boot_dev_unit;
0070 int dev_partition;
0071 char *kernel_file_name;
0072 void *aieee1;
0073 };
0074
0075
0076 struct linux_bootargs_v2 {
0077 char **bootpath;
0078 char **bootargs;
0079 int *fd_stdin;
0080 int *fd_stdout;
0081 };
0082
0083
0084 struct linux_romvec {
0085
0086 unsigned int pv_magic_cookie;
0087 unsigned int pv_romvers;
0088 unsigned int pv_plugin_revision;
0089 unsigned int pv_printrev;
0090
0091
0092 struct linux_mem_v0 pv_v0mem;
0093
0094
0095 struct linux_nodeops *pv_nodeops;
0096
0097 char **pv_bootstr;
0098 struct linux_dev_v0_funcs pv_v0devops;
0099
0100 char *pv_stdin;
0101 char *pv_stdout;
0102 #define PROMDEV_KBD 0
0103 #define PROMDEV_SCREEN 0
0104 #define PROMDEV_TTYA 1
0105 #define PROMDEV_TTYB 2
0106
0107
0108 int (*pv_getchar)(void);
0109 void (*pv_putchar)(int ch);
0110
0111
0112 int (*pv_nbgetchar)(void);
0113 int (*pv_nbputchar)(int ch);
0114
0115 void (*pv_putstr)(char *str, int len);
0116
0117
0118 void (*pv_reboot)(char *bootstr);
0119 void (*pv_printf)(__const__ char *fmt, ...);
0120 void (*pv_abort)(void);
0121 __volatile__ int *pv_ticks;
0122 void (*pv_halt)(void);
0123 void (**pv_synchook)(void);
0124
0125
0126 union {
0127 void (*v0_eval)(int len, char *str);
0128 void (*v2_eval)(char *str);
0129 } pv_fortheval;
0130
0131 struct linux_arguments_v0 **pv_v0bootargs;
0132
0133
0134 unsigned int (*pv_enaddr)(int d, char *enaddr);
0135
0136 struct linux_bootargs_v2 pv_v2bootargs;
0137 struct linux_dev_v2_funcs pv_v2devops;
0138
0139 int filler[15];
0140
0141
0142 void (*pv_setctxt)(int ctxt, char *va, int pmeg);
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152 int (*v3_cpustart)(unsigned int whichcpu, int ctxtbl_ptr,
0153 int thiscontext, char *prog_counter);
0154
0155
0156
0157
0158 int (*v3_cpustop)(unsigned int whichcpu);
0159
0160
0161
0162
0163 int (*v3_cpuidle)(unsigned int whichcpu);
0164
0165
0166
0167
0168
0169 int (*v3_cpuresume)(unsigned int whichcpu);
0170 };
0171
0172
0173 struct linux_nodeops {
0174 phandle (*no_nextnode)(phandle node);
0175 phandle (*no_child)(phandle node);
0176 int (*no_proplen)(phandle node, const char *name);
0177 int (*no_getprop)(phandle node, const char *name, char *val);
0178 int (*no_setprop)(phandle node, const char *name, char *val, int len);
0179 char * (*no_nextprop)(phandle node, char *name);
0180 };
0181
0182
0183 #if defined(__sparc__) && defined(__arch64__)
0184 #define PROMREG_MAX 24
0185 #define PROMVADDR_MAX 16
0186 #define PROMINTR_MAX 32
0187 #else
0188 #define PROMREG_MAX 16
0189 #define PROMVADDR_MAX 16
0190 #define PROMINTR_MAX 15
0191 #endif
0192
0193 struct linux_prom_registers {
0194 unsigned int which_io;
0195 unsigned int phys_addr;
0196 unsigned int reg_size;
0197 };
0198
0199 struct linux_prom64_registers {
0200 unsigned long phys_addr;
0201 unsigned long reg_size;
0202 };
0203
0204 struct linux_prom_irqs {
0205 int pri;
0206 int vector;
0207 };
0208
0209
0210 struct linux_prom_ranges {
0211 unsigned int ot_child_space;
0212 unsigned int ot_child_base;
0213 unsigned int ot_parent_space;
0214 unsigned int ot_parent_base;
0215 unsigned int or_size;
0216 };
0217
0218
0219
0220
0221 #if defined(__sparc__) && defined(__arch64__)
0222 struct linux_prom_pci_registers {
0223 unsigned int phys_hi;
0224 unsigned int phys_mid;
0225 unsigned int phys_lo;
0226
0227 unsigned int size_hi;
0228 unsigned int size_lo;
0229 };
0230 #else
0231 struct linux_prom_pci_registers {
0232
0233
0234
0235
0236
0237 unsigned int which_io;
0238
0239 unsigned int phys_hi;
0240 unsigned int phys_lo;
0241
0242 unsigned int size_hi;
0243 unsigned int size_lo;
0244 };
0245
0246 #endif
0247
0248 struct linux_prom_pci_ranges {
0249 unsigned int child_phys_hi;
0250 unsigned int child_phys_mid;
0251 unsigned int child_phys_lo;
0252
0253 unsigned int parent_phys_hi;
0254 unsigned int parent_phys_lo;
0255
0256 unsigned int size_hi;
0257 unsigned int size_lo;
0258 };
0259
0260 struct linux_prom_pci_intmap {
0261 unsigned int phys_hi;
0262 unsigned int phys_mid;
0263 unsigned int phys_lo;
0264
0265 unsigned int interrupt;
0266
0267 int cnode;
0268 unsigned int cinterrupt;
0269 };
0270
0271 struct linux_prom_pci_intmask {
0272 unsigned int phys_hi;
0273 unsigned int phys_mid;
0274 unsigned int phys_lo;
0275 unsigned int interrupt;
0276 };
0277
0278 #endif
0279
0280 #endif