Go to the documentation of this file.
39 #define SIS_NEW_CONFIG_COMPAT
45 #define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args)
46 #define TWDEBUG(x) printk(KERN_INFO x "\n");
48 #define DPRINTK(fmt, args...)
52 #define SISFAIL(x) do { printk(x "\n"); return -EINVAL; } while(0)
55 #ifndef PCI_DEVICE_ID_SI_650_VGA
56 #define PCI_DEVICE_ID_SI_650_VGA 0x6325
58 #ifndef PCI_DEVICE_ID_SI_650
59 #define PCI_DEVICE_ID_SI_650 0x0650
61 #ifndef PCI_DEVICE_ID_SI_651
62 #define PCI_DEVICE_ID_SI_651 0x0651
64 #ifndef PCI_DEVICE_ID_SI_740
65 #define PCI_DEVICE_ID_SI_740 0x0740
67 #ifndef PCI_DEVICE_ID_SI_330
68 #define PCI_DEVICE_ID_SI_330 0x0330
70 #ifndef PCI_DEVICE_ID_SI_660_VGA
71 #define PCI_DEVICE_ID_SI_660_VGA 0x6330
73 #ifndef PCI_DEVICE_ID_SI_661
74 #define PCI_DEVICE_ID_SI_661 0x0661
76 #ifndef PCI_DEVICE_ID_SI_741
77 #define PCI_DEVICE_ID_SI_741 0x0741
79 #ifndef PCI_DEVICE_ID_SI_660
80 #define PCI_DEVICE_ID_SI_660 0x0660
82 #ifndef PCI_DEVICE_ID_SI_760
83 #define PCI_DEVICE_ID_SI_760 0x0760
85 #ifndef PCI_DEVICE_ID_SI_761
86 #define PCI_DEVICE_ID_SI_761 0x0761
89 #ifndef PCI_VENDOR_ID_XGI
90 #define PCI_VENDOR_ID_XGI 0x18ca
93 #ifndef PCI_DEVICE_ID_XGI_20
94 #define PCI_DEVICE_ID_XGI_20 0x0020
97 #ifndef PCI_DEVICE_ID_XGI_40
98 #define PCI_DEVICE_ID_XGI_40 0x0040
102 #ifndef FB_ACCEL_SIS_GLAMOUR_2
103 #define FB_ACCEL_SIS_GLAMOUR_2 40
105 #ifndef FB_ACCEL_SIS_XABRE
106 #define FB_ACCEL_SIS_XABRE 41
108 #ifndef FB_ACCEL_XGI_VOLARI_V
109 #define FB_ACCEL_XGI_VOLARI_V 47
111 #ifndef FB_ACCEL_XGI_VOLARI_Z
112 #define FB_ACCEL_XGI_VOLARI_Z 48
116 #define HW_CURSOR_CAP 0x80
117 #define TURBO_QUEUE_CAP 0x40
118 #define AGP_CMD_QUEUE_CAP 0x20
119 #define VM_CMD_QUEUE_CAP 0x10
120 #define MMIO_CMD_QUEUE_CAP 0x08
123 #define TURBO_QUEUE_AREA_SIZE (512 * 1024)
124 #define HW_CURSOR_AREA_SIZE_300 4096
127 #define COMMAND_QUEUE_AREA_SIZE (512 * 1024)
128 #define COMMAND_QUEUE_AREA_SIZE_Z7 (128 * 1024)
129 #define HW_CURSOR_AREA_SIZE_315 16384
130 #define COMMAND_QUEUE_THRESHOLD 0x1F
132 #define SIS_OH_ALLOC_SIZE 4000
133 #define SENTINEL 0x7fffffff
136 #define SEQ_DATA 0x15
138 #define DAC_DATA 0x19
139 #define CRTC_ADR 0x24
140 #define CRTC_DATA 0x25
141 #define DAC2_ADR (0x16-0x30)
142 #define DAC2_DATA (0x17-0x30)
143 #define VB_PART1_ADR (0x04-0x30)
144 #define VB_PART1_DATA (0x05-0x30)
145 #define VB_PART2_ADR (0x10-0x30)
146 #define VB_PART2_DATA (0x11-0x30)
147 #define VB_PART3_ADR (0x12-0x30)
148 #define VB_PART3_DATA (0x13-0x30)
149 #define VB_PART4_ADR (0x14-0x30)
150 #define VB_PART4_DATA (0x15-0x30)
152 #define SISSR ivideo->SiS_Pr.SiS_P3c4
153 #define SISCR ivideo->SiS_Pr.SiS_P3d4
154 #define SISDACA ivideo->SiS_Pr.SiS_P3c8
155 #define SISDACD ivideo->SiS_Pr.SiS_P3c9
156 #define SISPART1 ivideo->SiS_Pr.SiS_Part1Port
157 #define SISPART2 ivideo->SiS_Pr.SiS_Part2Port
158 #define SISPART3 ivideo->SiS_Pr.SiS_Part3Port
159 #define SISPART4 ivideo->SiS_Pr.SiS_Part4Port
160 #define SISPART5 ivideo->SiS_Pr.SiS_Part5Port
161 #define SISDAC2A SISPART5
162 #define SISDAC2D (SISPART5 + 1)
163 #define SISMISCR (ivideo->SiS_Pr.RelIO + 0x1c)
164 #define SISMISCW ivideo->SiS_Pr.SiS_P3c2
165 #define SISINPSTAT (ivideo->SiS_Pr.RelIO + 0x2a)
166 #define SISPEL ivideo->SiS_Pr.SiS_P3c6
167 #define SISVGAENABLE (ivideo->SiS_Pr.RelIO + 0x13)
168 #define SISVID (ivideo->SiS_Pr.RelIO + 0x02 - 0x30)
169 #define SISCAP (ivideo->SiS_Pr.RelIO + 0x00 - 0x30)
171 #define IND_SIS_PASSWORD 0x05
172 #define IND_SIS_COLOR_MODE 0x06
173 #define IND_SIS_RAMDAC_CONTROL 0x07
174 #define IND_SIS_DRAM_SIZE 0x14
175 #define IND_SIS_MODULE_ENABLE 0x1E
176 #define IND_SIS_PCI_ADDRESS_SET 0x20
177 #define IND_SIS_TURBOQUEUE_ADR 0x26
178 #define IND_SIS_TURBOQUEUE_SET 0x27
179 #define IND_SIS_POWER_ON_TRAP 0x38
180 #define IND_SIS_POWER_ON_TRAP2 0x39
181 #define IND_SIS_CMDQUEUE_SET 0x26
182 #define IND_SIS_CMDQUEUE_THRESHOLD 0x27
184 #define IND_SIS_AGP_IO_PAD 0x48
186 #define SIS_CRT2_WENABLE_300 0x24
187 #define SIS_CRT2_WENABLE_315 0x2F
189 #define SIS_PASSWORD 0x86
191 #define SIS_INTERLACED_MODE 0x20
192 #define SIS_8BPP_COLOR_MODE 0x0
193 #define SIS_15BPP_COLOR_MODE 0x1
194 #define SIS_16BPP_COLOR_MODE 0x2
195 #define SIS_32BPP_COLOR_MODE 0x4
197 #define SIS_ENABLE_2D 0x40
199 #define SIS_MEM_MAP_IO_ENABLE 0x01
200 #define SIS_PCI_ADDR_ENABLE 0x80
202 #define SIS_AGP_CMDQUEUE_ENABLE 0x80
203 #define SIS_VRAM_CMDQUEUE_ENABLE 0x40
204 #define SIS_MMIO_CMD_ENABLE 0x20
205 #define SIS_CMD_QUEUE_SIZE_512k 0x00
206 #define SIS_CMD_QUEUE_SIZE_1M 0x04
207 #define SIS_CMD_QUEUE_SIZE_2M 0x08
208 #define SIS_CMD_QUEUE_SIZE_4M 0x0C
209 #define SIS_CMD_QUEUE_RESET 0x01
210 #define SIS_CMD_AUTO_CORR 0x02
212 #define SIS_CMD_QUEUE_SIZE_Z7_64k 0x00
213 #define SIS_CMD_QUEUE_SIZE_Z7_128k 0x04
215 #define SIS_SIMULTANEOUS_VIEW_ENABLE 0x01
216 #define SIS_MODE_SELECT_CRT2 0x02
217 #define SIS_VB_OUTPUT_COMPOSITE 0x04
218 #define SIS_VB_OUTPUT_SVIDEO 0x08
219 #define SIS_VB_OUTPUT_SCART 0x10
220 #define SIS_VB_OUTPUT_LCD 0x20
221 #define SIS_VB_OUTPUT_CRT2 0x40
222 #define SIS_VB_OUTPUT_HIVISION 0x80
224 #define SIS_VB_OUTPUT_DISABLE 0x20
225 #define SIS_DRIVER_MODE 0x40
227 #define SIS_VB_COMPOSITE 0x01
228 #define SIS_VB_SVIDEO 0x02
229 #define SIS_VB_SCART 0x04
230 #define SIS_VB_LCD 0x08
231 #define SIS_VB_CRT2 0x10
232 #define SIS_CRT1 0x20
233 #define SIS_VB_HIVISION 0x40
234 #define SIS_VB_YPBPR 0x80
235 #define SIS_VB_TV (SIS_VB_COMPOSITE | SIS_VB_SVIDEO | \
236 SIS_VB_SCART | SIS_VB_HIVISION | SIS_VB_YPBPR)
238 #define SIS_EXTERNAL_CHIP_MASK 0x0E
239 #define SIS_EXTERNAL_CHIP_SIS301 0x01
240 #define SIS_EXTERNAL_CHIP_LVDS 0x02
241 #define SIS_EXTERNAL_CHIP_TRUMPION 0x03
242 #define SIS_EXTERNAL_CHIP_LVDS_CHRONTEL 0x04
243 #define SIS_EXTERNAL_CHIP_CHRONTEL 0x05
244 #define SIS310_EXTERNAL_CHIP_LVDS 0x02
245 #define SIS310_EXTERNAL_CHIP_LVDS_CHRONTEL 0x03
247 #define SIS_AGP_2X 0x20
250 #define VB_CONEXANT 0x00000800
251 #define VB_TRUMPION VB_CONEXANT
252 #define VB_302ELV 0x00004000
253 #define VB_301 0x00100000
254 #define VB_301B 0x00200000
255 #define VB_302B 0x00400000
256 #define VB_30xBDH 0x00800000
257 #define VB_LVDS 0x01000000
258 #define VB_CHRONTEL 0x02000000
259 #define VB_301LV 0x04000000
260 #define VB_302LV 0x08000000
261 #define VB_301C 0x10000000
263 #define VB_SISBRIDGE (VB_301|VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV|VB_302ELV)
264 #define VB_VIDEOBRIDGE (VB_SISBRIDGE | VB_LVDS | VB_CHRONTEL | VB_CONEXANT)
267 #define VB2_SISUMC 0x00000001
268 #define VB2_301 0x00000002
269 #define VB2_301B 0x00000004
270 #define VB2_301C 0x00000008
271 #define VB2_307T 0x00000010
272 #define VB2_302B 0x00000800
273 #define VB2_301LV 0x00001000
274 #define VB2_302LV 0x00002000
275 #define VB2_302ELV 0x00004000
276 #define VB2_307LV 0x00008000
277 #define VB2_30xBDH 0x08000000
278 #define VB2_CONEXANT 0x10000000
279 #define VB2_TRUMPION 0x20000000
280 #define VB2_LVDS 0x40000000
281 #define VB2_CHRONTEL 0x80000000
283 #define VB2_SISLVDSBRIDGE (VB2_301LV | VB2_302LV | VB2_302ELV | VB2_307LV)
284 #define VB2_SISTMDSBRIDGE (VB2_301 | VB2_301B | VB2_301C | VB2_302B | VB2_307T)
285 #define VB2_SISBRIDGE (VB2_SISLVDSBRIDGE | VB2_SISTMDSBRIDGE)
287 #define VB2_SISTMDSLCDABRIDGE (VB2_301C | VB2_307T)
288 #define VB2_SISLCDABRIDGE (VB2_SISTMDSLCDABRIDGE | VB2_301LV | VB2_302LV | VB2_302ELV | VB2_307LV)
290 #define VB2_SISHIVISIONBRIDGE (VB2_301 | VB2_301B | VB2_302B)
291 #define VB2_SISYPBPRBRIDGE (VB2_301C | VB2_307T | VB2_SISLVDSBRIDGE)
292 #define VB2_SISYPBPRARBRIDGE (VB2_301C | VB2_307T | VB2_307LV)
293 #define VB2_SISTAP4SCALER (VB2_301C | VB2_307T | VB2_302ELV | VB2_307LV)
294 #define VB2_SISTVBRIDGE (VB2_SISHIVISIONBRIDGE | VB2_SISYPBPRBRIDGE)
296 #define VB2_SISVGA2BRIDGE (VB2_301 | VB2_301B | VB2_301C | VB2_302B | VB2_307T)
298 #define VB2_VIDEOBRIDGE (VB2_SISBRIDGE | VB2_LVDS | VB2_CHRONTEL | VB2_CONEXANT)
300 #define VB2_30xB (VB2_301B | VB2_301C | VB2_302B | VB2_307T)
301 #define VB2_30xBLV (VB2_30xB | VB2_SISLVDSBRIDGE)
302 #define VB2_30xC (VB2_301C | VB2_307T)
303 #define VB2_30xCLV (VB2_301C | VB2_307T | VB2_302ELV| VB2_307LV)
304 #define VB2_SISEMIBRIDGE (VB2_302LV | VB2_302ELV | VB2_307LV)
305 #define VB2_LCD162MHZBRIDGE (VB2_301C | VB2_307T)
306 #define VB2_LCDOVER1280BRIDGE (VB2_301C | VB2_307T | VB2_302LV | VB2_302ELV | VB2_307LV)
307 #define VB2_LCDOVER1600BRIDGE (VB2_307T | VB2_307LV)
308 #define VB2_RAMDAC202MHZBRIDGE (VB2_301C | VB2_307T)
325 #define MMIO_IN8(base, offset) readb((base+offset))
326 #define MMIO_IN16(base, offset) readw((base+offset))
327 #define MMIO_IN32(base, offset) readl((base+offset))
329 #define MMIO_OUT8(base, offset, val) writeb(((u8)(val)), (base+offset))
330 #define MMIO_OUT16(base, offset, val) writew(((u16)(val)), (base+offset))
331 #define MMIO_OUT32(base, offset, val) writel(((u32)(val)), (base+offset))
334 #define Q_BASE_ADDR 0x85C0
335 #define Q_WRITE_PTR 0x85C4
336 #define Q_READ_PTR 0x85C8
337 #define Q_STATUS 0x85CC
339 #define MMIO_QUEUE_PHYBASE Q_BASE_ADDR
340 #define MMIO_QUEUE_WRITEPORT Q_WRITE_PTR
341 #define MMIO_QUEUE_READPORT Q_READ_PTR
343 #ifndef FB_BLANK_UNBLANK
344 #define FB_BLANK_UNBLANK 0
346 #ifndef FB_BLANK_NORMAL
347 #define FB_BLANK_NORMAL 1
349 #ifndef FB_BLANK_VSYNC_SUSPEND
350 #define FB_BLANK_VSYNC_SUSPEND 2
352 #ifndef FB_BLANK_HSYNC_SUSPEND
353 #define FB_BLANK_HSYNC_SUSPEND 3
355 #ifndef FB_BLANK_POWERDOWN
356 #define FB_BLANK_POWERDOWN 4