0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef _ASM_SGIARCS_H
0013 #define _ASM_SGIARCS_H
0014
0015 #include <linux/kernel.h>
0016
0017 #include <asm/types.h>
0018 #include <asm/fw/arc/types.h>
0019
0020
0021 #define PROM_ESUCCESS 0x00
0022 #define PROM_E2BIG 0x01
0023 #define PROM_EACCESS 0x02
0024 #define PROM_EAGAIN 0x03
0025 #define PROM_EBADF 0x04
0026 #define PROM_EBUSY 0x05
0027 #define PROM_EFAULT 0x06
0028 #define PROM_EINVAL 0x07
0029 #define PROM_EIO 0x08
0030 #define PROM_EISDIR 0x09
0031 #define PROM_EMFILE 0x0a
0032 #define PROM_EMLINK 0x0b
0033 #define PROM_ENAMETOOLONG 0x0c
0034 #define PROM_ENODEV 0x0d
0035 #define PROM_ENOENT 0x0e
0036 #define PROM_ENOEXEC 0x0f
0037 #define PROM_ENOMEM 0x10
0038 #define PROM_ENOSPC 0x11
0039 #define PROM_ENOTDIR 0x12
0040 #define PROM_ENOTTY 0x13
0041 #define PROM_ENXIO 0x14
0042 #define PROM_EROFS 0x15
0043
0044 #define PROM_EADDRNOTAVAIL 0x1f
0045 #define PROM_ETIMEDOUT 0x20
0046 #define PROM_ECONNABORTED 0x21
0047 #define PROM_ENOCONNECT 0x22
0048
0049
0050
0051
0052 enum linux_devclass {
0053 system, processor, cache, adapter, controller, peripheral, memory
0054 };
0055
0056 enum linux_devtypes {
0057
0058 Arc, Cpu, Fpu,
0059
0060
0061 picache, pdcache,
0062
0063
0064 sicache, sdcache, sccache,
0065
0066 memdev, eisa_adapter, tc_adapter, scsi_adapter, dti_adapter,
0067 multifunc_adapter, dsk_controller, tp_controller, cdrom_controller,
0068 worm_controller, serial_controller, net_controller, disp_controller,
0069 parallel_controller, ptr_controller, kbd_controller, audio_controller,
0070 misc_controller, disk_peripheral, flpy_peripheral, tp_peripheral,
0071 modem_peripheral, monitor_peripheral, printer_peripheral,
0072 ptr_peripheral, kbd_peripheral, term_peripheral, line_peripheral,
0073 net_peripheral, misc_peripheral, anon
0074 };
0075
0076 enum linux_identifier {
0077 bogus, ronly, removable, consin, consout, input, output
0078 };
0079
0080
0081 struct linux_component {
0082 enum linux_devclass class;
0083 enum linux_devtypes type;
0084 enum linux_identifier iflags;
0085 USHORT vers;
0086 USHORT rev;
0087 ULONG key;
0088 ULONG amask;
0089 ULONG cdsize;
0090 ULONG ilen;
0091 _PULONG iname;
0092 };
0093 typedef struct linux_component pcomponent;
0094
0095 struct linux_sysid {
0096 char vend[8], prod[8];
0097 };
0098
0099
0100 enum arcs_memtypes {
0101 arcs_eblock,
0102 arcs_rvpage,
0103 arcs_fcontig,
0104 arcs_free,
0105 arcs_bmem,
0106 arcs_prog,
0107 arcs_atmp,
0108 arcs_aperm,
0109 };
0110
0111
0112 enum arc_memtypes {
0113 arc_eblock,
0114 arc_rvpage,
0115 arc_free,
0116 arc_bmem,
0117 arc_prog,
0118 arc_atmp,
0119 arc_aperm,
0120 arc_fcontig,
0121 };
0122
0123 union linux_memtypes {
0124 enum arcs_memtypes arcs;
0125 enum arc_memtypes arc;
0126 };
0127
0128 struct linux_mdesc {
0129 union linux_memtypes type;
0130 ULONG base;
0131 ULONG pages;
0132 };
0133
0134
0135 struct linux_tinfo {
0136 unsigned short yr;
0137 unsigned short mnth;
0138 unsigned short day;
0139 unsigned short hr;
0140 unsigned short min;
0141 unsigned short sec;
0142 unsigned short msec;
0143 };
0144
0145
0146 struct linux_vdirent {
0147 ULONG namelen;
0148 unsigned char attr;
0149 char fname[32];
0150 };
0151
0152
0153 enum linux_omode {
0154 rdonly, wronly, rdwr, wronly_creat, rdwr_creat,
0155 wronly_ssede, rdwr_ssede, dirent, dirent_creat
0156 };
0157
0158 enum linux_seekmode {
0159 absolute, relative
0160 };
0161
0162 enum linux_mountops {
0163 media_load, media_unload
0164 };
0165
0166
0167 struct linux_bigint {
0168 #ifdef __MIPSEL__
0169 u32 lo;
0170 s32 hi;
0171 #else
0172 s32 hi;
0173 u32 lo;
0174 #endif
0175 };
0176
0177 struct linux_finfo {
0178 struct linux_bigint begin;
0179 struct linux_bigint end;
0180 struct linux_bigint cur;
0181 enum linux_devtypes dtype;
0182 unsigned long namelen;
0183 unsigned char attr;
0184 char name[32];
0185 };
0186
0187
0188
0189 struct linux_romvec {
0190 LONG load;
0191 LONG invoke;
0192 LONG exec;
0193
0194 LONG halt;
0195 LONG pdown;
0196 LONG restart;
0197 LONG reboot;
0198 LONG imode;
0199 LONG _unused1;
0200
0201
0202 LONG next_component;
0203 LONG child_component;
0204 LONG parent_component;
0205 LONG component_data;
0206 LONG child_add;
0207 LONG comp_del;
0208 LONG component_by_path;
0209
0210
0211 LONG cfg_save;
0212 LONG get_sysid;
0213
0214
0215 LONG get_mdesc;
0216 LONG _unused2;
0217
0218 LONG get_tinfo;
0219 LONG get_rtime;
0220
0221
0222 LONG get_vdirent;
0223 LONG open;
0224 LONG close;
0225 LONG read;
0226 LONG get_rstatus;
0227 LONG write;
0228 LONG seek;
0229 LONG mount;
0230
0231
0232 LONG get_evar;
0233 LONG set_evar;
0234
0235 LONG get_finfo;
0236 LONG set_finfo;
0237
0238
0239 LONG cache_flush;
0240 LONG TestUnicodeCharacter;
0241 LONG GetDisplayStatus;
0242 };
0243
0244
0245
0246
0247 typedef struct _SYSTEM_PARAMETER_BLOCK {
0248 ULONG magic;
0249 #define PROMBLOCK_MAGIC 0x53435241
0250
0251 ULONG len;
0252 USHORT ver;
0253 USHORT rev;
0254 _PLONG rs_block;
0255 _PLONG dbg_block;
0256 _PLONG gevect;
0257 _PLONG utlbvect;
0258 ULONG rveclen;
0259 _PVOID romvec;
0260 ULONG pveclen;
0261 _PVOID pvector;
0262 ULONG adap_cnt;
0263 ULONG adap_typ0;
0264 ULONG adap_vcnt0;
0265 _PVOID adap_vector;
0266 ULONG adap_typ1;
0267 ULONG adap_vcnt1;
0268 _PVOID adap_vector1;
0269
0270 } SYSTEM_PARAMETER_BLOCK, *PSYSTEM_PARAMETER_BLOCK;
0271
0272 #define PROMBLOCK ((PSYSTEM_PARAMETER_BLOCK) (int)0xA0001000)
0273 #define ROMVECTOR ((struct linux_romvec *) (long)(PROMBLOCK)->romvec)
0274
0275
0276 union linux_cache_key {
0277 struct param {
0278 #ifdef __MIPSEL__
0279 unsigned short size;
0280 unsigned char lsize;
0281 unsigned char bsize;
0282 #else
0283 unsigned char bsize;
0284 unsigned char lsize;
0285 unsigned short size;
0286 #endif
0287 } info;
0288 unsigned long allinfo;
0289 };
0290
0291
0292 struct linux_cdata {
0293 char *name;
0294 int mlen;
0295 enum linux_devtypes type;
0296 };
0297
0298
0299 #define SGIPROM_STDIN 0
0300 #define SGIPROM_STDOUT 1
0301
0302
0303 #define SGIPROM_ROFILE 0x01
0304 #define SGIPROM_HFILE 0x02
0305 #define SGIPROM_SFILE 0x04
0306 #define SGIPROM_AFILE 0x08
0307 #define SGIPROM_DFILE 0x10
0308 #define SGIPROM_DELFILE 0x20
0309
0310
0311 struct sgi_partition {
0312 unsigned char flag;
0313 #define SGIPART_UNUSED 0x00
0314 #define SGIPART_ACTIVE 0x80
0315
0316 unsigned char shead, ssect, scyl;
0317 unsigned char systype;
0318 unsigned char ehead, esect, ecyl;
0319 unsigned char rsect0, rsect1, rsect2, rsect3;
0320 unsigned char tsect0, tsect1, tsect2, tsect3;
0321 };
0322
0323 #define SGIBBLOCK_MAGIC 0xaa55
0324 #define SGIBBLOCK_MAXPART 0x0004
0325
0326 struct sgi_bootblock {
0327 unsigned char _unused[446];
0328 struct sgi_partition partitions[SGIBBLOCK_MAXPART];
0329 unsigned short magic;
0330 };
0331
0332
0333 struct sgi_bparm_block {
0334 unsigned short bytes_sect;
0335 unsigned char sect_clust;
0336 unsigned short sect_resv;
0337 unsigned char nfats;
0338 unsigned short nroot_dirents;
0339 unsigned short sect_volume;
0340 unsigned char media_type;
0341 unsigned short sect_fat;
0342 unsigned short sect_track;
0343 unsigned short nheads;
0344 unsigned short nhsects;
0345 };
0346
0347 struct sgi_bsector {
0348 unsigned char jmpinfo[3];
0349 unsigned char manuf_name[8];
0350 struct sgi_bparm_block info;
0351 };
0352
0353
0354 #define SMB_DEBUG_MAGIC 0xfeeddead
0355 struct linux_smonblock {
0356 unsigned long magic;
0357 void (*handler)(void);
0358 unsigned long dtable_base;
0359 int (*printf)(const char *fmt, ...);
0360 unsigned long btable_base;
0361 unsigned long mpflushreqs;
0362 unsigned long ntab;
0363 unsigned long stab;
0364 int smax;
0365 };
0366
0367
0368
0369
0370
0371 #if defined(CONFIG_64BIT) && defined(CONFIG_FW_ARC32)
0372
0373 extern long call_o32(long vec, void *stack, ...);
0374
0375 extern u64 o32_stk[4096];
0376 #define O32_STK (&o32_stk[ARRAY_SIZE(o32_stk)])
0377
0378 #define ARC_CALL0(dest) \
0379 ({ long __res; \
0380 long __vec = (long) romvec->dest; \
0381 __res = call_o32(__vec, O32_STK); \
0382 __res; \
0383 })
0384
0385 #define ARC_CALL1(dest, a1) \
0386 ({ long __res; \
0387 int __a1 = (int) (long) (a1); \
0388 long __vec = (long) romvec->dest; \
0389 __res = call_o32(__vec, O32_STK, __a1); \
0390 __res; \
0391 })
0392
0393 #define ARC_CALL2(dest, a1, a2) \
0394 ({ long __res; \
0395 int __a1 = (int) (long) (a1); \
0396 int __a2 = (int) (long) (a2); \
0397 long __vec = (long) romvec->dest; \
0398 __res = call_o32(__vec, O32_STK, __a1, __a2); \
0399 __res; \
0400 })
0401
0402 #define ARC_CALL3(dest, a1, a2, a3) \
0403 ({ long __res; \
0404 int __a1 = (int) (long) (a1); \
0405 int __a2 = (int) (long) (a2); \
0406 int __a3 = (int) (long) (a3); \
0407 long __vec = (long) romvec->dest; \
0408 __res = call_o32(__vec, O32_STK, __a1, __a2, __a3); \
0409 __res; \
0410 })
0411
0412 #define ARC_CALL4(dest, a1, a2, a3, a4) \
0413 ({ long __res; \
0414 int __a1 = (int) (long) (a1); \
0415 int __a2 = (int) (long) (a2); \
0416 int __a3 = (int) (long) (a3); \
0417 int __a4 = (int) (long) (a4); \
0418 long __vec = (long) romvec->dest; \
0419 __res = call_o32(__vec, O32_STK, __a1, __a2, __a3, __a4); \
0420 __res; \
0421 })
0422
0423 #define ARC_CALL5(dest, a1, a2, a3, a4, a5) \
0424 ({ long __res; \
0425 int __a1 = (int) (long) (a1); \
0426 int __a2 = (int) (long) (a2); \
0427 int __a3 = (int) (long) (a3); \
0428 int __a4 = (int) (long) (a4); \
0429 int __a5 = (int) (long) (a5); \
0430 long __vec = (long) romvec->dest; \
0431 __res = call_o32(__vec, O32_STK, __a1, __a2, __a3, __a4, __a5); \
0432 __res; \
0433 })
0434
0435 #endif
0436
0437 #if (defined(CONFIG_32BIT) && defined(CONFIG_FW_ARC32)) || \
0438 (defined(CONFIG_64BIT) && defined(CONFIG_FW_ARC64))
0439
0440 #define ARC_CALL0(dest) \
0441 ({ long __res; \
0442 long (*__vec)(void) = (void *) romvec->dest; \
0443 \
0444 __res = __vec(); \
0445 __res; \
0446 })
0447
0448 #define ARC_CALL1(dest, a1) \
0449 ({ long __res; \
0450 long __a1 = (long) (a1); \
0451 long (*__vec)(long) = (void *) romvec->dest; \
0452 \
0453 __res = __vec(__a1); \
0454 __res; \
0455 })
0456
0457 #define ARC_CALL2(dest, a1, a2) \
0458 ({ long __res; \
0459 long __a1 = (long) (a1); \
0460 long __a2 = (long) (a2); \
0461 long (*__vec)(long, long) = (void *) romvec->dest; \
0462 \
0463 __res = __vec(__a1, __a2); \
0464 __res; \
0465 })
0466
0467 #define ARC_CALL3(dest, a1, a2, a3) \
0468 ({ long __res; \
0469 long __a1 = (long) (a1); \
0470 long __a2 = (long) (a2); \
0471 long __a3 = (long) (a3); \
0472 long (*__vec)(long, long, long) = (void *) romvec->dest; \
0473 \
0474 __res = __vec(__a1, __a2, __a3); \
0475 __res; \
0476 })
0477
0478 #define ARC_CALL4(dest, a1, a2, a3, a4) \
0479 ({ long __res; \
0480 long __a1 = (long) (a1); \
0481 long __a2 = (long) (a2); \
0482 long __a3 = (long) (a3); \
0483 long __a4 = (long) (a4); \
0484 long (*__vec)(long, long, long, long) = (void *) romvec->dest; \
0485 \
0486 __res = __vec(__a1, __a2, __a3, __a4); \
0487 __res; \
0488 })
0489
0490 #define ARC_CALL5(dest, a1, a2, a3, a4, a5) \
0491 ({ long __res; \
0492 long __a1 = (long) (a1); \
0493 long __a2 = (long) (a2); \
0494 long __a3 = (long) (a3); \
0495 long __a4 = (long) (a4); \
0496 long __a5 = (long) (a5); \
0497 long (*__vec)(long, long, long, long, long); \
0498 __vec = (void *) romvec->dest; \
0499 \
0500 __res = __vec(__a1, __a2, __a3, __a4, __a5); \
0501 __res; \
0502 })
0503 #endif
0504
0505 #endif