1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef _SGI_IOC_H
14 #define _SGI_IOC_H
15
16 #include <linux/types.h>
17 #include <asm/sgi/pi1.h>
18
19
20
21
22
23
24 struct sgioc_uart_regs {
25 u8 _ctrl1[3];
26 volatile u8 ctrl1;
27 u8 _data1[3];
28 volatile u8 data1;
29 u8 _ctrl2[3];
30 volatile u8 ctrl2;
31 u8 _data2[3];
32 volatile u8 data2;
33 };
34
35 struct sgioc_keyb_regs {
36 u8 _data[3];
37 volatile u8 data;
38 u8 _command[3];
39 volatile u8 command;
40 };
41
42 struct sgint_regs {
43 u8 _istat0[3];
44 volatile u8 istat0;
45 #define SGINT_ISTAT0_FFULL 0x01
46 #define SGINT_ISTAT0_SCSI0 0x02
47 #define SGINT_ISTAT0_SCSI1 0x04
48 #define SGINT_ISTAT0_ENET 0x08
49 #define SGINT_ISTAT0_GFXDMA 0x10
50 #define SGINT_ISTAT0_PPORT 0x20
51 #define SGINT_ISTAT0_HPC2 0x40
52 #define SGINT_ISTAT0_LIO2 0x80
53 u8 _imask0[3];
54 volatile u8 imask0;
55 u8 _istat1[3];
56 volatile u8 istat1;
57 #define SGINT_ISTAT1_ISDNI 0x01
58 #define SGINT_ISTAT1_PWR 0x02
59 #define SGINT_ISTAT1_ISDNH 0x04
60 #define SGINT_ISTAT1_LIO3 0x08
61 #define SGINT_ISTAT1_HPC3 0x10
62 #define SGINT_ISTAT1_AFAIL 0x20
63 #define SGINT_ISTAT1_VIDEO 0x40
64 #define SGINT_ISTAT1_GIO2 0x80
65 u8 _imask1[3];
66 volatile u8 imask1;
67 u8 _vmeistat[3];
68 volatile u8 vmeistat;
69 u8 _cmeimask0[3];
70 volatile u8 cmeimask0;
71 u8 _cmeimask1[3];
72 volatile u8 cmeimask1;
73 u8 _cmepol[3];
74 volatile u8 cmepol;
75 u8 _tclear[3];
76 volatile u8 tclear;
77 u8 _errstat[3];
78 volatile u8 errstat;
79 u32 _unused0[2];
80 u8 _tcnt0[3];
81 volatile u8 tcnt0;
82 u8 _tcnt1[3];
83 volatile u8 tcnt1;
84 u8 _tcnt2[3];
85 volatile u8 tcnt2;
86 u8 _tcword[3];
87 volatile u8 tcword;
88 #define SGINT_TCWORD_BCD 0x01
89 #define SGINT_TCWORD_MMASK 0x0e
90 #define SGINT_TCWORD_MITC 0x00
91 #define SGINT_TCWORD_MOS 0x02
92 #define SGINT_TCWORD_MRGEN 0x04
93 #define SGINT_TCWORD_MSWGEN 0x06
94 #define SGINT_TCWORD_MSWST 0x08
95 #define SGINT_TCWORD_MHWST 0x0a
96 #define SGINT_TCWORD_CMASK 0x30
97 #define SGINT_TCWORD_CLAT 0x00
98 #define SGINT_TCWORD_CLSB 0x10
99 #define SGINT_TCWORD_CMSB 0x20
100 #define SGINT_TCWORD_CALL 0x30
101 #define SGINT_TCWORD_CNT0 0x00
102 #define SGINT_TCWORD_CNT1 0x40
103 #define SGINT_TCWORD_CNT2 0x80
104 #define SGINT_TCWORD_CRBCK 0xc0
105 };
106
107
108
109
110 #define SGINT_TIMER_CLOCK 1000000
111
112
113
114
115 #define SGINT_TCSAMP_COUNTER ((SGINT_TIMER_CLOCK / HZ) + 255)
116
117
118 extern u8 sgi_ioc_reset, sgi_ioc_write;
119
120 struct sgioc_regs {
121 struct pi1_regs pport;
122 u32 _unused0[2];
123 struct sgioc_uart_regs uart;
124 struct sgioc_keyb_regs kbdmouse;
125 u8 _gcsel[3];
126 volatile u8 gcsel;
127 u8 _genctrl[3];
128 volatile u8 genctrl;
129 u8 _panel[3];
130 volatile u8 panel;
131 #define SGIOC_PANEL_POWERON 0x01
132 #define SGIOC_PANEL_POWERINTR 0x02
133 #define SGIOC_PANEL_VOLDNINTR 0x10
134 #define SGIOC_PANEL_VOLDNHOLD 0x20
135 #define SGIOC_PANEL_VOLUPINTR 0x40
136 #define SGIOC_PANEL_VOLUPHOLD 0x80
137 u32 _unused1;
138 u8 _sysid[3];
139 volatile u8 sysid;
140 #define SGIOC_SYSID_FULLHOUSE 0x01
141 #define SGIOC_SYSID_BOARDREV(x) (((x) & 0x1e) >> 1)
142 #define SGIOC_SYSID_CHIPREV(x) (((x) & 0xe0) >> 5)
143 u32 _unused2;
144 u8 _read[3];
145 volatile u8 read;
146 u32 _unused3;
147 u8 _dmasel[3];
148 volatile u8 dmasel;
149 #define SGIOC_DMASEL_SCLK10MHZ 0x00
150 #define SGIOC_DMASEL_ISDNB 0x01
151 #define SGIOC_DMASEL_ISDNA 0x02
152 #define SGIOC_DMASEL_PPORT 0x04
153 #define SGIOC_DMASEL_SCLK667MHZ 0x10
154 #define SGIOC_DMASEL_SCLKEXT 0x20
155 u32 _unused4;
156 u8 _reset[3];
157 volatile u8 reset;
158 #define SGIOC_RESET_PPORT 0x01
159 #define SGIOC_RESET_KBDMOUSE 0x02
160 #define SGIOC_RESET_EISA 0x04
161 #define SGIOC_RESET_ISDN 0x08
162 #define SGIOC_RESET_LC0OFF 0x10
163 #define SGIOC_RESET_LC1OFF 0x20
164 u32 _unused5;
165 u8 _write[3];
166 volatile u8 write;
167 #define SGIOC_WRITE_NTHRESH 0x01
168 #define SGIOC_WRITE_TPSPEED 0x02
169 #define SGIOC_WRITE_EPSEL 0x04
170 #define SGIOC_WRITE_EASEL 0x08
171 #define SGIOC_WRITE_U1AMODE 0x10
172 #define SGIOC_WRITE_U0AMODE 0x20
173 #define SGIOC_WRITE_MLO 0x40
174 #define SGIOC_WRITE_MHI 0x80
175 u32 _unused6;
176 struct sgint_regs int3;
177 u32 _unused7[16];
178 volatile u32 extio;
179 #define EXTIO_S0_IRQ_3 0x8000
180 #define EXTIO_S0_IRQ_2 0x4000
181 #define EXTIO_S0_IRQ_1 0x2000
182 #define EXTIO_S0_RETRACE 0x1000
183 #define EXTIO_SG_IRQ_3 0x0800
184 #define EXTIO_SG_IRQ_2 0x0400
185 #define EXTIO_SG_IRQ_1 0x0200
186 #define EXTIO_SG_RETRACE 0x0100
187 #define EXTIO_GIO_33MHZ 0x0080
188 #define EXTIO_EISA_BUSERR 0x0040
189 #define EXTIO_MC_BUSERR 0x0020
190 #define EXTIO_HPC3_BUSERR 0x0010
191 #define EXTIO_S0_STAT_1 0x0008
192 #define EXTIO_S0_STAT_0 0x0004
193 #define EXTIO_SG_STAT_1 0x0002
194 #define EXTIO_SG_STAT_0 0x0001
195 };
196
197 extern struct sgioc_regs *sgioc;
198 extern struct sgint_regs *sgint;
199
200 #endif