|  | @@ -241,3 +241,196 @@ struct linux_romvec {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /* The SGI ARCS parameter block is in a fixed location for standalone
 | 
	
		
			
				|  |  |   * programs to access PROM facilities easily.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +typedef struct _SYSTEM_PARAMETER_BLOCK {
 | 
	
		
			
				|  |  | +	ULONG			magic;		/* magic cookie */
 | 
	
		
			
				|  |  | +#define PROMBLOCK_MAGIC      0x53435241
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	ULONG			len;		/* length of parm block */
 | 
	
		
			
				|  |  | +	USHORT			ver;		/* ARCS firmware version */
 | 
	
		
			
				|  |  | +	USHORT			rev;		/* ARCS firmware revision */
 | 
	
		
			
				|  |  | +	_PLONG			rs_block;	/* Restart block. */
 | 
	
		
			
				|  |  | +	_PLONG			dbg_block;	/* Debug block. */
 | 
	
		
			
				|  |  | +	_PLONG			gevect;		/* XXX General vector??? */
 | 
	
		
			
				|  |  | +	_PLONG			utlbvect;	/* XXX UTLB vector??? */
 | 
	
		
			
				|  |  | +	ULONG			rveclen;	/* Size of romvec struct. */
 | 
	
		
			
				|  |  | +	_PVOID			romvec;		/* Function interface. */
 | 
	
		
			
				|  |  | +	ULONG			pveclen;	/* Length of private vector. */
 | 
	
		
			
				|  |  | +	_PVOID			pvector;	/* Private vector. */
 | 
	
		
			
				|  |  | +	ULONG			adap_cnt;	/* Adapter count. */
 | 
	
		
			
				|  |  | +	ULONG			adap_typ0;	/* First adapter type. */
 | 
	
		
			
				|  |  | +	ULONG			adap_vcnt0;	/* Adapter 0 vector count. */
 | 
	
		
			
				|  |  | +	_PVOID			adap_vector;	/* Adapter 0 vector ptr. */
 | 
	
		
			
				|  |  | +	ULONG			adap_typ1;	/* Second adapter type. */
 | 
	
		
			
				|  |  | +	ULONG			adap_vcnt1;	/* Adapter 1 vector count. */
 | 
	
		
			
				|  |  | +	_PVOID			adap_vector1;	/* Adapter 1 vector ptr. */
 | 
	
		
			
				|  |  | +	/* More adapter vectors go here... */
 | 
	
		
			
				|  |  | +} SYSTEM_PARAMETER_BLOCK, *PSYSTEM_PARAMETER_BLOCK;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define PROMBLOCK ((PSYSTEM_PARAMETER_BLOCK) (int)0xA0001000)
 | 
	
		
			
				|  |  | +#define ROMVECTOR ((struct linux_romvec *) (long)(PROMBLOCK)->romvec)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* Cache layout parameter block. */
 | 
	
		
			
				|  |  | +union linux_cache_key {
 | 
	
		
			
				|  |  | +	struct param {
 | 
	
		
			
				|  |  | +#ifdef __MIPSEL__
 | 
	
		
			
				|  |  | +		unsigned short size;
 | 
	
		
			
				|  |  | +		unsigned char lsize;
 | 
	
		
			
				|  |  | +		unsigned char bsize;
 | 
	
		
			
				|  |  | +#else /* !(__MIPSEL__) */
 | 
	
		
			
				|  |  | +		unsigned char bsize;
 | 
	
		
			
				|  |  | +		unsigned char lsize;
 | 
	
		
			
				|  |  | +		unsigned short size;
 | 
	
		
			
				|  |  | +#endif
 | 
	
		
			
				|  |  | +	} info;
 | 
	
		
			
				|  |  | +	unsigned long allinfo;
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* Configuration data. */
 | 
	
		
			
				|  |  | +struct linux_cdata {
 | 
	
		
			
				|  |  | +	char *name;
 | 
	
		
			
				|  |  | +	int mlen;
 | 
	
		
			
				|  |  | +	enum linux_devtypes type;
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* Common SGI ARCS firmware file descriptors. */
 | 
	
		
			
				|  |  | +#define SGIPROM_STDIN     0
 | 
	
		
			
				|  |  | +#define SGIPROM_STDOUT    1
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* Common SGI ARCS firmware file types. */
 | 
	
		
			
				|  |  | +#define SGIPROM_ROFILE    0x01  /* read-only file */
 | 
	
		
			
				|  |  | +#define SGIPROM_HFILE     0x02  /* hidden file */
 | 
	
		
			
				|  |  | +#define SGIPROM_SFILE     0x04  /* System file */
 | 
	
		
			
				|  |  | +#define SGIPROM_AFILE     0x08  /* Archive file */
 | 
	
		
			
				|  |  | +#define SGIPROM_DFILE     0x10  /* Directory file */
 | 
	
		
			
				|  |  | +#define SGIPROM_DELFILE   0x20  /* Deleted file */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* SGI ARCS boot record information. */
 | 
	
		
			
				|  |  | +struct sgi_partition {
 | 
	
		
			
				|  |  | +	unsigned char flag;
 | 
	
		
			
				|  |  | +#define SGIPART_UNUSED 0x00
 | 
	
		
			
				|  |  | +#define SGIPART_ACTIVE 0x80
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	unsigned char shead, ssect, scyl; /* unused */
 | 
	
		
			
				|  |  | +	unsigned char systype; /* OS type, Irix or NT */
 | 
	
		
			
				|  |  | +	unsigned char ehead, esect, ecyl; /* unused */
 | 
	
		
			
				|  |  | +	unsigned char rsect0, rsect1, rsect2, rsect3;
 | 
	
		
			
				|  |  | +	unsigned char tsect0, tsect1, tsect2, tsect3;
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define SGIBBLOCK_MAGIC   0xaa55
 | 
	
		
			
				|  |  | +#define SGIBBLOCK_MAXPART 0x0004
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +struct sgi_bootblock {
 | 
	
		
			
				|  |  | +	unsigned char _unused[446];
 | 
	
		
			
				|  |  | +	struct sgi_partition partitions[SGIBBLOCK_MAXPART];
 | 
	
		
			
				|  |  | +	unsigned short magic;
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* BIOS parameter block. */
 | 
	
		
			
				|  |  | +struct sgi_bparm_block {
 | 
	
		
			
				|  |  | +	unsigned short bytes_sect;    /* bytes per sector */
 | 
	
		
			
				|  |  | +	unsigned char  sect_clust;    /* sectors per cluster */
 | 
	
		
			
				|  |  | +	unsigned short sect_resv;     /* reserved sectors */
 | 
	
		
			
				|  |  | +	unsigned char  nfats;         /* # of allocation tables */
 | 
	
		
			
				|  |  | +	unsigned short nroot_dirents; /* # of root directory entries */
 | 
	
		
			
				|  |  | +	unsigned short sect_volume;   /* sectors in volume */
 | 
	
		
			
				|  |  | +	unsigned char  media_type;    /* media descriptor */
 | 
	
		
			
				|  |  | +	unsigned short sect_fat;      /* sectors per allocation table */
 | 
	
		
			
				|  |  | +	unsigned short sect_track;    /* sectors per track */
 | 
	
		
			
				|  |  | +	unsigned short nheads;        /* # of heads */
 | 
	
		
			
				|  |  | +	unsigned short nhsects;       /* # of hidden sectors */
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +struct sgi_bsector {
 | 
	
		
			
				|  |  | +	unsigned char   jmpinfo[3];
 | 
	
		
			
				|  |  | +	unsigned char   manuf_name[8];
 | 
	
		
			
				|  |  | +	struct sgi_bparm_block info;
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* Debugging block used with SGI symmon symbolic debugger. */
 | 
	
		
			
				|  |  | +#define SMB_DEBUG_MAGIC   0xfeeddead
 | 
	
		
			
				|  |  | +struct linux_smonblock {
 | 
	
		
			
				|  |  | +	unsigned long   magic;
 | 
	
		
			
				|  |  | +	void            (*handler)(void);  /* Breakpoint routine. */
 | 
	
		
			
				|  |  | +	unsigned long   dtable_base;       /* Base addr of dbg table. */
 | 
	
		
			
				|  |  | +	int             (*printf)(const char *fmt, ...);
 | 
	
		
			
				|  |  | +	unsigned long   btable_base;       /* Breakpoint table. */
 | 
	
		
			
				|  |  | +	unsigned long   mpflushreqs;       /* SMP cache flush request list. */
 | 
	
		
			
				|  |  | +	unsigned long   ntab;              /* Name table. */
 | 
	
		
			
				|  |  | +	unsigned long   stab;              /* Symbol table. */
 | 
	
		
			
				|  |  | +	int             smax;              /* Max # of symbols. */
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/*
 | 
	
		
			
				|  |  | + * Macros for calling a 32-bit ARC implementation from 64-bit code
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#if defined(CONFIG_64BIT) && defined(CONFIG_FW_ARC32)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define __arc_clobbers							\
 | 
	
		
			
				|  |  | +	"$2", "$3" /* ... */, "$8", "$9", "$10", "$11", 			\
 | 
	
		
			
				|  |  | +	"$12", "$13", "$14", "$15", "$16", "$24", "$25", "$31"
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define ARC_CALL0(dest)							\
 | 
	
		
			
				|  |  | +({	long __res;							\
 | 
	
		
			
				|  |  | +	long __vec = (long) romvec->dest;				\
 | 
	
		
			
				|  |  | +	__asm__ __volatile__(						\
 | 
	
		
			
				|  |  | +	"dsubu\t$29, 32\n\t"						\
 | 
	
		
			
				|  |  | +	"jalr\t%1\n\t"							\
 | 
	
		
			
				|  |  | +	"daddu\t$29, 32\n\t"						\
 | 
	
		
			
				|  |  | +	"move\t%0, $2"							\
 | 
	
		
			
				|  |  | +	: "=r" (__res), "=r" (__vec)					\
 | 
	
		
			
				|  |  | +	: "1" (__vec)							\
 | 
	
		
			
				|  |  | +	: __arc_clobbers, "$4", "$5", "$6", "$7");			\
 | 
	
		
			
				|  |  | +	(unsigned long) __res;						\
 | 
	
		
			
				|  |  | +})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define ARC_CALL1(dest, a1)						\
 | 
	
		
			
				|  |  | +({	long __res;							\
 | 
	
		
			
				|  |  | +	register signed int __a1 __asm__("$4") = (int) (long) (a1);	\
 | 
	
		
			
				|  |  | +	long __vec = (long) romvec->dest;				\
 | 
	
		
			
				|  |  | +	__asm__ __volatile__(						\
 | 
	
		
			
				|  |  | +	"dsubu\t$29, 32\n\t"						\
 | 
	
		
			
				|  |  | +	"jalr\t%1\n\t"							\
 | 
	
		
			
				|  |  | +	"daddu\t$29, 32\n\t"						\
 | 
	
		
			
				|  |  | +	"move\t%0, $2"							\
 | 
	
		
			
				|  |  | +	: "=r" (__res), "=r" (__vec)					\
 | 
	
		
			
				|  |  | +	: "1" (__vec), "r" (__a1)					\
 | 
	
		
			
				|  |  | +	: __arc_clobbers, "$5", "$6", "$7");				\
 | 
	
		
			
				|  |  | +	(unsigned long) __res;						\
 | 
	
		
			
				|  |  | +})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define ARC_CALL2(dest, a1, a2)						\
 | 
	
		
			
				|  |  | +({	long __res;							\
 | 
	
		
			
				|  |  | +	register signed int __a1 __asm__("$4") = (int) (long) (a1);	\
 | 
	
		
			
				|  |  | +	register signed int __a2 __asm__("$5") = (int) (long) (a2);	\
 | 
	
		
			
				|  |  | +	long __vec = (long) romvec->dest;				\
 | 
	
		
			
				|  |  | +	__asm__ __volatile__(						\
 | 
	
		
			
				|  |  | +	"dsubu\t$29, 32\n\t"						\
 | 
	
		
			
				|  |  | +	"jalr\t%1\n\t"							\
 | 
	
		
			
				|  |  | +	"daddu\t$29, 32\n\t"						\
 | 
	
		
			
				|  |  | +	"move\t%0, $2"							\
 | 
	
		
			
				|  |  | +	: "=r" (__res), "=r" (__vec)					\
 | 
	
		
			
				|  |  | +	: "1" (__vec), "r" (__a1), "r" (__a2)				\
 | 
	
		
			
				|  |  | +	: __arc_clobbers, "$6", "$7");					\
 | 
	
		
			
				|  |  | +	__res;								\
 | 
	
		
			
				|  |  | +})
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define ARC_CALL3(dest, a1, a2, a3)					\
 | 
	
		
			
				|  |  | +({	long __res;							\
 | 
	
		
			
				|  |  | +	register signed int __a1 __asm__("$4") = (int) (long) (a1);	\
 | 
	
		
			
				|  |  | +	register signed int __a2 __asm__("$5") = (int) (long) (a2);	\
 | 
	
		
			
				|  |  | +	register signed int __a3 __asm__("$6") = (int) (long) (a3);	\
 | 
	
		
			
				|  |  | +	long __vec = (long) romvec->dest;				\
 | 
	
		
			
				|  |  | +	__asm__ __volatile__(						\
 | 
	
		
			
				|  |  | +	"dsubu\t$29, 32\n\t"						\
 | 
	
		
			
				|  |  | +	"jalr\t%1\n\t"							\
 | 
	
		
			
				|  |  | +	"daddu\t$29, 32\n\t"						\
 | 
	
		
			
				|  |  | +	"move\t%0, $2"							\
 | 
	
		
			
				|  |  | +	: "=r" (__res), "=r" (__vec)					\
 | 
	
		
			
				|  |  | +	: "1" (__vec), "r" (__a1), "r" (__a2), "r" (__a3)		\
 | 
	
		
			
				|  |  | +	: __arc_clobbers, "$7");					\
 | 
	
		
			
				|  |  | +	__res;								\
 | 
	
		
			
				|  |  | +})
 | 
	
		
			
				|  |  | +
 |