0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef _SGI_IOC_H
0014 #define _SGI_IOC_H
0015
0016 #include <linux/types.h>
0017 #include <asm/sgi/pi1.h>
0018
0019
0020
0021
0022
0023
0024 struct sgioc_uart_regs {
0025 u8 _ctrl1[3];
0026 volatile u8 ctrl1;
0027 u8 _data1[3];
0028 volatile u8 data1;
0029 u8 _ctrl2[3];
0030 volatile u8 ctrl2;
0031 u8 _data2[3];
0032 volatile u8 data2;
0033 };
0034
0035 struct sgioc_keyb_regs {
0036 u8 _data[3];
0037 volatile u8 data;
0038 u8 _command[3];
0039 volatile u8 command;
0040 };
0041
0042 struct sgint_regs {
0043 u8 _istat0[3];
0044 volatile u8 istat0;
0045 #define SGINT_ISTAT0_FFULL 0x01
0046 #define SGINT_ISTAT0_SCSI0 0x02
0047 #define SGINT_ISTAT0_SCSI1 0x04
0048 #define SGINT_ISTAT0_ENET 0x08
0049 #define SGINT_ISTAT0_GFXDMA 0x10
0050 #define SGINT_ISTAT0_PPORT 0x20
0051 #define SGINT_ISTAT0_HPC2 0x40
0052 #define SGINT_ISTAT0_LIO2 0x80
0053 u8 _imask0[3];
0054 volatile u8 imask0;
0055 u8 _istat1[3];
0056 volatile u8 istat1;
0057 #define SGINT_ISTAT1_ISDNI 0x01
0058 #define SGINT_ISTAT1_PWR 0x02
0059 #define SGINT_ISTAT1_ISDNH 0x04
0060 #define SGINT_ISTAT1_LIO3 0x08
0061 #define SGINT_ISTAT1_HPC3 0x10
0062 #define SGINT_ISTAT1_AFAIL 0x20
0063 #define SGINT_ISTAT1_VIDEO 0x40
0064 #define SGINT_ISTAT1_GIO2 0x80
0065 u8 _imask1[3];
0066 volatile u8 imask1;
0067 u8 _vmeistat[3];
0068 volatile u8 vmeistat;
0069 u8 _cmeimask0[3];
0070 volatile u8 cmeimask0;
0071 u8 _cmeimask1[3];
0072 volatile u8 cmeimask1;
0073 u8 _cmepol[3];
0074 volatile u8 cmepol;
0075 u8 _tclear[3];
0076 volatile u8 tclear;
0077 u8 _errstat[3];
0078 volatile u8 errstat;
0079 u32 _unused0[2];
0080 u8 _tcnt0[3];
0081 volatile u8 tcnt0;
0082 u8 _tcnt1[3];
0083 volatile u8 tcnt1;
0084 u8 _tcnt2[3];
0085 volatile u8 tcnt2;
0086 u8 _tcword[3];
0087 volatile u8 tcword;
0088 #define SGINT_TCWORD_BCD 0x01
0089 #define SGINT_TCWORD_MMASK 0x0e
0090 #define SGINT_TCWORD_MITC 0x00
0091 #define SGINT_TCWORD_MOS 0x02
0092 #define SGINT_TCWORD_MRGEN 0x04
0093 #define SGINT_TCWORD_MSWGEN 0x06
0094 #define SGINT_TCWORD_MSWST 0x08
0095 #define SGINT_TCWORD_MHWST 0x0a
0096 #define SGINT_TCWORD_CMASK 0x30
0097 #define SGINT_TCWORD_CLAT 0x00
0098 #define SGINT_TCWORD_CLSB 0x10
0099 #define SGINT_TCWORD_CMSB 0x20
0100 #define SGINT_TCWORD_CALL 0x30
0101 #define SGINT_TCWORD_CNT0 0x00
0102 #define SGINT_TCWORD_CNT1 0x40
0103 #define SGINT_TCWORD_CNT2 0x80
0104 #define SGINT_TCWORD_CRBCK 0xc0
0105 };
0106
0107
0108
0109
0110 #define SGINT_TIMER_CLOCK 1000000
0111
0112
0113
0114
0115 #define SGINT_TCSAMP_COUNTER ((SGINT_TIMER_CLOCK / HZ) + 255)
0116
0117
0118 extern u8 sgi_ioc_reset, sgi_ioc_write;
0119
0120 struct sgioc_regs {
0121 struct pi1_regs pport;
0122 u32 _unused0[2];
0123 struct sgioc_uart_regs uart;
0124 struct sgioc_keyb_regs kbdmouse;
0125 u8 _gcsel[3];
0126 volatile u8 gcsel;
0127 u8 _genctrl[3];
0128 volatile u8 genctrl;
0129 u8 _panel[3];
0130 volatile u8 panel;
0131 #define SGIOC_PANEL_POWERON 0x01
0132 #define SGIOC_PANEL_POWERINTR 0x02
0133 #define SGIOC_PANEL_VOLDNINTR 0x10
0134 #define SGIOC_PANEL_VOLDNHOLD 0x20
0135 #define SGIOC_PANEL_VOLUPINTR 0x40
0136 #define SGIOC_PANEL_VOLUPHOLD 0x80
0137 u32 _unused1;
0138 u8 _sysid[3];
0139 volatile u8 sysid;
0140 #define SGIOC_SYSID_FULLHOUSE 0x01
0141 #define SGIOC_SYSID_BOARDREV(x) (((x) & 0x1e) >> 1)
0142 #define SGIOC_SYSID_CHIPREV(x) (((x) & 0xe0) >> 5)
0143 u32 _unused2;
0144 u8 _read[3];
0145 volatile u8 read;
0146 u32 _unused3;
0147 u8 _dmasel[3];
0148 volatile u8 dmasel;
0149 #define SGIOC_DMASEL_SCLK10MHZ 0x00
0150 #define SGIOC_DMASEL_ISDNB 0x01
0151 #define SGIOC_DMASEL_ISDNA 0x02
0152 #define SGIOC_DMASEL_PPORT 0x04
0153 #define SGIOC_DMASEL_SCLK667MHZ 0x10
0154 #define SGIOC_DMASEL_SCLKEXT 0x20
0155 u32 _unused4;
0156 u8 _reset[3];
0157 volatile u8 reset;
0158 #define SGIOC_RESET_PPORT 0x01
0159 #define SGIOC_RESET_KBDMOUSE 0x02
0160 #define SGIOC_RESET_EISA 0x04
0161 #define SGIOC_RESET_ISDN 0x08
0162 #define SGIOC_RESET_LC0OFF 0x10
0163 #define SGIOC_RESET_LC1OFF 0x20
0164 u32 _unused5;
0165 u8 _write[3];
0166 volatile u8 write;
0167 #define SGIOC_WRITE_NTHRESH 0x01
0168 #define SGIOC_WRITE_TPSPEED 0x02
0169 #define SGIOC_WRITE_EPSEL 0x04
0170 #define SGIOC_WRITE_EASEL 0x08
0171 #define SGIOC_WRITE_U1AMODE 0x10
0172 #define SGIOC_WRITE_U0AMODE 0x20
0173 #define SGIOC_WRITE_MLO 0x40
0174 #define SGIOC_WRITE_MHI 0x80
0175 u32 _unused6;
0176 struct sgint_regs int3;
0177 u32 _unused7[16];
0178 volatile u32 extio;
0179 #define EXTIO_S0_IRQ_3 0x8000
0180 #define EXTIO_S0_IRQ_2 0x4000
0181 #define EXTIO_S0_IRQ_1 0x2000
0182 #define EXTIO_S0_RETRACE 0x1000
0183 #define EXTIO_SG_IRQ_3 0x0800
0184 #define EXTIO_SG_IRQ_2 0x0400
0185 #define EXTIO_SG_IRQ_1 0x0200
0186 #define EXTIO_SG_RETRACE 0x0100
0187 #define EXTIO_GIO_33MHZ 0x0080
0188 #define EXTIO_EISA_BUSERR 0x0040
0189 #define EXTIO_MC_BUSERR 0x0020
0190 #define EXTIO_HPC3_BUSERR 0x0010
0191 #define EXTIO_S0_STAT_1 0x0008
0192 #define EXTIO_S0_STAT_0 0x0004
0193 #define EXTIO_SG_STAT_1 0x0002
0194 #define EXTIO_SG_STAT_0 0x0001
0195 };
0196
0197 extern struct sgioc_regs *sgioc;
0198 extern struct sgint_regs *sgint;
0199
0200 #endif