18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public 38c2ecf20Sopenharmony_ci * License. See the file "COPYING" in the main directory of this archive 48c2ecf20Sopenharmony_ci * for more details. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * ARC firmware interface defines. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Copyright (C) 1996 David S. Miller (davem@davemloft.net) 98c2ecf20Sopenharmony_ci * Copyright (C) 1999, 2001 Ralf Baechle (ralf@gnu.org) 108c2ecf20Sopenharmony_ci * Copyright (C) 1999 Silicon Graphics, Inc. 118c2ecf20Sopenharmony_ci */ 128c2ecf20Sopenharmony_ci#ifndef _ASM_SGIARCS_H 138c2ecf20Sopenharmony_ci#define _ASM_SGIARCS_H 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#include <linux/kernel.h> 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#include <asm/types.h> 188c2ecf20Sopenharmony_ci#include <asm/fw/arc/types.h> 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci/* Various ARCS error codes. */ 218c2ecf20Sopenharmony_ci#define PROM_ESUCCESS 0x00 228c2ecf20Sopenharmony_ci#define PROM_E2BIG 0x01 238c2ecf20Sopenharmony_ci#define PROM_EACCESS 0x02 248c2ecf20Sopenharmony_ci#define PROM_EAGAIN 0x03 258c2ecf20Sopenharmony_ci#define PROM_EBADF 0x04 268c2ecf20Sopenharmony_ci#define PROM_EBUSY 0x05 278c2ecf20Sopenharmony_ci#define PROM_EFAULT 0x06 288c2ecf20Sopenharmony_ci#define PROM_EINVAL 0x07 298c2ecf20Sopenharmony_ci#define PROM_EIO 0x08 308c2ecf20Sopenharmony_ci#define PROM_EISDIR 0x09 318c2ecf20Sopenharmony_ci#define PROM_EMFILE 0x0a 328c2ecf20Sopenharmony_ci#define PROM_EMLINK 0x0b 338c2ecf20Sopenharmony_ci#define PROM_ENAMETOOLONG 0x0c 348c2ecf20Sopenharmony_ci#define PROM_ENODEV 0x0d 358c2ecf20Sopenharmony_ci#define PROM_ENOENT 0x0e 368c2ecf20Sopenharmony_ci#define PROM_ENOEXEC 0x0f 378c2ecf20Sopenharmony_ci#define PROM_ENOMEM 0x10 388c2ecf20Sopenharmony_ci#define PROM_ENOSPC 0x11 398c2ecf20Sopenharmony_ci#define PROM_ENOTDIR 0x12 408c2ecf20Sopenharmony_ci#define PROM_ENOTTY 0x13 418c2ecf20Sopenharmony_ci#define PROM_ENXIO 0x14 428c2ecf20Sopenharmony_ci#define PROM_EROFS 0x15 438c2ecf20Sopenharmony_ci/* SGI ARCS specific errno's. */ 448c2ecf20Sopenharmony_ci#define PROM_EADDRNOTAVAIL 0x1f 458c2ecf20Sopenharmony_ci#define PROM_ETIMEDOUT 0x20 468c2ecf20Sopenharmony_ci#define PROM_ECONNABORTED 0x21 478c2ecf20Sopenharmony_ci#define PROM_ENOCONNECT 0x22 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci/* Device classes, types, and identifiers for prom 508c2ecf20Sopenharmony_ci * device inventory queries. 518c2ecf20Sopenharmony_ci */ 528c2ecf20Sopenharmony_cienum linux_devclass { 538c2ecf20Sopenharmony_ci system, processor, cache, adapter, controller, peripheral, memory 548c2ecf20Sopenharmony_ci}; 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_cienum linux_devtypes { 578c2ecf20Sopenharmony_ci /* Generic stuff. */ 588c2ecf20Sopenharmony_ci Arc, Cpu, Fpu, 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci /* Primary insn and data caches. */ 618c2ecf20Sopenharmony_ci picache, pdcache, 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci /* Secondary insn, data, and combined caches. */ 648c2ecf20Sopenharmony_ci sicache, sdcache, sccache, 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci memdev, eisa_adapter, tc_adapter, scsi_adapter, dti_adapter, 678c2ecf20Sopenharmony_ci multifunc_adapter, dsk_controller, tp_controller, cdrom_controller, 688c2ecf20Sopenharmony_ci worm_controller, serial_controller, net_controller, disp_controller, 698c2ecf20Sopenharmony_ci parallel_controller, ptr_controller, kbd_controller, audio_controller, 708c2ecf20Sopenharmony_ci misc_controller, disk_peripheral, flpy_peripheral, tp_peripheral, 718c2ecf20Sopenharmony_ci modem_peripheral, monitor_peripheral, printer_peripheral, 728c2ecf20Sopenharmony_ci ptr_peripheral, kbd_peripheral, term_peripheral, line_peripheral, 738c2ecf20Sopenharmony_ci net_peripheral, misc_peripheral, anon 748c2ecf20Sopenharmony_ci}; 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_cienum linux_identifier { 778c2ecf20Sopenharmony_ci bogus, ronly, removable, consin, consout, input, output 788c2ecf20Sopenharmony_ci}; 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci/* A prom device tree component. */ 818c2ecf20Sopenharmony_cistruct linux_component { 828c2ecf20Sopenharmony_ci enum linux_devclass class; /* node class */ 838c2ecf20Sopenharmony_ci enum linux_devtypes type; /* node type */ 848c2ecf20Sopenharmony_ci enum linux_identifier iflags; /* node flags */ 858c2ecf20Sopenharmony_ci USHORT vers; /* node version */ 868c2ecf20Sopenharmony_ci USHORT rev; /* node revision */ 878c2ecf20Sopenharmony_ci ULONG key; /* completely magic */ 888c2ecf20Sopenharmony_ci ULONG amask; /* XXX affinity mask??? */ 898c2ecf20Sopenharmony_ci ULONG cdsize; /* size of configuration data */ 908c2ecf20Sopenharmony_ci ULONG ilen; /* length of string identifier */ 918c2ecf20Sopenharmony_ci _PULONG iname; /* string identifier */ 928c2ecf20Sopenharmony_ci}; 938c2ecf20Sopenharmony_citypedef struct linux_component pcomponent; 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_cistruct linux_sysid { 968c2ecf20Sopenharmony_ci char vend[8], prod[8]; 978c2ecf20Sopenharmony_ci}; 988c2ecf20Sopenharmony_ci 998c2ecf20Sopenharmony_ci/* ARCS prom memory descriptors. */ 1008c2ecf20Sopenharmony_cienum arcs_memtypes { 1018c2ecf20Sopenharmony_ci arcs_eblock, /* exception block */ 1028c2ecf20Sopenharmony_ci arcs_rvpage, /* ARCS romvec page */ 1038c2ecf20Sopenharmony_ci arcs_fcontig, /* Contiguous and free */ 1048c2ecf20Sopenharmony_ci arcs_free, /* Generic free memory */ 1058c2ecf20Sopenharmony_ci arcs_bmem, /* Borken memory, don't use */ 1068c2ecf20Sopenharmony_ci arcs_prog, /* A loaded program resides here */ 1078c2ecf20Sopenharmony_ci arcs_atmp, /* ARCS temporary storage area, wish Sparc OpenBoot told this */ 1088c2ecf20Sopenharmony_ci arcs_aperm, /* ARCS permanent storage... */ 1098c2ecf20Sopenharmony_ci}; 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ci/* ARC has slightly different types than ARCS */ 1128c2ecf20Sopenharmony_cienum arc_memtypes { 1138c2ecf20Sopenharmony_ci arc_eblock, /* exception block */ 1148c2ecf20Sopenharmony_ci arc_rvpage, /* romvec page */ 1158c2ecf20Sopenharmony_ci arc_free, /* Generic free memory */ 1168c2ecf20Sopenharmony_ci arc_bmem, /* Borken memory, don't use */ 1178c2ecf20Sopenharmony_ci arc_prog, /* A loaded program resides here */ 1188c2ecf20Sopenharmony_ci arc_atmp, /* temporary storage area */ 1198c2ecf20Sopenharmony_ci arc_aperm, /* permanent storage */ 1208c2ecf20Sopenharmony_ci arc_fcontig, /* Contiguous and free */ 1218c2ecf20Sopenharmony_ci}; 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ciunion linux_memtypes { 1248c2ecf20Sopenharmony_ci enum arcs_memtypes arcs; 1258c2ecf20Sopenharmony_ci enum arc_memtypes arc; 1268c2ecf20Sopenharmony_ci}; 1278c2ecf20Sopenharmony_ci 1288c2ecf20Sopenharmony_cistruct linux_mdesc { 1298c2ecf20Sopenharmony_ci union linux_memtypes type; 1308c2ecf20Sopenharmony_ci ULONG base; 1318c2ecf20Sopenharmony_ci ULONG pages; 1328c2ecf20Sopenharmony_ci}; 1338c2ecf20Sopenharmony_ci 1348c2ecf20Sopenharmony_ci/* Time of day descriptor. */ 1358c2ecf20Sopenharmony_cistruct linux_tinfo { 1368c2ecf20Sopenharmony_ci unsigned short yr; 1378c2ecf20Sopenharmony_ci unsigned short mnth; 1388c2ecf20Sopenharmony_ci unsigned short day; 1398c2ecf20Sopenharmony_ci unsigned short hr; 1408c2ecf20Sopenharmony_ci unsigned short min; 1418c2ecf20Sopenharmony_ci unsigned short sec; 1428c2ecf20Sopenharmony_ci unsigned short msec; 1438c2ecf20Sopenharmony_ci}; 1448c2ecf20Sopenharmony_ci 1458c2ecf20Sopenharmony_ci/* ARCS virtual dirents. */ 1468c2ecf20Sopenharmony_cistruct linux_vdirent { 1478c2ecf20Sopenharmony_ci ULONG namelen; 1488c2ecf20Sopenharmony_ci unsigned char attr; 1498c2ecf20Sopenharmony_ci char fname[32]; /* XXX empirical, should be a define */ 1508c2ecf20Sopenharmony_ci}; 1518c2ecf20Sopenharmony_ci 1528c2ecf20Sopenharmony_ci/* Other stuff for files. */ 1538c2ecf20Sopenharmony_cienum linux_omode { 1548c2ecf20Sopenharmony_ci rdonly, wronly, rdwr, wronly_creat, rdwr_creat, 1558c2ecf20Sopenharmony_ci wronly_ssede, rdwr_ssede, dirent, dirent_creat 1568c2ecf20Sopenharmony_ci}; 1578c2ecf20Sopenharmony_ci 1588c2ecf20Sopenharmony_cienum linux_seekmode { 1598c2ecf20Sopenharmony_ci absolute, relative 1608c2ecf20Sopenharmony_ci}; 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_cienum linux_mountops { 1638c2ecf20Sopenharmony_ci media_load, media_unload 1648c2ecf20Sopenharmony_ci}; 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_ci/* This prom has a bolixed design. */ 1678c2ecf20Sopenharmony_cistruct linux_bigint { 1688c2ecf20Sopenharmony_ci#ifdef __MIPSEL__ 1698c2ecf20Sopenharmony_ci u32 lo; 1708c2ecf20Sopenharmony_ci s32 hi; 1718c2ecf20Sopenharmony_ci#else /* !(__MIPSEL__) */ 1728c2ecf20Sopenharmony_ci s32 hi; 1738c2ecf20Sopenharmony_ci u32 lo; 1748c2ecf20Sopenharmony_ci#endif 1758c2ecf20Sopenharmony_ci}; 1768c2ecf20Sopenharmony_ci 1778c2ecf20Sopenharmony_cistruct linux_finfo { 1788c2ecf20Sopenharmony_ci struct linux_bigint begin; 1798c2ecf20Sopenharmony_ci struct linux_bigint end; 1808c2ecf20Sopenharmony_ci struct linux_bigint cur; 1818c2ecf20Sopenharmony_ci enum linux_devtypes dtype; 1828c2ecf20Sopenharmony_ci unsigned long namelen; 1838c2ecf20Sopenharmony_ci unsigned char attr; 1848c2ecf20Sopenharmony_ci char name[32]; /* XXX empirical, should be define */ 1858c2ecf20Sopenharmony_ci}; 1868c2ecf20Sopenharmony_ci 1878c2ecf20Sopenharmony_ci/* This describes the vector containing function pointers to the ARC 1888c2ecf20Sopenharmony_ci firmware functions. */ 1898c2ecf20Sopenharmony_cistruct linux_romvec { 1908c2ecf20Sopenharmony_ci LONG load; /* Load an executable image. */ 1918c2ecf20Sopenharmony_ci LONG invoke; /* Invoke a standalong image. */ 1928c2ecf20Sopenharmony_ci LONG exec; /* Load and begin execution of a 1938c2ecf20Sopenharmony_ci standalone image. */ 1948c2ecf20Sopenharmony_ci LONG halt; /* Halt the machine. */ 1958c2ecf20Sopenharmony_ci LONG pdown; /* Power down the machine. */ 1968c2ecf20Sopenharmony_ci LONG restart; /* XXX soft reset??? */ 1978c2ecf20Sopenharmony_ci LONG reboot; /* Reboot the machine. */ 1988c2ecf20Sopenharmony_ci LONG imode; /* Enter PROM interactive mode. */ 1998c2ecf20Sopenharmony_ci LONG _unused1; /* Was ReturnFromMain(). */ 2008c2ecf20Sopenharmony_ci 2018c2ecf20Sopenharmony_ci /* PROM device tree interface. */ 2028c2ecf20Sopenharmony_ci LONG next_component; 2038c2ecf20Sopenharmony_ci LONG child_component; 2048c2ecf20Sopenharmony_ci LONG parent_component; 2058c2ecf20Sopenharmony_ci LONG component_data; 2068c2ecf20Sopenharmony_ci LONG child_add; 2078c2ecf20Sopenharmony_ci LONG comp_del; 2088c2ecf20Sopenharmony_ci LONG component_by_path; 2098c2ecf20Sopenharmony_ci 2108c2ecf20Sopenharmony_ci /* Misc. stuff. */ 2118c2ecf20Sopenharmony_ci LONG cfg_save; 2128c2ecf20Sopenharmony_ci LONG get_sysid; 2138c2ecf20Sopenharmony_ci 2148c2ecf20Sopenharmony_ci /* Probing for memory. */ 2158c2ecf20Sopenharmony_ci LONG get_mdesc; 2168c2ecf20Sopenharmony_ci LONG _unused2; /* was Signal() */ 2178c2ecf20Sopenharmony_ci 2188c2ecf20Sopenharmony_ci LONG get_tinfo; 2198c2ecf20Sopenharmony_ci LONG get_rtime; 2208c2ecf20Sopenharmony_ci 2218c2ecf20Sopenharmony_ci /* File type operations. */ 2228c2ecf20Sopenharmony_ci LONG get_vdirent; 2238c2ecf20Sopenharmony_ci LONG open; 2248c2ecf20Sopenharmony_ci LONG close; 2258c2ecf20Sopenharmony_ci LONG read; 2268c2ecf20Sopenharmony_ci LONG get_rstatus; 2278c2ecf20Sopenharmony_ci LONG write; 2288c2ecf20Sopenharmony_ci LONG seek; 2298c2ecf20Sopenharmony_ci LONG mount; 2308c2ecf20Sopenharmony_ci 2318c2ecf20Sopenharmony_ci /* Dealing with firmware environment variables. */ 2328c2ecf20Sopenharmony_ci LONG get_evar; 2338c2ecf20Sopenharmony_ci LONG set_evar; 2348c2ecf20Sopenharmony_ci 2358c2ecf20Sopenharmony_ci LONG get_finfo; 2368c2ecf20Sopenharmony_ci LONG set_finfo; 2378c2ecf20Sopenharmony_ci 2388c2ecf20Sopenharmony_ci /* Miscellaneous. */ 2398c2ecf20Sopenharmony_ci LONG cache_flush; 2408c2ecf20Sopenharmony_ci LONG TestUnicodeCharacter; /* ARC; not sure if ARCS too */ 2418c2ecf20Sopenharmony_ci LONG GetDisplayStatus; 2428c2ecf20Sopenharmony_ci}; 2438c2ecf20Sopenharmony_ci 2448c2ecf20Sopenharmony_ci/* The SGI ARCS parameter block is in a fixed location for standalone 2458c2ecf20Sopenharmony_ci * programs to access PROM facilities easily. 2468c2ecf20Sopenharmony_ci */ 2478c2ecf20Sopenharmony_citypedef struct _SYSTEM_PARAMETER_BLOCK { 2488c2ecf20Sopenharmony_ci ULONG magic; /* magic cookie */ 2498c2ecf20Sopenharmony_ci#define PROMBLOCK_MAGIC 0x53435241 2508c2ecf20Sopenharmony_ci 2518c2ecf20Sopenharmony_ci ULONG len; /* length of parm block */ 2528c2ecf20Sopenharmony_ci USHORT ver; /* ARCS firmware version */ 2538c2ecf20Sopenharmony_ci USHORT rev; /* ARCS firmware revision */ 2548c2ecf20Sopenharmony_ci _PLONG rs_block; /* Restart block. */ 2558c2ecf20Sopenharmony_ci _PLONG dbg_block; /* Debug block. */ 2568c2ecf20Sopenharmony_ci _PLONG gevect; /* XXX General vector??? */ 2578c2ecf20Sopenharmony_ci _PLONG utlbvect; /* XXX UTLB vector??? */ 2588c2ecf20Sopenharmony_ci ULONG rveclen; /* Size of romvec struct. */ 2598c2ecf20Sopenharmony_ci _PVOID romvec; /* Function interface. */ 2608c2ecf20Sopenharmony_ci ULONG pveclen; /* Length of private vector. */ 2618c2ecf20Sopenharmony_ci _PVOID pvector; /* Private vector. */ 2628c2ecf20Sopenharmony_ci ULONG adap_cnt; /* Adapter count. */ 2638c2ecf20Sopenharmony_ci ULONG adap_typ0; /* First adapter type. */ 2648c2ecf20Sopenharmony_ci ULONG adap_vcnt0; /* Adapter 0 vector count. */ 2658c2ecf20Sopenharmony_ci _PVOID adap_vector; /* Adapter 0 vector ptr. */ 2668c2ecf20Sopenharmony_ci ULONG adap_typ1; /* Second adapter type. */ 2678c2ecf20Sopenharmony_ci ULONG adap_vcnt1; /* Adapter 1 vector count. */ 2688c2ecf20Sopenharmony_ci _PVOID adap_vector1; /* Adapter 1 vector ptr. */ 2698c2ecf20Sopenharmony_ci /* More adapter vectors go here... */ 2708c2ecf20Sopenharmony_ci} SYSTEM_PARAMETER_BLOCK, *PSYSTEM_PARAMETER_BLOCK; 2718c2ecf20Sopenharmony_ci 2728c2ecf20Sopenharmony_ci#define PROMBLOCK ((PSYSTEM_PARAMETER_BLOCK) (int)0xA0001000) 2738c2ecf20Sopenharmony_ci#define ROMVECTOR ((struct linux_romvec *) (long)(PROMBLOCK)->romvec) 2748c2ecf20Sopenharmony_ci 2758c2ecf20Sopenharmony_ci/* Cache layout parameter block. */ 2768c2ecf20Sopenharmony_ciunion linux_cache_key { 2778c2ecf20Sopenharmony_ci struct param { 2788c2ecf20Sopenharmony_ci#ifdef __MIPSEL__ 2798c2ecf20Sopenharmony_ci unsigned short size; 2808c2ecf20Sopenharmony_ci unsigned char lsize; 2818c2ecf20Sopenharmony_ci unsigned char bsize; 2828c2ecf20Sopenharmony_ci#else /* !(__MIPSEL__) */ 2838c2ecf20Sopenharmony_ci unsigned char bsize; 2848c2ecf20Sopenharmony_ci unsigned char lsize; 2858c2ecf20Sopenharmony_ci unsigned short size; 2868c2ecf20Sopenharmony_ci#endif 2878c2ecf20Sopenharmony_ci } info; 2888c2ecf20Sopenharmony_ci unsigned long allinfo; 2898c2ecf20Sopenharmony_ci}; 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_ci/* Configuration data. */ 2928c2ecf20Sopenharmony_cistruct linux_cdata { 2938c2ecf20Sopenharmony_ci char *name; 2948c2ecf20Sopenharmony_ci int mlen; 2958c2ecf20Sopenharmony_ci enum linux_devtypes type; 2968c2ecf20Sopenharmony_ci}; 2978c2ecf20Sopenharmony_ci 2988c2ecf20Sopenharmony_ci/* Common SGI ARCS firmware file descriptors. */ 2998c2ecf20Sopenharmony_ci#define SGIPROM_STDIN 0 3008c2ecf20Sopenharmony_ci#define SGIPROM_STDOUT 1 3018c2ecf20Sopenharmony_ci 3028c2ecf20Sopenharmony_ci/* Common SGI ARCS firmware file types. */ 3038c2ecf20Sopenharmony_ci#define SGIPROM_ROFILE 0x01 /* read-only file */ 3048c2ecf20Sopenharmony_ci#define SGIPROM_HFILE 0x02 /* hidden file */ 3058c2ecf20Sopenharmony_ci#define SGIPROM_SFILE 0x04 /* System file */ 3068c2ecf20Sopenharmony_ci#define SGIPROM_AFILE 0x08 /* Archive file */ 3078c2ecf20Sopenharmony_ci#define SGIPROM_DFILE 0x10 /* Directory file */ 3088c2ecf20Sopenharmony_ci#define SGIPROM_DELFILE 0x20 /* Deleted file */ 3098c2ecf20Sopenharmony_ci 3108c2ecf20Sopenharmony_ci/* SGI ARCS boot record information. */ 3118c2ecf20Sopenharmony_cistruct sgi_partition { 3128c2ecf20Sopenharmony_ci unsigned char flag; 3138c2ecf20Sopenharmony_ci#define SGIPART_UNUSED 0x00 3148c2ecf20Sopenharmony_ci#define SGIPART_ACTIVE 0x80 3158c2ecf20Sopenharmony_ci 3168c2ecf20Sopenharmony_ci unsigned char shead, ssect, scyl; /* unused */ 3178c2ecf20Sopenharmony_ci unsigned char systype; /* OS type, Irix or NT */ 3188c2ecf20Sopenharmony_ci unsigned char ehead, esect, ecyl; /* unused */ 3198c2ecf20Sopenharmony_ci unsigned char rsect0, rsect1, rsect2, rsect3; 3208c2ecf20Sopenharmony_ci unsigned char tsect0, tsect1, tsect2, tsect3; 3218c2ecf20Sopenharmony_ci}; 3228c2ecf20Sopenharmony_ci 3238c2ecf20Sopenharmony_ci#define SGIBBLOCK_MAGIC 0xaa55 3248c2ecf20Sopenharmony_ci#define SGIBBLOCK_MAXPART 0x0004 3258c2ecf20Sopenharmony_ci 3268c2ecf20Sopenharmony_cistruct sgi_bootblock { 3278c2ecf20Sopenharmony_ci unsigned char _unused[446]; 3288c2ecf20Sopenharmony_ci struct sgi_partition partitions[SGIBBLOCK_MAXPART]; 3298c2ecf20Sopenharmony_ci unsigned short magic; 3308c2ecf20Sopenharmony_ci}; 3318c2ecf20Sopenharmony_ci 3328c2ecf20Sopenharmony_ci/* BIOS parameter block. */ 3338c2ecf20Sopenharmony_cistruct sgi_bparm_block { 3348c2ecf20Sopenharmony_ci unsigned short bytes_sect; /* bytes per sector */ 3358c2ecf20Sopenharmony_ci unsigned char sect_clust; /* sectors per cluster */ 3368c2ecf20Sopenharmony_ci unsigned short sect_resv; /* reserved sectors */ 3378c2ecf20Sopenharmony_ci unsigned char nfats; /* # of allocation tables */ 3388c2ecf20Sopenharmony_ci unsigned short nroot_dirents; /* # of root directory entries */ 3398c2ecf20Sopenharmony_ci unsigned short sect_volume; /* sectors in volume */ 3408c2ecf20Sopenharmony_ci unsigned char media_type; /* media descriptor */ 3418c2ecf20Sopenharmony_ci unsigned short sect_fat; /* sectors per allocation table */ 3428c2ecf20Sopenharmony_ci unsigned short sect_track; /* sectors per track */ 3438c2ecf20Sopenharmony_ci unsigned short nheads; /* # of heads */ 3448c2ecf20Sopenharmony_ci unsigned short nhsects; /* # of hidden sectors */ 3458c2ecf20Sopenharmony_ci}; 3468c2ecf20Sopenharmony_ci 3478c2ecf20Sopenharmony_cistruct sgi_bsector { 3488c2ecf20Sopenharmony_ci unsigned char jmpinfo[3]; 3498c2ecf20Sopenharmony_ci unsigned char manuf_name[8]; 3508c2ecf20Sopenharmony_ci struct sgi_bparm_block info; 3518c2ecf20Sopenharmony_ci}; 3528c2ecf20Sopenharmony_ci 3538c2ecf20Sopenharmony_ci/* Debugging block used with SGI symmon symbolic debugger. */ 3548c2ecf20Sopenharmony_ci#define SMB_DEBUG_MAGIC 0xfeeddead 3558c2ecf20Sopenharmony_cistruct linux_smonblock { 3568c2ecf20Sopenharmony_ci unsigned long magic; 3578c2ecf20Sopenharmony_ci void (*handler)(void); /* Breakpoint routine. */ 3588c2ecf20Sopenharmony_ci unsigned long dtable_base; /* Base addr of dbg table. */ 3598c2ecf20Sopenharmony_ci int (*printf)(const char *fmt, ...); 3608c2ecf20Sopenharmony_ci unsigned long btable_base; /* Breakpoint table. */ 3618c2ecf20Sopenharmony_ci unsigned long mpflushreqs; /* SMP cache flush request list. */ 3628c2ecf20Sopenharmony_ci unsigned long ntab; /* Name table. */ 3638c2ecf20Sopenharmony_ci unsigned long stab; /* Symbol table. */ 3648c2ecf20Sopenharmony_ci int smax; /* Max # of symbols. */ 3658c2ecf20Sopenharmony_ci}; 3668c2ecf20Sopenharmony_ci 3678c2ecf20Sopenharmony_ci/* 3688c2ecf20Sopenharmony_ci * Macros for calling a 32-bit ARC implementation from 64-bit code 3698c2ecf20Sopenharmony_ci */ 3708c2ecf20Sopenharmony_ci 3718c2ecf20Sopenharmony_ci#if defined(CONFIG_64BIT) && defined(CONFIG_FW_ARC32) 3728c2ecf20Sopenharmony_ci 3738c2ecf20Sopenharmony_ciextern long call_o32(long vec, void *stack, ...); 3748c2ecf20Sopenharmony_ci 3758c2ecf20Sopenharmony_ciextern u64 o32_stk[4096]; 3768c2ecf20Sopenharmony_ci#define O32_STK (&o32_stk[ARRAY_SIZE(o32_stk)]) 3778c2ecf20Sopenharmony_ci 3788c2ecf20Sopenharmony_ci#define ARC_CALL0(dest) \ 3798c2ecf20Sopenharmony_ci({ long __res; \ 3808c2ecf20Sopenharmony_ci long __vec = (long) romvec->dest; \ 3818c2ecf20Sopenharmony_ci __res = call_o32(__vec, O32_STK); \ 3828c2ecf20Sopenharmony_ci __res; \ 3838c2ecf20Sopenharmony_ci}) 3848c2ecf20Sopenharmony_ci 3858c2ecf20Sopenharmony_ci#define ARC_CALL1(dest, a1) \ 3868c2ecf20Sopenharmony_ci({ long __res; \ 3878c2ecf20Sopenharmony_ci int __a1 = (int) (long) (a1); \ 3888c2ecf20Sopenharmony_ci long __vec = (long) romvec->dest; \ 3898c2ecf20Sopenharmony_ci __res = call_o32(__vec, O32_STK, __a1); \ 3908c2ecf20Sopenharmony_ci __res; \ 3918c2ecf20Sopenharmony_ci}) 3928c2ecf20Sopenharmony_ci 3938c2ecf20Sopenharmony_ci#define ARC_CALL2(dest, a1, a2) \ 3948c2ecf20Sopenharmony_ci({ long __res; \ 3958c2ecf20Sopenharmony_ci int __a1 = (int) (long) (a1); \ 3968c2ecf20Sopenharmony_ci int __a2 = (int) (long) (a2); \ 3978c2ecf20Sopenharmony_ci long __vec = (long) romvec->dest; \ 3988c2ecf20Sopenharmony_ci __res = call_o32(__vec, O32_STK, __a1, __a2); \ 3998c2ecf20Sopenharmony_ci __res; \ 4008c2ecf20Sopenharmony_ci}) 4018c2ecf20Sopenharmony_ci 4028c2ecf20Sopenharmony_ci#define ARC_CALL3(dest, a1, a2, a3) \ 4038c2ecf20Sopenharmony_ci({ long __res; \ 4048c2ecf20Sopenharmony_ci int __a1 = (int) (long) (a1); \ 4058c2ecf20Sopenharmony_ci int __a2 = (int) (long) (a2); \ 4068c2ecf20Sopenharmony_ci int __a3 = (int) (long) (a3); \ 4078c2ecf20Sopenharmony_ci long __vec = (long) romvec->dest; \ 4088c2ecf20Sopenharmony_ci __res = call_o32(__vec, O32_STK, __a1, __a2, __a3); \ 4098c2ecf20Sopenharmony_ci __res; \ 4108c2ecf20Sopenharmony_ci}) 4118c2ecf20Sopenharmony_ci 4128c2ecf20Sopenharmony_ci#define ARC_CALL4(dest, a1, a2, a3, a4) \ 4138c2ecf20Sopenharmony_ci({ long __res; \ 4148c2ecf20Sopenharmony_ci int __a1 = (int) (long) (a1); \ 4158c2ecf20Sopenharmony_ci int __a2 = (int) (long) (a2); \ 4168c2ecf20Sopenharmony_ci int __a3 = (int) (long) (a3); \ 4178c2ecf20Sopenharmony_ci int __a4 = (int) (long) (a4); \ 4188c2ecf20Sopenharmony_ci long __vec = (long) romvec->dest; \ 4198c2ecf20Sopenharmony_ci __res = call_o32(__vec, O32_STK, __a1, __a2, __a3, __a4); \ 4208c2ecf20Sopenharmony_ci __res; \ 4218c2ecf20Sopenharmony_ci}) 4228c2ecf20Sopenharmony_ci 4238c2ecf20Sopenharmony_ci#define ARC_CALL5(dest, a1, a2, a3, a4, a5) \ 4248c2ecf20Sopenharmony_ci({ long __res; \ 4258c2ecf20Sopenharmony_ci int __a1 = (int) (long) (a1); \ 4268c2ecf20Sopenharmony_ci int __a2 = (int) (long) (a2); \ 4278c2ecf20Sopenharmony_ci int __a3 = (int) (long) (a3); \ 4288c2ecf20Sopenharmony_ci int __a4 = (int) (long) (a4); \ 4298c2ecf20Sopenharmony_ci int __a5 = (int) (long) (a5); \ 4308c2ecf20Sopenharmony_ci long __vec = (long) romvec->dest; \ 4318c2ecf20Sopenharmony_ci __res = call_o32(__vec, O32_STK, __a1, __a2, __a3, __a4, __a5); \ 4328c2ecf20Sopenharmony_ci __res; \ 4338c2ecf20Sopenharmony_ci}) 4348c2ecf20Sopenharmony_ci 4358c2ecf20Sopenharmony_ci#endif /* defined(CONFIG_64BIT) && defined(CONFIG_FW_ARC32) */ 4368c2ecf20Sopenharmony_ci 4378c2ecf20Sopenharmony_ci#if (defined(CONFIG_32BIT) && defined(CONFIG_FW_ARC32)) || \ 4388c2ecf20Sopenharmony_ci (defined(CONFIG_64BIT) && defined(CONFIG_FW_ARC64)) 4398c2ecf20Sopenharmony_ci 4408c2ecf20Sopenharmony_ci#define ARC_CALL0(dest) \ 4418c2ecf20Sopenharmony_ci({ long __res; \ 4428c2ecf20Sopenharmony_ci long (*__vec)(void) = (void *) romvec->dest; \ 4438c2ecf20Sopenharmony_ci \ 4448c2ecf20Sopenharmony_ci __res = __vec(); \ 4458c2ecf20Sopenharmony_ci __res; \ 4468c2ecf20Sopenharmony_ci}) 4478c2ecf20Sopenharmony_ci 4488c2ecf20Sopenharmony_ci#define ARC_CALL1(dest, a1) \ 4498c2ecf20Sopenharmony_ci({ long __res; \ 4508c2ecf20Sopenharmony_ci long __a1 = (long) (a1); \ 4518c2ecf20Sopenharmony_ci long (*__vec)(long) = (void *) romvec->dest; \ 4528c2ecf20Sopenharmony_ci \ 4538c2ecf20Sopenharmony_ci __res = __vec(__a1); \ 4548c2ecf20Sopenharmony_ci __res; \ 4558c2ecf20Sopenharmony_ci}) 4568c2ecf20Sopenharmony_ci 4578c2ecf20Sopenharmony_ci#define ARC_CALL2(dest, a1, a2) \ 4588c2ecf20Sopenharmony_ci({ long __res; \ 4598c2ecf20Sopenharmony_ci long __a1 = (long) (a1); \ 4608c2ecf20Sopenharmony_ci long __a2 = (long) (a2); \ 4618c2ecf20Sopenharmony_ci long (*__vec)(long, long) = (void *) romvec->dest; \ 4628c2ecf20Sopenharmony_ci \ 4638c2ecf20Sopenharmony_ci __res = __vec(__a1, __a2); \ 4648c2ecf20Sopenharmony_ci __res; \ 4658c2ecf20Sopenharmony_ci}) 4668c2ecf20Sopenharmony_ci 4678c2ecf20Sopenharmony_ci#define ARC_CALL3(dest, a1, a2, a3) \ 4688c2ecf20Sopenharmony_ci({ long __res; \ 4698c2ecf20Sopenharmony_ci long __a1 = (long) (a1); \ 4708c2ecf20Sopenharmony_ci long __a2 = (long) (a2); \ 4718c2ecf20Sopenharmony_ci long __a3 = (long) (a3); \ 4728c2ecf20Sopenharmony_ci long (*__vec)(long, long, long) = (void *) romvec->dest; \ 4738c2ecf20Sopenharmony_ci \ 4748c2ecf20Sopenharmony_ci __res = __vec(__a1, __a2, __a3); \ 4758c2ecf20Sopenharmony_ci __res; \ 4768c2ecf20Sopenharmony_ci}) 4778c2ecf20Sopenharmony_ci 4788c2ecf20Sopenharmony_ci#define ARC_CALL4(dest, a1, a2, a3, a4) \ 4798c2ecf20Sopenharmony_ci({ long __res; \ 4808c2ecf20Sopenharmony_ci long __a1 = (long) (a1); \ 4818c2ecf20Sopenharmony_ci long __a2 = (long) (a2); \ 4828c2ecf20Sopenharmony_ci long __a3 = (long) (a3); \ 4838c2ecf20Sopenharmony_ci long __a4 = (long) (a4); \ 4848c2ecf20Sopenharmony_ci long (*__vec)(long, long, long, long) = (void *) romvec->dest; \ 4858c2ecf20Sopenharmony_ci \ 4868c2ecf20Sopenharmony_ci __res = __vec(__a1, __a2, __a3, __a4); \ 4878c2ecf20Sopenharmony_ci __res; \ 4888c2ecf20Sopenharmony_ci}) 4898c2ecf20Sopenharmony_ci 4908c2ecf20Sopenharmony_ci#define ARC_CALL5(dest, a1, a2, a3, a4, a5) \ 4918c2ecf20Sopenharmony_ci({ long __res; \ 4928c2ecf20Sopenharmony_ci long __a1 = (long) (a1); \ 4938c2ecf20Sopenharmony_ci long __a2 = (long) (a2); \ 4948c2ecf20Sopenharmony_ci long __a3 = (long) (a3); \ 4958c2ecf20Sopenharmony_ci long __a4 = (long) (a4); \ 4968c2ecf20Sopenharmony_ci long __a5 = (long) (a5); \ 4978c2ecf20Sopenharmony_ci long (*__vec)(long, long, long, long, long); \ 4988c2ecf20Sopenharmony_ci __vec = (void *) romvec->dest; \ 4998c2ecf20Sopenharmony_ci \ 5008c2ecf20Sopenharmony_ci __res = __vec(__a1, __a2, __a3, __a4, __a5); \ 5018c2ecf20Sopenharmony_ci __res; \ 5028c2ecf20Sopenharmony_ci}) 5038c2ecf20Sopenharmony_ci#endif /* both kernel and ARC either 32-bit or 64-bit */ 5048c2ecf20Sopenharmony_ci 5058c2ecf20Sopenharmony_ci#endif /* _ASM_SGIARCS_H */ 506