1 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h,v 1.13 2003/02/06 04:18:04 dawes Exp $ */
2 /**************************************************************************
4 Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
7 Permission is hereby granted, free of charge, to any person obtaining a
8 copy of this software and associated documentation files (the
9 "Software"), to deal in the Software without restriction, including
10 without limitation the rights to use, copy, modify, merge, publish,
11 distribute, sub license, and/or sell copies of the Software, and to
12 permit persons to whom the Software is furnished to do so, subject to
13 the following conditions:
15 The above copyright notice and this permission notice (including the
16 next paragraph) shall be included in all copies or substantial portions
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
23 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 **************************************************************************/
30 * Register names and fields for Intel graphics.
35 * Keith Whitwell <keith@tungstengraphics.com>
36 * Eric Anholt <eric@anholt.net>
38 * based on the i740 driver by
39 * Kevin E. Martin <kevin@precisioninsight.com>
47 /* I/O register offsets
49 #define SRX 0x3C4 /* p208 */
50 #define GRX 0x3CE /* p213 */
51 #define ARX 0x3C0 /* p224 */
53 /* VGA Color Palette Registers */
54 #define DACMASK 0x3C6 /* p232 */
55 #define DACSTATE 0x3C7 /* p232 */
56 #define DACRX 0x3C7 /* p233 */
57 #define DACWX 0x3C8 /* p233 */
58 #define DACDATA 0x3C9 /* p233 */
60 /* CRT Controller Registers (CRX) */
61 #define START_ADDR_HI 0x0C /* p246 */
62 #define START_ADDR_LO 0x0D /* p247 */
63 #define VERT_SYNC_END 0x11 /* p249 */
64 #define EXT_VERT_TOTAL 0x30 /* p257 */
65 #define EXT_VERT_DISPLAY 0x31 /* p258 */
66 #define EXT_VERT_SYNC_START 0x32 /* p259 */
67 #define EXT_VERT_BLANK_START 0x33 /* p260 */
68 #define EXT_HORIZ_TOTAL 0x35 /* p261 */
69 #define EXT_HORIZ_BLANK 0x39 /* p261 */
70 #define EXT_START_ADDR 0x40 /* p262 */
71 #define EXT_START_ADDR_ENABLE 0x80
72 #define EXT_OFFSET 0x41 /* p263 */
73 #define EXT_START_ADDR_HI 0x42 /* p263 */
74 #define INTERLACE_CNTL 0x70 /* p264 */
75 #define INTERLACE_ENABLE 0x80
76 #define INTERLACE_DISABLE 0x00
78 /* Miscellaneous Output Register
80 #define MSR_R 0x3CC /* p207 */
81 #define MSR_W 0x3C2 /* p207 */
82 #define IO_ADDR_SELECT 0x01
84 #define MDA_BASE 0x3B0 /* p207 */
85 #define CGA_BASE 0x3D0 /* p207 */
87 /* CR80 - IO Control, p264
90 #define EXTENDED_ATTR_CNTL 0x02
91 #define EXTENDED_CRTC_CNTL 0x01
93 /* GR10 - Address mapping, p221
95 #define ADDRESS_MAPPING 0x10
96 #define PAGE_TO_LOCAL_MEM_ENABLE 0x10
97 #define GTT_MEM_MAP_ENABLE 0x08
98 #define PACKED_MODE_ENABLE 0x04
99 #define LINEAR_MODE_ENABLE 0x02
100 #define PAGE_MAPPING_ENABLE 0x01
102 #define HOTKEY_VBIOS_SWITCH_BLOCK 0x80
103 #define HOTKEY_SWITCH 0x20
104 #define HOTKEY_TOGGLE 0x10
106 /* Blitter control, p378
108 #define BITBLT_CNTL 0x7000c
109 #define COLEXP_MODE 0x30
110 #define COLEXP_8BPP 0x00
111 #define COLEXP_16BPP 0x10
112 #define COLEXP_24BPP 0x20
113 #define COLEXP_RESERVED 0x30
114 #define BITBLT_STATUS 0x01
116 #define CHDECMISC 0x10111
118 #define C0DRB0 0x10200
119 #define C0DRB1 0x10202
120 #define C0DRB2 0x10204
121 #define C0DRB3 0x10206
122 #define C0DRA01 0x10208
123 #define C0DRA23 0x1020a
124 #define C1DRB0 0x10600
125 #define C1DRB1 0x10602
126 #define C1DRB2 0x10604
127 #define C1DRB3 0x10606
128 #define C1DRA01 0x10608
129 #define C1DRA23 0x1060a
133 #define DISPLAY_CNTL 0x70008
134 #define VGA_WRAP_MODE 0x02
135 #define VGA_WRAP_AT_256KB 0x00
136 #define VGA_NO_WRAP 0x02
137 #define GUI_MODE 0x01
138 #define STANDARD_VGA_MODE 0x00
139 #define HIRES_MODE 0x01
143 #define PIXPIPE_CONFIG_0 0x70009
144 #define DAC_8_BIT 0x80
145 #define DAC_6_BIT 0x00
146 #define HW_CURSOR_ENABLE 0x10
147 #define EXTENDED_PALETTE 0x01
151 #define PIXPIPE_CONFIG_1 0x7000a
152 #define DISPLAY_COLOR_MODE 0x0F
153 #define DISPLAY_VGA_MODE 0x00
154 #define DISPLAY_8BPP_MODE 0x02
155 #define DISPLAY_15BPP_MODE 0x04
156 #define DISPLAY_16BPP_MODE 0x05
157 #define DISPLAY_24BPP_MODE 0x06
158 #define DISPLAY_32BPP_MODE 0x07
162 #define PIXPIPE_CONFIG_2 0x7000b
163 #define DISPLAY_GAMMA_ENABLE 0x08
164 #define DISPLAY_GAMMA_DISABLE 0x00
165 #define OVERLAY_GAMMA_ENABLE 0x04
166 #define OVERLAY_GAMMA_DISABLE 0x00
171 #define DISPLAY_BASE 0x70020
172 #define DISPLAY_BASE_MASK 0x03fffffc
175 /* Cursor control registers, pp383-384
177 /* Desktop (845G, 865G) */
178 #define CURSOR_CONTROL 0x70080
179 #define CURSOR_ENABLE 0x80000000
180 #define CURSOR_GAMMA_ENABLE 0x40000000
181 #define CURSOR_STRIDE_MASK 0x30000000
182 #define CURSOR_FORMAT_SHIFT 24
183 #define CURSOR_FORMAT_MASK (0x07 << CURSOR_FORMAT_SHIFT)
184 #define CURSOR_FORMAT_2C (0x00 << CURSOR_FORMAT_SHIFT)
185 #define CURSOR_FORMAT_3C (0x01 << CURSOR_FORMAT_SHIFT)
186 #define CURSOR_FORMAT_4C (0x02 << CURSOR_FORMAT_SHIFT)
187 #define CURSOR_FORMAT_ARGB (0x04 << CURSOR_FORMAT_SHIFT)
188 #define CURSOR_FORMAT_XRGB (0x05 << CURSOR_FORMAT_SHIFT)
190 /* Mobile and i810 */
191 #define CURSOR_A_CONTROL CURSOR_CONTROL
192 #define CURSOR_ORIGIN_SCREEN 0x00 /* i810 only */
193 #define CURSOR_ORIGIN_DISPLAY 0x1 /* i810 only */
194 #define CURSOR_MODE 0x27
195 #define CURSOR_MODE_DISABLE 0x00
196 #define CURSOR_MODE_32_4C_AX 0x01 /* i810 only */
197 #define CURSOR_MODE_64_3C 0x04
198 #define CURSOR_MODE_64_4C_AX 0x05
199 #define CURSOR_MODE_64_4C 0x06
200 #define CURSOR_MODE_64_32B_AX 0x07
201 #define CURSOR_MODE_64_ARGB_AX (0x20 | CURSOR_MODE_64_32B_AX)
202 #define MCURSOR_PIPE_SELECT (1 << 28)
203 #define MCURSOR_PIPE_A 0x00
204 #define MCURSOR_PIPE_B (1 << 28)
205 #define MCURSOR_GAMMA_ENABLE (1 << 26)
206 #define MCURSOR_MEM_TYPE_LOCAL (1 << 25)
209 #define CURSOR_BASEADDR 0x70084
210 #define CURSOR_A_BASE CURSOR_BASEADDR
211 #define CURSOR_BASEADDR_MASK 0x1FFFFF00
212 #define CURSOR_A_POSITION 0x70088
213 #define CURSOR_POS_SIGN 0x8000
214 #define CURSOR_POS_MASK 0x007FF
215 #define CURSOR_X_SHIFT 0
216 #define CURSOR_Y_SHIFT 16
217 #define CURSOR_X_LO 0x70088
218 #define CURSOR_X_HI 0x70089
219 #define CURSOR_X_POS 0x00
220 #define CURSOR_X_NEG 0x80
221 #define CURSOR_Y_LO 0x7008A
222 #define CURSOR_Y_HI 0x7008B
223 #define CURSOR_Y_POS 0x00
224 #define CURSOR_Y_NEG 0x80
226 #define CURSOR_A_PALETTE0 0x70090
227 #define CURSOR_A_PALETTE1 0x70094
228 #define CURSOR_A_PALETTE2 0x70098
229 #define CURSOR_A_PALETTE3 0x7009C
231 #define CURSOR_SIZE 0x700A0
232 #define CURSOR_SIZE_MASK 0x3FF
233 #define CURSOR_SIZE_HSHIFT 0
234 #define CURSOR_SIZE_VSHIFT 12
236 #define CURSOR_B_CONTROL 0x700C0
237 #define CURSOR_B_BASE 0x700C4
238 #define CURSOR_B_POSITION 0x700C8
239 #define CURSOR_B_PALETTE0 0x700D0
240 #define CURSOR_B_PALETTE1 0x700D4
241 #define CURSOR_B_PALETTE2 0x700D8
242 #define CURSOR_B_PALETTE3 0x700DC
245 /* Similar registers exist in Device 0 on the i810 (pp55-65), but I'm
246 * not sure they refer to local (graphics) memory.
248 * These details are for the local memory control registers,
249 * (pp301-310). The test machines are not equiped with local memory,
250 * so nothing is tested. Only a single row seems to be supported.
252 #define DRAM_ROW_TYPE 0x3000
253 #define DRAM_ROW_0 0x01
254 #define DRAM_ROW_0_SDRAM 0x01
255 #define DRAM_ROW_0_EMPTY 0x00
256 #define DRAM_ROW_CNTL_LO 0x3001
257 #define DRAM_PAGE_MODE_CTRL 0x10
258 #define DRAM_RAS_TO_CAS_OVRIDE 0x08
259 #define DRAM_CAS_LATENCY 0x04
260 #define DRAM_RAS_TIMING 0x02
261 #define DRAM_RAS_PRECHARGE 0x01
262 #define DRAM_ROW_CNTL_HI 0x3002
263 #define DRAM_REFRESH_RATE 0x18
264 #define DRAM_REFRESH_DISABLE 0x00
265 #define DRAM_REFRESH_60HZ 0x08
266 #define DRAM_REFRESH_FAST_TEST 0x10
267 #define DRAM_REFRESH_RESERVED 0x18
268 #define DRAM_SMS 0x07
269 #define DRAM_SMS_NORMAL 0x00
270 #define DRAM_SMS_NOP_ENABLE 0x01
271 #define DRAM_SMS_ABPCE 0x02
272 #define DRAM_SMS_MRCE 0x03
273 #define DRAM_SMS_CBRCE 0x04
277 #define DPMS_SYNC_SELECT 0x5002
278 #define VSYNC_CNTL 0x08
279 #define VSYNC_ON 0x00
280 #define VSYNC_OFF 0x08
281 #define HSYNC_CNTL 0x02
282 #define HSYNC_ON 0x00
283 #define HSYNC_OFF 0x02
293 # define GPIO_CLOCK_DIR_MASK (1 << 0)
294 # define GPIO_CLOCK_DIR_IN (0 << 1)
295 # define GPIO_CLOCK_DIR_OUT (1 << 1)
296 # define GPIO_CLOCK_VAL_MASK (1 << 2)
297 # define GPIO_CLOCK_VAL_OUT (1 << 3)
298 # define GPIO_CLOCK_VAL_IN (1 << 4)
299 # define GPIO_CLOCK_PULLUP_DISABLE (1 << 5)
300 # define GPIO_DATA_DIR_MASK (1 << 8)
301 # define GPIO_DATA_DIR_IN (0 << 9)
302 # define GPIO_DATA_DIR_OUT (1 << 9)
303 # define GPIO_DATA_VAL_MASK (1 << 10)
304 # define GPIO_DATA_VAL_OUT (1 << 11)
305 # define GPIO_DATA_VAL_IN (1 << 12)
306 # define GPIO_DATA_PULLUP_DISABLE (1 << 13)
308 /* GMBus registers for hardware-assisted (non-bitbanging) I2C access */
309 #define GMBUS0 0x5100
310 #define GMBUS1 0x5104
311 #define GMBUS2 0x5108
312 #define GMBUS3 0x510c
313 #define GMBUS4 0x5110
314 #define GMBUS5 0x5120
318 #define VCLK2_VCO_M 0x6008 /* treat as 16 bit? (includes msbs) */
319 #define VCLK2_VCO_N 0x600a
320 #define VCLK2_VCO_DIV_SEL 0x6012
322 #define VCLK_DIVISOR_VGA0 0x6000
323 #define VCLK_DIVISOR_VGA1 0x6004
324 #define VCLK_POST_DIV 0x6010
325 /** Selects a post divisor of 4 instead of 2. */
326 # define VGA1_PD_P2_DIV_4 (1 << 15)
327 /** Overrides the p2 post divisor field */
328 # define VGA1_PD_P1_DIV_2 (1 << 13)
329 # define VGA1_PD_P1_SHIFT 8
330 /** P1 value is 2 greater than this field */
331 # define VGA1_PD_P1_MASK (0x1f << 8)
332 /** Selects a post divisor of 4 instead of 2. */
333 # define VGA0_PD_P2_DIV_4 (1 << 7)
334 /** Overrides the p2 post divisor field */
335 # define VGA0_PD_P1_DIV_2 (1 << 5)
336 # define VGA0_PD_P1_SHIFT 0
337 /** P1 value is 2 greater than this field */
338 # define VGA0_PD_P1_MASK (0x1f << 0)
340 #define POST_DIV_SELECT 0x70
341 #define POST_DIV_1 0x00
342 #define POST_DIV_2 0x10
343 #define POST_DIV_4 0x20
344 #define POST_DIV_8 0x30
345 #define POST_DIV_16 0x40
346 #define POST_DIV_32 0x50
347 #define VCO_LOOP_DIV_BY_4M 0x00
348 #define VCO_LOOP_DIV_BY_16M 0x04
351 /* Instruction Parser Mode Register
355 #define INST_PM 0x20c0
356 #define AGP_SYNC_PACKET_FLUSH_ENABLE 0x20 /* reserved */
357 #define SYNC_PACKET_FLUSH_ENABLE 0x10
358 #define TWO_D_INST_DISABLE 0x08
359 #define THREE_D_INST_DISABLE 0x04
360 #define STATE_VAR_UPDATE_DISABLE 0x02
361 #define PAL_STIP_DISABLE 0x01
364 #define MEMMODE 0x20dc
367 /* Instruction parser error register. p279
372 #define INST_DONE 0x2090
373 # define IDCT_DONE (1 << 30)
374 # define IQ_DONE (1 << 29)
375 # define PR_DONE (1 << 28)
376 # define VLD_DONE (1 << 27)
377 # define IP_DONE (1 << 26)
378 # define FBC_DONE (1 << 25)
379 # define BINNER_DONE (1 << 24)
380 # define SF_DONE (1 << 23)
381 # define SE_DONE (1 << 22)
382 # define WM_DONE (1 << 21)
383 # define IZ_DONE (1 << 20)
384 # define PERSPECTIVE_INTERP_DONE (1 << 19)
385 # define DISPATCHER_DONE (1 << 18)
386 # define PROJECTION_DONE (1 << 17)
387 # define DEPENDENT_ADDRESS_DONE (1 << 16)
388 # define QUAD_CACHE_DONE (1 << 15)
389 # define TEXTURE_FETCH_DONE (1 << 14)
390 # define TEXTURE_DECOMPRESS_DONE (1 << 13)
391 # define SAMPLER_CACHE_DONE (1 << 12)
392 # define FILTER_DONE (1 << 11)
393 # define BYPASS_FIFO_DONE (1 << 10)
394 # define PS_DONE (1 << 9)
395 # define CC_DONE (1 << 8)
396 # define MAP_FILTER_DONE (1 << 7)
397 # define MAP_L2_IDLE (1 << 6)
398 # define RING_2_ENABLE (1 << 2)
399 # define RING_1_ENABLE (1 << 1)
400 # define RING_0_ENABLE (1 << 0)
402 # define I830_GMBUS_DONE (1 << 26)
403 # define I830_FBC_DONE (1 << 25)
404 # define I830_BINNER_DONE (1 << 24)
405 # define I830_MPEG_DONE (1 << 23)
406 # define I830_MECO_DONE (1 << 22)
407 # define I830_MCD_DONE (1 << 21)
408 # define I830_MCSTP_DONE (1 << 20)
409 # define I830_CC_DONE (1 << 19)
410 # define I830_DG_DONE (1 << 18)
411 # define I830_DCMP_DONE (1 << 17)
412 # define I830_FTCH_DONE (1 << 16)
413 # define I830_IT_DONE (1 << 15)
414 # define I830_MG_DONE (1 << 14)
415 # define I830_MEC_DONE (1 << 13)
416 # define I830_PC_DONE (1 << 12)
417 # define I830_QCC_DONE (1 << 11)
418 # define I830_TB_DONE (1 << 10)
419 # define I830_WM_DONE (1 << 9)
420 # define I830_EF_DONE (1 << 8)
421 # define I830_BLITTER_DONE (1 << 7)
422 # define I830_MAP_L2_DONE (1 << 6)
423 # define I830_SECONDARY_RING_3_DONE (1 << 5)
424 # define I830_SECONDARY_RING_2_DONE (1 << 4)
425 # define I830_SECONDARY_RING_1_DONE (1 << 3)
426 # define I830_SECONDARY_RING_0_DONE (1 << 2)
427 # define I830_PRIMARY_RING_1_DONE (1 << 1)
428 # define I830_PRIMARY_RING_0_DONE (1 << 0)
430 #define SCPD0 0x209c /* debug */
431 #define INST_PS 0x20c4
432 #define IPEIR_I965 0x2064 /* i965 */
433 #define IPEHR_I965 0x2068 /* i965 */
434 #define INST_DONE_I965 0x206c
435 # define I965_ROW_0_EU_0_DONE (1 << 31)
436 # define I965_ROW_0_EU_1_DONE (1 << 30)
437 # define I965_ROW_0_EU_2_DONE (1 << 29)
438 # define I965_ROW_0_EU_3_DONE (1 << 28)
439 # define I965_ROW_1_EU_0_DONE (1 << 27)
440 # define I965_ROW_1_EU_1_DONE (1 << 26)
441 # define I965_ROW_1_EU_2_DONE (1 << 25)
442 # define I965_ROW_1_EU_3_DONE (1 << 24)
443 # define I965_SF_DONE (1 << 23)
444 # define I965_SE_DONE (1 << 22)
445 # define I965_WM_DONE (1 << 21)
446 # define I965_DISPATCHER_DONE (1 << 18)
447 # define I965_PROJECTION_DONE (1 << 17)
448 # define I965_DG_DONE (1 << 16)
449 # define I965_QUAD_CACHE_DONE (1 << 15)
450 # define I965_TEXTURE_FETCH_DONE (1 << 14)
451 # define I965_TEXTURE_DECOMPRESS_DONE (1 << 13)
452 # define I965_SAMPLER_CACHE_DONE (1 << 12)
453 # define I965_FILTER_DONE (1 << 11)
454 # define I965_BYPASS_DONE (1 << 10)
455 # define I965_PS_DONE (1 << 9)
456 # define I965_CC_DONE (1 << 8)
457 # define I965_MAP_FILTER_DONE (1 << 7)
458 # define I965_MAP_L2_IDLE (1 << 6)
459 # define I965_MA_ROW_0_DONE (1 << 5)
460 # define I965_MA_ROW_1_DONE (1 << 4)
461 # define I965_IC_ROW_0_DONE (1 << 3)
462 # define I965_IC_ROW_1_DONE (1 << 2)
463 # define I965_CP_DONE (1 << 1)
464 # define I965_RING_0_ENABLE (1 << 0)
465 #define INST_PS_I965 0x2070
467 /* Current active ring head address:
469 #define ACTHD_I965 0x2074
472 /* Current primary/secondary DMA fetch addresses:
474 #define DMA_FADD_P 0x2078
475 #define DMA_FADD_S 0x20d4
476 #define INST_DONE_1 0x207c
477 # define I965_GW_CS_DONE_CR (1 << 19)
478 # define I965_SVSM_CS_DONE_CR (1 << 18)
479 # define I965_SVDW_CS_DONE_CR (1 << 17)
480 # define I965_SVDR_CS_DONE_CR (1 << 16)
481 # define I965_SVRW_CS_DONE_CR (1 << 15)
482 # define I965_SVRR_CS_DONE_CR (1 << 14)
483 # define I965_SVTW_CS_DONE_CR (1 << 13)
484 # define I965_MASM_CS_DONE_CR (1 << 12)
485 # define I965_MASF_CS_DONE_CR (1 << 11)
486 # define I965_MAW_CS_DONE_CR (1 << 10)
487 # define I965_EM1_CS_DONE_CR (1 << 9)
488 # define I965_EM0_CS_DONE_CR (1 << 8)
489 # define I965_UC1_CS_DONE (1 << 7)
490 # define I965_UC0_CS_DONE (1 << 6)
491 # define I965_URB_CS_DONE (1 << 5)
492 # define I965_ISC_CS_DONE (1 << 4)
493 # define I965_CL_CS_DONE (1 << 3)
494 # define I965_GS_CS_DONE (1 << 2)
495 # define I965_VS0_CS_DONE (1 << 1)
496 # define I965_VF_CS_DONE (1 << 0)
498 #define CACHE_MODE_0 0x2120
499 #define CACHE_MODE_1 0x2124
500 #define MI_MODE 0x209c
501 #define MI_DISPLAY_POWER_DOWN 0x20e0
502 #define MI_ARB_STATE 0x20e4
503 #define MI_RDRET_STATE 0x20fc
505 /* Start addresses for each of the primary rings:
507 #define PR0_STR 0x20f0
508 #define PR1_STR 0x20f4
509 #define PR2_STR 0x20f8
511 #define WIZ_CTL 0x7c00
512 #define WIZ_CTL_SINGLE_SUBSPAN (1<<6)
513 #define WIZ_CTL_IGNORE_STALLS (1<<5)
515 #define SVG_WORK_CTL 0x7408
517 #define TS_CTL 0x7e00
518 #define TS_MUX_ERR_CODE (0<<8)
519 #define TS_MUX_URB_0 (1<<8)
520 #define TS_MUX_DISPATCH_ID_0 (10<<8)
521 #define TS_MUX_ERR_CODE_VALID (15<<8)
522 #define TS_MUX_TID_0 (16<<8)
523 #define TS_MUX_EUID_0 (18<<8)
524 #define TS_MUX_FFID_0 (22<<8)
525 #define TS_MUX_EOT (26<<8)
526 #define TS_MUX_SIDEBAND_0 (27<<8)
527 #define TS_SNAP_ALL_CHILD (1<<2)
528 #define TS_SNAP_ALL_ROOT (1<<1)
529 #define TS_SNAP_ENABLE (1<<0)
531 #define TS_DEBUG_DATA 0x7e0c
533 #define TD_CTL 0x8000
534 #define TD_CTL2 0x8004
537 #define ECOSKPD 0x21d0
542 #define IA_VERTICES_COUNT_QW 0x2310
543 #define IA_PRIMITIVES_COUNT_QW 0x2318
544 #define VS_INVOCATION_COUNT_QW 0x2320
545 #define GS_INVOCATION_COUNT_QW 0x2328
546 #define GS_PRIMITIVES_COUNT_QW 0x2330
547 #define CL_INVOCATION_COUNT_QW 0x2338
548 #define CL_PRIMITIVES_COUNT_QW 0x2340
549 #define PS_INVOCATION_COUNT_QW 0x2348
550 #define PS_DEPTH_COUNT_QW 0x2350
551 #define TIMESTAMP_QW 0x2358
552 #define CLKCMP_QW 0x2360
559 /* General error reporting regs, p296
564 # define ERR_VERTEX_MAX (1 << 5) /* lpt/cst */
565 # define ERR_PGTBL_ERROR (1 << 4)
566 # define ERR_DISPLAY_OVERLAY_UNDERRUN (1 << 3)
567 # define ERR_MAIN_MEMORY_REFRESH (1 << 1)
568 # define ERR_INSTRUCTION_ERROR (1 << 0)
571 /* Interrupt Control Registers
572 * - new bits for i810
573 * - new register hwstam (mask)
575 #define HWS_PGA 0x2080
576 #define PWRCTXA 0x2088 /* 965GM+ only */
577 #define PWRCTX_EN (1<<0)
578 #define HWSTAM 0x2098 /* p290 */
579 #define IER 0x20a0 /* p291 */
580 #define IIR 0x20a4 /* p292 */
581 #define IMR 0x20a8 /* p293 */
582 #define ISR 0x20ac /* p294 */
583 #define HW_ERROR 0x8000
584 #define SYNC_STATUS_TOGGLE 0x1000
585 #define DPY_0_FLIP_PENDING 0x0800
586 #define DPY_1_FLIP_PENDING 0x0400 /* not implemented on i810 */
587 #define OVL_0_FLIP_PENDING 0x0200
588 #define OVL_1_FLIP_PENDING 0x0100 /* not implemented on i810 */
589 #define DPY_0_VBLANK 0x0080
590 #define DPY_0_EVENT 0x0040
591 #define DPY_1_VBLANK 0x0020 /* not implemented on i810 */
592 #define DPY_1_EVENT 0x0010 /* not implemented on i810 */
593 #define HOST_PORT_EVENT 0x0008 /* */
594 #define CAPTURE_EVENT 0x0004 /* */
595 #define USER_DEFINED 0x0002
596 #define BREAKPOINT 0x0001
599 #define INTR_RESERVED (0x6000 | \
600 DPY_1_FLIP_PENDING | \
601 OVL_1_FLIP_PENDING | \
607 /* FIFO Watermark and Burst Length Control Register
609 * - different offset and contents on i810 (p299) (fewer bits per field)
610 * - some overlay fields added
611 * - what does it all mean?
613 #define FWATER_BLC 0x20d8
614 #define FWATER_BLC2 0x20dc
615 #define MM_BURST_LENGTH 0x00700000
616 #define MM_FIFO_WATERMARK 0x0001F000
617 #define LM_BURST_LENGTH 0x00000700
618 #define LM_FIFO_WATERMARK 0x0000001F
621 /* Fence/Tiling ranges [0..7]
626 #define FENCE_NEW 0x3000
627 #define FENCE_NEW_NR 16
629 #define FENCE_LINEAR 0
630 #define FENCE_XMAJOR 1
631 #define FENCE_YMAJOR 2
633 #define I915G_FENCE_START_MASK 0x0ff00000
635 #define I830_FENCE_START_MASK 0x07f80000
637 #define FENCE_START_MASK 0x03F80000
638 #define FENCE_X_MAJOR 0x00000000
639 #define FENCE_Y_MAJOR 0x00001000
640 #define FENCE_SIZE_MASK 0x00000700
641 #define FENCE_SIZE_512K 0x00000000
642 #define FENCE_SIZE_1M 0x00000100
643 #define FENCE_SIZE_2M 0x00000200
644 #define FENCE_SIZE_4M 0x00000300
645 #define FENCE_SIZE_8M 0x00000400
646 #define FENCE_SIZE_16M 0x00000500
647 #define FENCE_SIZE_32M 0x00000600
648 #define FENCE_SIZE_64M 0x00000700
649 #define I915G_FENCE_SIZE_1M 0x00000000
650 #define I915G_FENCE_SIZE_2M 0x00000100
651 #define I915G_FENCE_SIZE_4M 0x00000200
652 #define I915G_FENCE_SIZE_8M 0x00000300
653 #define I915G_FENCE_SIZE_16M 0x00000400
654 #define I915G_FENCE_SIZE_32M 0x00000500
655 #define I915G_FENCE_SIZE_64M 0x00000600
656 #define I915G_FENCE_SIZE_128M 0x00000700
657 #define I965_FENCE_X_MAJOR 0x00000000
658 #define I965_FENCE_Y_MAJOR 0x00000002
659 #define FENCE_PITCH_1 0x00000000
660 #define FENCE_PITCH_2 0x00000010
661 #define FENCE_PITCH_4 0x00000020
662 #define FENCE_PITCH_8 0x00000030
663 #define FENCE_PITCH_16 0x00000040
664 #define FENCE_PITCH_32 0x00000050
665 #define FENCE_PITCH_64 0x00000060
666 #define FENCE_VALID 0x00000001
669 /* Registers to control page table, p274
671 #define PGETBL_CTL 0x2020
672 #define PGETBL_ADDR_MASK 0xFFFFF000
673 #define PGETBL_ENABLE_MASK 0x00000001
674 #define PGETBL_ENABLED 0x00000001
675 /** Added in 965G, this field has the actual size of the global GTT */
676 #define PGETBL_SIZE_MASK 0x0000000e
677 #define PGETBL_SIZE_512KB (0 << 1)
678 #define PGETBL_SIZE_256KB (1 << 1)
679 #define PGETBL_SIZE_128KB (2 << 1)
680 #define PGETBL_SIZE_1MB (3 << 1)
681 #define PGETBL_SIZE_2MB (4 << 1)
682 #define PGETBL_SIZE_1_5MB (5 << 1)
683 #define G33_PGETBL_SIZE_MASK (3 << 8)
684 #define G33_PGETBL_SIZE_1M (1 << 8)
685 #define G33_PGETBL_SIZE_2M (2 << 8)
687 #define I830_PTE_BASE 0x10000
688 #define PTE_ADDRESS_MASK 0xfffff000
689 #define PTE_ADDRESS_MASK_HIGH 0x000000f0 /* i915+ */
690 #define PTE_MAPPING_TYPE_UNCACHED (0 << 1)
691 #define PTE_MAPPING_TYPE_DCACHE (1 << 1) /* i830 only */
692 #define PTE_MAPPING_TYPE_CACHED (3 << 1)
693 #define PTE_MAPPING_TYPE_MASK (3 << 1)
694 #define PTE_VALID (1 << 0)
696 /** @defgroup PGE_ERR
699 /** Page table debug register for i845 */
700 #define PGE_ERR 0x2024
701 #define PGE_ERR_ADDR_MASK 0xFFFFF000
702 #define PGE_ERR_ID_MASK 0x00000038
703 #define PGE_ERR_CAPTURE 0x00000000
704 #define PGE_ERR_OVERLAY 0x00000008
705 #define PGE_ERR_DISPLAY 0x00000010
706 #define PGE_ERR_HOST 0x00000018
707 #define PGE_ERR_RENDER 0x00000020
708 #define PGE_ERR_BLITTER 0x00000028
709 #define PGE_ERR_MAPPING 0x00000030
710 #define PGE_ERR_CMD_PARSER 0x00000038
711 #define PGE_ERR_TYPE_MASK 0x00000007
712 #define PGE_ERR_INV_TABLE 0x00000000
713 #define PGE_ERR_INV_PTE 0x00000001
714 #define PGE_ERR_MIXED_TYPES 0x00000002
715 #define PGE_ERR_PAGE_MISS 0x00000003
716 #define PGE_ERR_ILLEGAL_TRX 0x00000004
717 #define PGE_ERR_LOCAL_MEM 0x00000005
718 #define PGE_ERR_TILED 0x00000006
721 /** @defgroup PGTBL_ER
724 /** Page table debug register for i945 */
725 # define PGTBL_ER 0x2024
726 # define PGTBL_ERR_MT_TILING (1 << 27)
727 # define PGTBL_ERR_MT_GTT_PTE (1 << 26)
728 # define PGTBL_ERR_LC_TILING (1 << 25)
729 # define PGTBL_ERR_LC_GTT_PTE (1 << 24)
730 # define PGTBL_ERR_BIN_VERTEXDATA_GTT_PTE (1 << 23)
731 # define PGTBL_ERR_BIN_INSTRUCTION_GTT_PTE (1 << 22)
732 # define PGTBL_ERR_CS_VERTEXDATA_GTT_PTE (1 << 21)
733 # define PGTBL_ERR_CS_INSTRUCTION_GTT_PTE (1 << 20)
734 # define PGTBL_ERR_CS_GTT (1 << 19)
735 # define PGTBL_ERR_OVERLAY_TILING (1 << 18)
736 # define PGTBL_ERR_OVERLAY_GTT_PTE (1 << 16)
737 # define PGTBL_ERR_DISPC_TILING (1 << 14)
738 # define PGTBL_ERR_DISPC_GTT_PTE (1 << 12)
739 # define PGTBL_ERR_DISPB_TILING (1 << 10)
740 # define PGTBL_ERR_DISPB_GTT_PTE (1 << 8)
741 # define PGTBL_ERR_DISPA_TILING (1 << 6)
742 # define PGTBL_ERR_DISPA_GTT_PTE (1 << 4)
743 # define PGTBL_ERR_HOST_PTE_DATA (1 << 1)
744 # define PGTBL_ERR_HOST_GTT_PTE (1 << 0)
747 /* Ring buffer registers, p277, overview p19
749 #define LP_RING 0x2030
750 #define HP_RING 0x2040
752 #define RING_TAIL 0x00
753 #define TAIL_ADDR 0x000FFFF8
754 #define I830_TAIL_MASK 0x001FFFF8
756 #define RING_HEAD 0x04
757 #define HEAD_WRAP_COUNT 0xFFE00000
758 #define HEAD_WRAP_ONE 0x00200000
759 #define HEAD_ADDR 0x001FFFFC
760 #define I830_HEAD_MASK 0x001FFFFC
762 #define RING_START 0x08
763 #define START_ADDR 0x03FFFFF8
764 #define I830_RING_START_MASK 0xFFFFF000
766 #define RING_LEN 0x0C
767 #define RING_NR_PAGES 0x001FF000
768 #define I830_RING_NR_PAGES 0x001FF000
769 #define RING_REPORT_MASK 0x00000006
770 #define RING_REPORT_64K 0x00000002
771 #define RING_REPORT_128K 0x00000004
772 #define RING_NO_REPORT 0x00000000
773 #define RING_VALID_MASK 0x00000001
774 #define RING_VALID 0x00000001
775 #define RING_INVALID 0x00000000
779 /* BitBlt Instructions
781 * There are many more masks & ranges yet to add.
783 #define BR00_BITBLT_CLIENT 0x40000000
784 #define BR00_OP_COLOR_BLT 0x10000000
785 #define BR00_OP_SRC_COPY_BLT 0x10C00000
786 #define BR00_OP_FULL_BLT 0x11400000
787 #define BR00_OP_MONO_SRC_BLT 0x11800000
788 #define BR00_OP_MONO_SRC_COPY_BLT 0x11000000
789 #define BR00_OP_MONO_PAT_BLT 0x11C00000
790 #define BR00_OP_MONO_SRC_COPY_IMMEDIATE_BLT (0x61 << 22)
791 #define BR00_OP_TEXT_IMMEDIATE_BLT 0xc000000
794 #define BR00_TPCY_DISABLE 0x00000000
795 #define BR00_TPCY_ENABLE 0x00000010
797 #define BR00_TPCY_ROP 0x00000000
798 #define BR00_TPCY_NO_ROP 0x00000020
799 #define BR00_TPCY_EQ 0x00000000
800 #define BR00_TPCY_NOT_EQ 0x00000040
802 #define BR00_PAT_MSB_FIRST 0x00000000 /* ? */
804 #define BR00_PAT_VERT_ALIGN 0x000000e0
806 #define BR00_LENGTH 0x0000000F
808 #define BR09_DEST_ADDR 0x03FFFFFF
810 #define BR11_SOURCE_PITCH 0x00003FFF
812 #define BR12_SOURCE_ADDR 0x03FFFFFF
814 #define BR13_SOLID_PATTERN 0x80000000
815 #define BR13_RIGHT_TO_LEFT 0x40000000
816 #define BR13_LEFT_TO_RIGHT 0x00000000
817 #define BR13_MONO_TRANSPCY 0x20000000
818 #define BR13_MONO_PATN_TRANS 0x10000000
819 #define BR13_USE_DYN_DEPTH 0x04000000
820 #define BR13_DYN_8BPP 0x00000000
821 #define BR13_DYN_16BPP 0x01000000
822 #define BR13_DYN_24BPP 0x02000000
823 #define BR13_ROP_MASK 0x00FF0000
824 #define BR13_DEST_PITCH 0x0000FFFF
825 #define BR13_PITCH_SIGN_BIT 0x00008000
827 #define BR14_DEST_HEIGHT 0xFFFF0000
828 #define BR14_DEST_WIDTH 0x0000FFFF
830 #define BR15_PATTERN_ADDR 0x03FFFFFF
832 #define BR16_SOLID_PAT_COLOR 0x00FFFFFF
833 #define BR16_BACKGND_PAT_CLR 0x00FFFFFF
835 #define BR17_FGND_PAT_CLR 0x00FFFFFF
837 #define BR18_SRC_BGND_CLR 0x00FFFFFF
838 #define BR19_SRC_FGND_CLR 0x00FFFFFF
841 /* Instruction parser instructions
844 #define INST_PARSER_CLIENT 0x00000000
845 #define INST_OP_FLUSH 0x02000000
846 #define INST_FLUSH_MAP_CACHE 0x00000001
849 #define GFX_OP_USER_INTERRUPT ((0<<29)|(2<<23))
852 /* Registers in the i810 host-pci bridge pci config space which affect
853 * the i810 graphics operations.
855 #define SMRAM_MISCC 0x70
856 #define GMS 0x000000c0
857 #define GMS_DISABLE 0x00000000
858 #define GMS_ENABLE_BARE 0x00000040
859 #define GMS_ENABLE_512K 0x00000080
860 #define GMS_ENABLE_1M 0x000000c0
861 #define USMM 0x00000030
862 #define USMM_DISABLE 0x00000000
863 #define USMM_TSEG_ZERO 0x00000010
864 #define USMM_TSEG_512K 0x00000020
865 #define USMM_TSEG_1M 0x00000030
866 #define GFX_MEM_WIN_SIZE 0x00010000
867 #define GFX_MEM_WIN_32M 0x00010000
868 #define GFX_MEM_WIN_64M 0x00000000
870 /* Overkill? I don't know. Need to figure out top of mem to make the
871 * SMRAM calculations come out. Linux seems to have problems
872 * detecting it all on its own, so this seems a reasonable double
873 * check to any user supplied 'mem=...' boot param.
875 * ... unfortunately this reg doesn't work according to spec on the
878 #define WHTCFG_PAMR_DRP 0x50
879 #define SYS_DRAM_ROW_0_SHIFT 16
880 #define SYS_DRAM_ROW_1_SHIFT 20
881 #define DRAM_MASK 0x0f
882 #define DRAM_VALUE_0 0
883 #define DRAM_VALUE_1 8
884 /* No 2 value defined */
885 #define DRAM_VALUE_3 16
886 #define DRAM_VALUE_4 16
887 #define DRAM_VALUE_5 24
888 #define DRAM_VALUE_6 32
889 #define DRAM_VALUE_7 32
890 #define DRAM_VALUE_8 48
891 #define DRAM_VALUE_9 64
892 #define DRAM_VALUE_A 64
893 #define DRAM_VALUE_B 96
894 #define DRAM_VALUE_C 128
895 #define DRAM_VALUE_D 128
896 #define DRAM_VALUE_E 192
897 #define DRAM_VALUE_F 256 /* nice one, geezer */
898 #define LM_FREQ_MASK 0x10
899 #define LM_FREQ_133 0x10
900 #define LM_FREQ_100 0x00
905 /* These are 3d state registers, but the state is invarient, so we let
906 * the X server handle it:
911 /* GFXRENDERSTATE_COLOR_CHROMA_KEY, p135
913 #define GFX_OP_COLOR_CHROMA_KEY ((0x3<<29)|(0x1d<<24)|(0x2<<16)|0x1)
914 #define CC1_UPDATE_KILL_WRITE (1<<28)
915 #define CC1_ENABLE_KILL_WRITE (1<<27)
916 #define CC1_DISABLE_KILL_WRITE 0
917 #define CC1_UPDATE_COLOR_IDX (1<<26)
918 #define CC1_UPDATE_CHROMA_LOW (1<<25)
919 #define CC1_UPDATE_CHROMA_HI (1<<24)
920 #define CC1_CHROMA_LOW_MASK ((1<<24)-1)
921 #define CC2_COLOR_IDX_SHIFT 24
922 #define CC2_COLOR_IDX_MASK (0xff<<24)
923 #define CC2_CHROMA_HI_MASK ((1<<24)-1)
926 #define GFX_CMD_CONTEXT_SEL ((0<<29)|(0x5<<23))
927 #define CS_UPDATE_LOAD (1<<17)
928 #define CS_UPDATE_USE (1<<16)
929 #define CS_UPDATE_LOAD (1<<17)
930 #define CS_LOAD_CTX0 0
931 #define CS_LOAD_CTX1 (1<<8)
932 #define CS_USE_CTX0 0
933 #define CS_USE_CTX1 (1<<0)
935 /* I810 LCD/TV registers */
936 #define LCD_TV_HTOTAL 0x60000
937 #define LCD_TV_C 0x60018
938 #define LCD_TV_OVRACT 0x6001C
940 #define LCD_TV_ENABLE (1 << 31)
941 #define LCD_TV_VGAMOD (1 << 28)
943 /* I830 CRTC registers */
944 #define HTOTAL_A 0x60000
945 #define HBLANK_A 0x60004
946 #define HSYNC_A 0x60008
947 #define VTOTAL_A 0x6000c
948 #define VBLANK_A 0x60010
949 #define VSYNC_A 0x60014
950 #define PIPEASRC 0x6001c
951 #define BCLRPAT_A 0x60020
952 #define VSYNCSHIFT_A 0x60028
954 #define HTOTAL_B 0x61000
955 #define HBLANK_B 0x61004
956 #define HSYNC_B 0x61008
957 #define VTOTAL_B 0x6100c
958 #define VBLANK_B 0x61010
959 #define VSYNC_B 0x61014
960 #define PIPEBSRC 0x6101c
961 #define BCLRPAT_B 0x61020
962 #define VSYNCSHIFT_B 0x61028
964 #define PP_STATUS 0x61200
965 # define PP_ON (1 << 31)
967 * Indicates that all dependencies of the panel are on:
971 * - LVDS/DVOB/DVOC on
973 # define PP_READY (1 << 30)
974 # define PP_SEQUENCE_NONE (0 << 28)
975 # define PP_SEQUENCE_ON (1 << 28)
976 # define PP_SEQUENCE_OFF (2 << 28)
977 # define PP_SEQUENCE_MASK 0x30000000
979 #define PP_CONTROL 0x61204
980 # define POWER_DOWN_ON_RESET (1 << 1)
981 # define POWER_TARGET_ON (1 << 0)
983 #define PP_ON_DELAYS 0x61208
984 #define PP_OFF_DELAYS 0x6120c
985 #define PP_DIVISOR 0x61210
987 #define PFIT_CONTROL 0x61230
988 # define PFIT_ENABLE (1 << 31)
990 # define VERT_INTERP_DISABLE (0 << 10)
991 # define VERT_INTERP_BILINEAR (1 << 10)
992 # define VERT_INTERP_MASK (3 << 10)
993 # define VERT_AUTO_SCALE (1 << 9)
994 # define HORIZ_INTERP_DISABLE (0 << 6)
995 # define HORIZ_INTERP_BILINEAR (1 << 6)
996 # define HORIZ_INTERP_MASK (3 << 6)
997 # define HORIZ_AUTO_SCALE (1 << 5)
998 # define PANEL_8TO6_DITHER_ENABLE (1 << 3)
1000 # define PFIT_PIPE_MASK (3 << 29)
1001 # define PFIT_PIPE_SHIFT 29
1002 # define PFIT_SCALING_MODE_MASK (7 << 26)
1003 # define PFIT_SCALING_AUTO (0 << 26)
1004 # define PFIT_SCALING_PROGRAMMED (1 << 26)
1005 # define PFIT_SCALING_PILLAR (2 << 26)
1006 # define PFIT_SCALING_LETTER (3 << 26)
1007 # define PFIT_FILTER_SELECT_MASK (3 << 24)
1008 # define PFIT_FILTER_FUZZY (0 << 24)
1009 # define PFIT_FILTER_CRISP (1 << 24)
1010 # define PFIT_FILTER_MEDIAN (2 << 24)
1012 #define PFIT_PGM_RATIOS 0x61234
1014 # define PFIT_VERT_SCALE_SHIFT 20
1015 # define PFIT_VERT_SCALE_MASK 0xfff00000
1016 # define PFIT_HORIZ_SCALE_SHIFT 4
1017 # define PFIT_HORIZ_SCALE_MASK 0x0000fff0
1019 # define PFIT_VERT_SCALE_SHIFT_965 16
1020 # define PFIT_VERT_SCALE_MASK_965 0x1fff0000
1021 # define PFIT_HORIZ_SCALE_SHIFT_965 0
1022 # define PFIT_HORIZ_SCALE_MASK_965 0x00001fff
1024 #define DPLL_A 0x06014
1025 #define DPLL_B 0x06018
1026 # define DPLL_VCO_ENABLE (1 << 31)
1027 # define DPLL_DVO_HIGH_SPEED (1 << 30)
1028 # define DPLL_SYNCLOCK_ENABLE (1 << 29)
1029 # define DPLL_VGA_MODE_DIS (1 << 28)
1030 # define DPLLB_MODE_DAC_SERIAL (1 << 26) /* i915 */
1031 # define DPLLB_MODE_LVDS (2 << 26) /* i915 */
1032 # define DPLL_MODE_MASK (3 << 26)
1033 # define DPLL_DAC_SERIAL_P2_CLOCK_DIV_10 (0 << 24) /* i915 */
1034 # define DPLL_DAC_SERIAL_P2_CLOCK_DIV_5 (1 << 24) /* i915 */
1035 # define DPLLB_LVDS_P2_CLOCK_DIV_14 (0 << 24) /* i915 */
1036 # define DPLLB_LVDS_P2_CLOCK_DIV_7 (1 << 24) /* i915 */
1037 # define DPLL_P2_CLOCK_DIV_MASK 0x03000000 /* i915 */
1038 # define DPLL_FPA01_P1_POST_DIV_MASK 0x00ff0000 /* i915 */
1039 # define DPLL_FPA01_P1_POST_DIV_MASK_IGD 0x00ff8000 /* IGD */
1041 * The i830 generation, in DAC/serial mode, defines p1 as two plus this
1042 * bitfield, or just 2 if PLL_P1_DIVIDE_BY_TWO is set.
1044 # define DPLL_FPA01_P1_POST_DIV_MASK_I830 0x001f0000
1046 * The i830 generation, in LVDS mode, defines P1 as the bit number set within
1047 * this field (only one bit may be set).
1049 # define DPLL_FPA01_P1_POST_DIV_MASK_I830_LVDS 0x003f0000
1050 # define DPLL_FPA01_P1_POST_DIV_SHIFT 16
1051 # define DPLL_FPA01_P1_POST_DIV_SHIFT_IGD 15
1052 # define PLL_P2_DIVIDE_BY_4 (1 << 23) /* i830, required in DVO non-gang */
1053 # define PLL_P1_DIVIDE_BY_TWO (1 << 21) /* i830 */
1054 # define PLL_REF_INPUT_DREFCLK (0 << 13)
1055 # define PLL_REF_INPUT_TVCLKINA (1 << 13) /* i830 */
1056 # define PLL_REF_INPUT_SUPER_SSC (1 << 13) /* Ironlake: 120M SSC */
1057 # define PLL_REF_INPUT_TVCLKINBC (2 << 13) /* SDVO TVCLKIN */
1058 # define PLLB_REF_INPUT_SPREADSPECTRUMIN (3 << 13)
1059 # define PLL_REF_INPUT_MASK (3 << 13)
1060 # define PLL_REF_INPUT_DMICLK (5 << 13) /* Ironlake: DMI refclk */
1061 # define PLL_LOAD_PULSE_PHASE_SHIFT 9
1063 * Parallel to Serial Load Pulse phase selection.
1064 * Selects the phase for the 10X DPLL clock for the PCIe
1065 * digital display port. The range is 4 to 13; 10 or more
1066 * is just a flip delay. The default is 6
1068 # define PLL_LOAD_PULSE_PHASE_MASK (0xf << PLL_LOAD_PULSE_PHASE_SHIFT)
1069 # define DISPLAY_RATE_SELECT_FPA1 (1 << 8)
1071 # define PLL_REF_SDVO_HDMI_MULTIPLIER_SHIFT 9
1072 # define PLL_REF_SDVO_HDMI_MULTIPLIER_MASK (7 << 9)
1073 # define PLL_REF_SDVO_HDMI_MULTIPLIER(x) (((x)-1)<< PLL_REF_SDVO_HDMI_MULTIPLIER_SHIFT)
1074 # define DPLL_FPA1_P1_POST_DIV_SHIFT 0
1075 # define DPLL_FPA1_P1_POST_DIV_MASK 0xff
1078 * SDVO multiplier for 945G/GM. Not used on 965.
1080 * \sa DPLL_MD_UDI_MULTIPLIER_MASK
1082 # define SDVO_MULTIPLIER_MASK 0x000000ff
1083 # define SDVO_MULTIPLIER_SHIFT_HIRES 4
1084 # define SDVO_MULTIPLIER_SHIFT_VGA 0
1086 /** @defgroup DPLL_MD
1089 /** Pipe A SDVO/UDI clock multiplier/divider register for G965. */
1090 #define DPLL_A_MD 0x0601c
1091 /** Pipe B SDVO/UDI clock multiplier/divider register for G965. */
1092 #define DPLL_B_MD 0x06020
1094 * UDI pixel divider, controlling how many pixels are stuffed into a packet.
1096 * Value is pixels minus 1. Must be set to 1 pixel for SDVO.
1098 # define DPLL_MD_UDI_DIVIDER_MASK 0x3f000000
1099 # define DPLL_MD_UDI_DIVIDER_SHIFT 24
1100 /** UDI pixel divider for VGA, same as DPLL_MD_UDI_DIVIDER_MASK. */
1101 # define DPLL_MD_VGA_UDI_DIVIDER_MASK 0x003f0000
1102 # define DPLL_MD_VGA_UDI_DIVIDER_SHIFT 16
1104 * SDVO/UDI pixel multiplier.
1106 * SDVO requires that the bus clock rate be between 1 and 2 Ghz, and the bus
1107 * clock rate is 10 times the DPLL clock. At low resolution/refresh rate
1108 * modes, the bus rate would be below the limits, so SDVO allows for stuffing
1109 * dummy bytes in the datastream at an increased clock rate, with both sides of
1110 * the link knowing how many bytes are fill.
1112 * So, for a mode with a dotclock of 65Mhz, we would want to double the clock
1113 * rate to 130Mhz to get a bus rate of 1.30Ghz. The DPLL clock rate would be
1114 * set to 130Mhz, and the SDVO multiplier set to 2x in this register and
1115 * through an SDVO command.
1117 * This register field has values of multiplication factor minus 1, with
1118 * a maximum multiplier of 5 for SDVO.
1120 # define DPLL_MD_UDI_MULTIPLIER_MASK 0x00003f00
1121 # define DPLL_MD_UDI_MULTIPLIER_SHIFT 8
1122 /** SDVO/UDI pixel multiplier for VGA, same as DPLL_MD_UDI_MULTIPLIER_MASK.
1123 * This best be set to the default value (3) or the CRT won't work. No,
1124 * I don't entirely understand what this does...
1126 # define DPLL_MD_VGA_UDI_MULTIPLIER_MASK 0x0000003f
1127 # define DPLL_MD_VGA_UDI_MULTIPLIER_SHIFT 0
1130 #define DPLL_TEST 0x606c
1131 # define DPLLB_TEST_SDVO_DIV_1 (0 << 22)
1132 # define DPLLB_TEST_SDVO_DIV_2 (1 << 22)
1133 # define DPLLB_TEST_SDVO_DIV_4 (2 << 22)
1134 # define DPLLB_TEST_SDVO_DIV_MASK (3 << 22)
1135 # define DPLLB_TEST_N_BYPASS (1 << 19)
1136 # define DPLLB_TEST_M_BYPASS (1 << 18)
1137 # define DPLLB_INPUT_BUFFER_ENABLE (1 << 16)
1138 # define DPLLA_TEST_N_BYPASS (1 << 3)
1139 # define DPLLA_TEST_M_BYPASS (1 << 2)
1140 # define DPLLA_INPUT_BUFFER_ENABLE (1 << 0)
1142 #define D_STATE 0x6104
1143 #define DSPCLK_GATE_D 0x6200
1144 # define DPUNIT_B_CLOCK_GATE_DISABLE (1 << 30) /* 965 */
1145 # define VSUNIT_CLOCK_GATE_DISABLE (1 << 29) /* 965 */
1146 # define VRHUNIT_CLOCK_GATE_DISABLE (1 << 28) /* 965 */
1147 # define VRDUNIT_CLOCK_GATE_DISABLE (1 << 27) /* 965 */
1148 # define AUDUNIT_CLOCK_GATE_DISABLE (1 << 26) /* 965 */
1149 # define DPUNIT_A_CLOCK_GATE_DISABLE (1 << 25) /* 965 */
1150 # define DPCUNIT_CLOCK_GATE_DISABLE (1 << 24) /* 965 */
1151 # define TVRUNIT_CLOCK_GATE_DISABLE (1 << 23) /* 915-945 */
1152 # define TVCUNIT_CLOCK_GATE_DISABLE (1 << 22) /* 915-945 */
1153 # define TVFUNIT_CLOCK_GATE_DISABLE (1 << 21) /* 915-945 */
1154 # define TVEUNIT_CLOCK_GATE_DISABLE (1 << 20) /* 915-945 */
1155 # define DVSUNIT_CLOCK_GATE_DISABLE (1 << 19) /* 915-945 */
1156 # define DSSUNIT_CLOCK_GATE_DISABLE (1 << 18) /* 915-945 */
1157 # define DDBUNIT_CLOCK_GATE_DISABLE (1 << 17) /* 915-945 */
1158 # define DPRUNIT_CLOCK_GATE_DISABLE (1 << 16) /* 915-945 */
1159 # define DPFUNIT_CLOCK_GATE_DISABLE (1 << 15) /* 915-945 */
1160 # define DPBMUNIT_CLOCK_GATE_DISABLE (1 << 14) /* 915-945 */
1161 # define DPLSUNIT_CLOCK_GATE_DISABLE (1 << 13) /* 915-945 */
1162 # define DPLUNIT_CLOCK_GATE_DISABLE (1 << 12) /* 915-945 */
1163 # define DPOUNIT_CLOCK_GATE_DISABLE (1 << 11)
1164 # define DPBUNIT_CLOCK_GATE_DISABLE (1 << 10)
1165 # define DCUNIT_CLOCK_GATE_DISABLE (1 << 9)
1166 # define DPUNIT_CLOCK_GATE_DISABLE (1 << 8)
1167 # define VRUNIT_CLOCK_GATE_DISABLE (1 << 7) /* 915+: reserved */
1168 # define OVHUNIT_CLOCK_GATE_DISABLE (1 << 6) /* 830-865 */
1169 # define DPIOUNIT_CLOCK_GATE_DISABLE (1 << 6) /* 915-945 */
1170 # define OVFUNIT_CLOCK_GATE_DISABLE (1 << 5)
1171 # define OVBUNIT_CLOCK_GATE_DISABLE (1 << 4)
1173 * This bit must be set on the 830 to prevent hangs when turning off the
1176 # define OVRUNIT_CLOCK_GATE_DISABLE (1 << 3)
1177 # define OVCUNIT_CLOCK_GATE_DISABLE (1 << 2)
1178 # define OVUUNIT_CLOCK_GATE_DISABLE (1 << 1)
1179 # define ZVUNIT_CLOCK_GATE_DISABLE (1 << 0) /* 830 */
1180 # define OVLUNIT_CLOCK_GATE_DISABLE (1 << 0) /* 845,865 */
1182 #define RENCLK_GATE_D1 0x6204
1183 # define BLITTER_CLOCK_GATE_DISABLE (1 << 13) /* 945GM only */
1184 # define MPEG_CLOCK_GATE_DISABLE (1 << 12) /* 945GM only */
1185 # define PC_FE_CLOCK_GATE_DISABLE (1 << 11)
1186 # define PC_BE_CLOCK_GATE_DISABLE (1 << 10)
1187 # define WINDOWER_CLOCK_GATE_DISABLE (1 << 9)
1188 # define INTERPOLATOR_CLOCK_GATE_DISABLE (1 << 8)
1189 # define COLOR_CALCULATOR_CLOCK_GATE_DISABLE (1 << 7)
1190 # define MOTION_COMP_CLOCK_GATE_DISABLE (1 << 6)
1191 # define MAG_CLOCK_GATE_DISABLE (1 << 5)
1192 /** This bit must be unset on 855,865 */
1193 # define MECI_CLOCK_GATE_DISABLE (1 << 4)
1194 # define DCMP_CLOCK_GATE_DISABLE (1 << 3)
1195 # define MEC_CLOCK_GATE_DISABLE (1 << 2)
1196 # define MECO_CLOCK_GATE_DISABLE (1 << 1)
1197 /** This bit must be set on 855,865. */
1198 # define SV_CLOCK_GATE_DISABLE (1 << 0)
1199 # define I915_MPEG_CLOCK_GATE_DISABLE (1 << 16)
1200 # define I915_VLD_IP_PR_CLOCK_GATE_DISABLE (1 << 15)
1201 # define I915_MOTION_COMP_CLOCK_GATE_DISABLE (1 << 14)
1202 # define I915_BD_BF_CLOCK_GATE_DISABLE (1 << 13)
1203 # define I915_SF_SE_CLOCK_GATE_DISABLE (1 << 12)
1204 # define I915_WM_CLOCK_GATE_DISABLE (1 << 11)
1205 # define I915_IZ_CLOCK_GATE_DISABLE (1 << 10)
1206 # define I915_PI_CLOCK_GATE_DISABLE (1 << 9)
1207 # define I915_DI_CLOCK_GATE_DISABLE (1 << 8)
1208 # define I915_SH_SV_CLOCK_GATE_DISABLE (1 << 7)
1209 # define I915_PL_DG_QC_FT_CLOCK_GATE_DISABLE (1 << 6)
1210 # define I915_SC_CLOCK_GATE_DISABLE (1 << 5)
1211 # define I915_FL_CLOCK_GATE_DISABLE (1 << 4)
1212 # define I915_DM_CLOCK_GATE_DISABLE (1 << 3)
1213 # define I915_PS_CLOCK_GATE_DISABLE (1 << 2)
1214 # define I915_CC_CLOCK_GATE_DISABLE (1 << 1)
1215 # define I915_BY_CLOCK_GATE_DISABLE (1 << 0)
1217 # define I965_RCZ_CLOCK_GATE_DISABLE (1 << 30)
1218 /** This bit must always be set on 965G/965GM */
1219 # define I965_RCC_CLOCK_GATE_DISABLE (1 << 29)
1220 # define I965_RCPB_CLOCK_GATE_DISABLE (1 << 28)
1221 # define I965_DAP_CLOCK_GATE_DISABLE (1 << 27)
1222 # define I965_ROC_CLOCK_GATE_DISABLE (1 << 26)
1223 # define I965_GW_CLOCK_GATE_DISABLE (1 << 25)
1224 # define I965_TD_CLOCK_GATE_DISABLE (1 << 24)
1225 /** This bit must always be set on 965G */
1226 # define I965_ISC_CLOCK_GATE_DISABLE (1 << 23)
1227 # define I965_IC_CLOCK_GATE_DISABLE (1 << 22)
1228 # define I965_EU_CLOCK_GATE_DISABLE (1 << 21)
1229 # define I965_IF_CLOCK_GATE_DISABLE (1 << 20)
1230 # define I965_TC_CLOCK_GATE_DISABLE (1 << 19)
1231 # define I965_SO_CLOCK_GATE_DISABLE (1 << 17)
1232 # define I965_FBC_CLOCK_GATE_DISABLE (1 << 16)
1233 # define I965_MARI_CLOCK_GATE_DISABLE (1 << 15)
1234 # define I965_MASF_CLOCK_GATE_DISABLE (1 << 14)
1235 # define I965_MAWB_CLOCK_GATE_DISABLE (1 << 13)
1236 # define I965_EM_CLOCK_GATE_DISABLE (1 << 12)
1237 # define I965_UC_CLOCK_GATE_DISABLE (1 << 11)
1238 # define I965_SI_CLOCK_GATE_DISABLE (1 << 6)
1239 # define I965_MT_CLOCK_GATE_DISABLE (1 << 5)
1240 # define I965_PL_CLOCK_GATE_DISABLE (1 << 4)
1241 # define I965_DG_CLOCK_GATE_DISABLE (1 << 3)
1242 # define I965_QC_CLOCK_GATE_DISABLE (1 << 2)
1243 # define I965_FT_CLOCK_GATE_DISABLE (1 << 1)
1244 # define I965_DM_CLOCK_GATE_DISABLE (1 << 0)
1246 #define RENCLK_GATE_D2 0x6208
1247 #define VF_UNIT_CLOCK_GATE_DISABLE (1 << 9)
1248 #define GS_UNIT_CLOCK_GATE_DISABLE (1 << 7)
1249 #define CL_UNIT_CLOCK_GATE_DISABLE (1 << 6)
1250 #define RAMCLK_GATE_D 0x6210 /* CRL only */
1251 #define DEUC 0x6214 /* CRL only */
1254 * This is a PCI config space register to manipulate backlight brightness
1255 * It is used when the BLM_LEGACY_MODE is turned on. When enabled, the first
1256 * byte of this config register sets brightness within the range from
1259 #define LEGACY_BACKLIGHT_BRIGHTNESS 0xf4
1261 #define BLC_PWM_CTL 0x61254
1262 #define BACKLIGHT_MODULATION_FREQ_SHIFT (17)
1263 #define BACKLIGHT_MODULATION_FREQ_SHIFT2 (16)
1265 * This is the most significant 15 bits of the number of backlight cycles in a
1266 * complete cycle of the modulated backlight control.
1268 * The actual value is this field multiplied by two.
1270 #define BACKLIGHT_MODULATION_FREQ_MASK (0x7fff << 17)
1271 #define BACKLIGHT_MODULATION_FREQ_MASK2 (0xffff << 16)
1272 #define BLM_LEGACY_MODE (1 << 16)
1275 * This is the number of cycles out of the backlight modulation cycle for which
1276 * the backlight is on.
1278 * This field must be no greater than the number of cycles in the complete
1279 * backlight modulation cycle.
1281 #define BACKLIGHT_DUTY_CYCLE_SHIFT (0)
1282 #define BACKLIGHT_DUTY_CYCLE_MASK (0xffff)
1284 /* On 965+ backlight control is in another register */
1285 #define BLC_PWM_CTL2 0x61250
1286 #define BLM_LEGACY_MODE2 (1 << 30)
1288 #define BLM_CTL 0x61260
1289 #define BLM_THRESHOLD_0 0x61270
1290 #define BLM_THRESHOLD_1 0x61274
1291 #define BLM_THRESHOLD_2 0x61278
1292 #define BLM_THRESHOLD_3 0x6127c
1293 #define BLM_THRESHOLD_4 0x61280
1294 #define BLM_THRESHOLD_5 0x61284
1296 #define BLM_ACCUMULATOR_0 0x61290
1297 #define BLM_ACCUMULATOR_1 0x61294
1298 #define BLM_ACCUMULATOR_2 0x61298
1299 #define BLM_ACCUMULATOR_3 0x6129c
1300 #define BLM_ACCUMULATOR_4 0x612a0
1301 #define BLM_ACCUMULATOR_5 0x612a4
1303 #define FPA0 0x06040
1304 #define FPA1 0x06044
1305 #define FPB0 0x06048
1306 #define FPB1 0x0604c
1307 # define FP_N_DIV_MASK 0x003f0000
1308 # define FP_N_IGD_DIV_MASK 0x00ff0000
1309 # define FP_N_DIV_SHIFT 16
1310 # define FP_M1_DIV_MASK 0x00003f00
1311 # define FP_M1_DIV_SHIFT 8
1312 # define FP_M2_DIV_MASK 0x0000003f
1313 # define FP_M2_IGD_DIV_MASK 0x000000ff
1314 # define FP_M2_DIV_SHIFT 0
1316 #define PORT_HOTPLUG_EN 0x61110
1317 # define HDMIB_HOTPLUG_INT_EN (1 << 29)
1318 # define HDMIC_HOTPLUG_INT_EN (1 << 28)
1319 # define HDMID_HOTPLUG_INT_EN (1 << 27)
1320 # define SDVOB_HOTPLUG_INT_EN (1 << 26)
1321 # define SDVOC_HOTPLUG_INT_EN (1 << 25)
1322 # define TV_HOTPLUG_INT_EN (1 << 18)
1323 # define CRT_HOTPLUG_INT_EN (1 << 9)
1324 # define CRT_HOTPLUG_ACTIVATION_PERIOD_32 (0 << 8)
1325 /* must use period 64 on GM45 according to docs */
1326 # define CRT_HOTPLUG_ACTIVATION_PERIOD_64 (1 << 8)
1327 # define CRT_HOTPLUG_DAC_ON_TIME_2M (0 << 7)
1328 # define CRT_HOTPLUG_DAC_ON_TIME_4M (1 << 7)
1329 # define CRT_HOTPLUG_VOLTAGE_COMPARE_40 (0 << 5)
1330 # define CRT_HOTPLUG_VOLTAGE_COMPARE_50 (1 << 5)
1331 # define CRT_HOTPLUG_VOLTAGE_COMPARE_60 (2 << 5)
1332 # define CRT_HOTPLUG_VOLTAGE_COMPARE_70 (3 << 5)
1333 # define CRT_HOTPLUG_VOLTAGE_COMPARE_MASK (3 << 5)
1334 # define CRT_HOTPLUG_DETECT_DELAY_1G (0 << 4)
1335 # define CRT_HOTPLUG_DETECT_DELAY_2G (1 << 4)
1336 # define CRT_HOTPLUG_FORCE_DETECT (1 << 3)
1337 # define CRT_HOTPLUG_DETECT_VOLTAGE_325MV (0 << 2)
1338 # define CRT_HOTPLUG_DETECT_VOLTAGE_475MV (1 << 2)
1339 # define CRT_HOTPLUG_MASK (0x3fc) /* Bits 9-2 */
1341 #define PORT_HOTPLUG_STAT 0x61114
1342 # define HDMIB_HOTPLUG_INT_STATUS (1 << 29)
1343 # define HDMIC_HOTPLUG_INT_STATUS (1 << 28)
1344 # define HDMID_HOTPLUG_INT_STATUS (1 << 27)
1345 # define CRT_HOTPLUG_INT_STATUS (1 << 11)
1346 # define TV_HOTPLUG_INT_STATUS (1 << 10)
1347 # define CRT_HOTPLUG_MONITOR_MASK (3 << 8)
1348 # define CRT_HOTPLUG_MONITOR_COLOR (3 << 8)
1349 # define CRT_HOTPLUG_MONITOR_MONO (2 << 8)
1350 # define CRT_HOTPLUG_MONITOR_NONE (0 << 8)
1351 # define SDVOC_HOTPLUG_INT_STATUS (1 << 7)
1352 # define SDVOB_HOTPLUG_INT_STATUS (1 << 6)
1354 #define SDVOB 0x61140
1355 #define SDVOC 0x61160
1356 #define SDVO_ENABLE (1 << 31)
1357 #define SDVO_PIPE_B_SELECT (1 << 30)
1358 #define SDVO_STALL_SELECT (1 << 29)
1359 #define SDVO_INTERRUPT_ENABLE (1 << 26)
1361 * 915G/GM SDVO pixel multiplier.
1363 * Programmed value is multiplier - 1, up to 5x.
1365 * \sa DPLL_MD_UDI_MULTIPLIER_MASK
1367 #define SDVO_PORT_MULTIPLY_MASK (7 << 23)
1368 #define SDVO_PORT_MULTIPLY_SHIFT 23
1369 #define SDVO_PHASE_SELECT_MASK (15 << 19)
1370 #define SDVO_PHASE_SELECT_DEFAULT (6 << 19)
1371 #define SDVO_CLOCK_OUTPUT_INVERT (1 << 18)
1372 #define SDVOC_GANG_MODE (1 << 16)
1373 #define SDVO_ENCODING_SDVO (0x0 << 10)
1374 #define SDVO_ENCODING_HDMI (0x2 << 10)
1375 /** Requird for HDMI operation */
1376 #define SDVO_NULL_PACKETS_DURING_VSYNC (1 << 9)
1377 #define SDVO_BORDER_ENABLE (1 << 7)
1378 #define SDVO_AUDIO_ENABLE (1 << 6)
1379 /** New with 965, default is to be set */
1380 #define SDVO_VSYNC_ACTIVE_HIGH (1 << 4)
1381 /** New with 965, default is to be set */
1382 #define SDVO_HSYNC_ACTIVE_HIGH (1 << 3)
1383 /** 915/945 only, read-only bit */
1384 #define SDVOB_PCIE_CONCURRENCY (1 << 3)
1385 #define SDVO_DETECTED (1 << 2)
1386 /* Bits to be preserved when writing */
1387 #define SDVOB_PRESERVE_MASK ((1 << 17) | (1 << 16) | (1 << 14))
1388 #define SDVOC_PRESERVE_MASK (1 << 17)
1390 #define UDIB_SVB_SHB_CODES 0x61144
1391 #define UDIB_SHA_BLANK_CODES 0x61148
1392 #define UDIB_START_END_FILL_CODES 0x6114c
1395 #define SDVOUDI 0x61150
1397 #define I830_HTOTAL_MASK 0xfff0000
1398 #define I830_HACTIVE_MASK 0x7ff
1400 #define I830_HBLANKEND_MASK 0xfff0000
1401 #define I830_HBLANKSTART_MASK 0xfff
1403 #define I830_HSYNCEND_MASK 0xfff0000
1404 #define I830_HSYNCSTART_MASK 0xfff
1406 #define I830_VTOTAL_MASK 0xfff0000
1407 #define I830_VACTIVE_MASK 0x7ff
1409 #define I830_VBLANKEND_MASK 0xfff0000
1410 #define I830_VBLANKSTART_MASK 0xfff
1412 #define I830_VSYNCEND_MASK 0xfff0000
1413 #define I830_VSYNCSTART_MASK 0xfff
1415 #define I830_PIPEA_HORZ_MASK 0x7ff0000
1416 #define I830_PIPEA_VERT_MASK 0x7ff
1418 #define ADPA 0x61100
1419 #define ADPA_DAC_ENABLE (1<<31)
1420 #define ADPA_DAC_DISABLE 0
1421 #define ADPA_PIPE_SELECT_MASK (1<<30)
1422 #define ADPA_PIPE_A_SELECT 0
1423 #define ADPA_PIPE_B_SELECT (1<<30)
1424 #define ADPA_USE_VGA_HVPOLARITY (1<<15)
1425 #define ADPA_SETS_HVPOLARITY 0
1426 #define ADPA_VSYNC_CNTL_DISABLE (1<<11)
1427 #define ADPA_VSYNC_CNTL_ENABLE 0
1428 #define ADPA_HSYNC_CNTL_DISABLE (1<<10)
1429 #define ADPA_HSYNC_CNTL_ENABLE 0
1430 #define ADPA_VSYNC_ACTIVE_HIGH (1<<4)
1431 #define ADPA_VSYNC_ACTIVE_LOW 0
1432 #define ADPA_HSYNC_ACTIVE_HIGH (1<<3)
1433 #define ADPA_HSYNC_ACTIVE_LOW 0
1436 #define DVOA 0x61120
1437 #define DVOB 0x61140
1438 #define DVOC 0x61160
1439 #define DVO_ENABLE (1 << 31)
1440 #define DVO_PIPE_B_SELECT (1 << 30)
1441 #define DVO_PIPE_STALL_UNUSED (0 << 28)
1442 #define DVO_PIPE_STALL (1 << 28)
1443 #define DVO_PIPE_STALL_TV (2 << 28)
1444 #define DVO_PIPE_STALL_MASK (3 << 28)
1445 #define DVO_USE_VGA_SYNC (1 << 15)
1446 #define DVO_DATA_ORDER_I740 (0 << 14)
1447 #define DVO_DATA_ORDER_FP (1 << 14)
1448 #define DVO_VSYNC_DISABLE (1 << 11)
1449 #define DVO_HSYNC_DISABLE (1 << 10)
1450 #define DVO_VSYNC_TRISTATE (1 << 9)
1451 #define DVO_HSYNC_TRISTATE (1 << 8)
1452 #define DVO_BORDER_ENABLE (1 << 7)
1453 #define DVO_DATA_ORDER_GBRG (1 << 6)
1454 #define DVO_DATA_ORDER_RGGB (0 << 6)
1455 #define DVO_DATA_ORDER_GBRG_ERRATA (0 << 6)
1456 #define DVO_DATA_ORDER_RGGB_ERRATA (1 << 6)
1457 #define DVO_VSYNC_ACTIVE_HIGH (1 << 4)
1458 #define DVO_HSYNC_ACTIVE_HIGH (1 << 3)
1459 #define DVO_BLANK_ACTIVE_HIGH (1 << 2)
1460 #define DVO_OUTPUT_CSTATE_PIXELS (1 << 1) /* SDG only */
1461 #define DVO_OUTPUT_SOURCE_SIZE_PIXELS (1 << 0) /* SDG only */
1462 #define DVO_PRESERVE_MASK (0x7<<24)
1464 #define DVOA_SRCDIM 0x61124
1465 #define DVOB_SRCDIM 0x61144
1466 #define DVOC_SRCDIM 0x61164
1467 #define DVO_SRCDIM_HORIZONTAL_SHIFT 12
1468 #define DVO_SRCDIM_VERTICAL_SHIFT 0
1474 * This register controls the LVDS output enable, pipe selection, and data
1477 * All of the clock/data pairs are force powered down by power sequencing.
1479 #define LVDS 0x61180
1481 * Enables the LVDS port. This bit must be set before DPLLs are enabled, as
1482 * the DPLL semantics change when the LVDS is assigned to that pipe.
1484 # define LVDS_PORT_EN (1 << 31)
1485 /** Selects pipe B for LVDS data. Must be set on pre-965. */
1486 # define LVDS_PIPEB_SELECT (1 << 30)
1488 /* on 965, dithering is enabled in this register, not PFIT_CONTROL */
1489 # define LVDS_DITHER_ENABLE (1 << 25)
1492 * Selects between .0 and .1 formats:
1494 * 0 = 1x18.0, 2x18.0, 1x24.0 or 2x24.0
1495 * 1 = 1x24.1 or 2x24.1
1497 # define LVDS_DATA_FORMAT_DOT_ONE (1 << 24)
1499 /* Using LE instead of HS on second channel control signal */
1500 # define LVDS_LE_CONTROL_ENABLE (1 << 23)
1502 /* Using LF instead of VS on second channel control signal */
1503 # define LVDS_LF_CONTROL_ENABLE (1 << 22)
1505 /* invert vsync signal polarity */
1506 # define LVDS_VSYNC_POLARITY_INVERT (1 << 21)
1508 /* invert hsync signal polarity */
1509 # define LVDS_HSYNC_POLARITY_INVERT (1 << 20)
1511 /* invert display enable signal polarity */
1512 # define LVDS_DE_POLARITY_INVERT (1 << 19)
1515 * Control signals for second channel, ignored in single channel modes
1518 /* send DE, HS, VS on second channel */
1519 # define LVDS_SECOND_CHANNEL_DE_HS_VS (0 << 17)
1521 # define LVDS_SECOND_CHANNEL_RESERVED (1 << 17)
1523 /* Send zeros instead of DE, HS, VS on second channel */
1524 # define LVDS_SECOND_CHANNEL_ZEROS (2 << 17)
1526 /* Set DE=0, HS=LE, VS=LF on second channel */
1527 # define LVDS_SECOND_CHANNEL_HS_VS (3 << 17)
1530 * Send duplicate data for channel reserved bits, otherwise send zeros
1532 # define LVDS_CHANNEL_DUP_RESERVED (1 << 16)
1535 * Enable border for unscaled (or aspect-scaled) display
1537 # define LVDS_BORDER_ENABLE (1 << 15)
1540 * Tri-state the LVDS buffers when powered down, otherwise
1541 * they are set to 0V
1543 # define LVDS_POWER_DOWN_TRI_STATE (1 << 10)
1546 * Enables the A0-A2 data pairs and CLKA, containing 18 bits of color data per
1549 # define LVDS_A0A2_CLKA_POWER_MASK (3 << 8)
1550 # define LVDS_A0A2_CLKA_POWER_DOWN (0 << 8)
1551 # define LVDS_A0A2_CLKA_POWER_UP (3 << 8)
1553 * Controls the A3 data pair, which contains the additional LSBs for 24 bit
1554 * mode. Only enabled if LVDS_A0A2_CLKA_POWER_UP also indicates it should be
1557 # define LVDS_A3_POWER_MASK (3 << 6)
1558 # define LVDS_A3_POWER_DOWN (0 << 6)
1559 # define LVDS_A3_POWER_UP (3 << 6)
1561 * Controls the CLKB pair. This should only be set when LVDS_B0B3_POWER_UP
1564 # define LVDS_CLKB_POWER_MASK (3 << 4)
1565 # define LVDS_CLKB_POWER_DOWN (0 << 4)
1566 # define LVDS_CLKB_POWER_UP (3 << 4)
1569 * Controls the B0-B3 data pairs. This must be set to match the DPLL p2
1570 * setting for whether we are in dual-channel mode. The B3 pair will
1571 * additionally only be powered up when LVDS_A3_POWER_UP is set.
1573 # define LVDS_B0B3_POWER_MASK (3 << 2)
1574 # define LVDS_B0B3_POWER_DOWN (0 << 2)
1575 # define LVDS_B0B3_POWER_UP (3 << 2)
1579 #define DP_B 0x64100
1580 #define DPB_AUX_CH_CTL 0x64110
1581 #define DPB_AUX_CH_DATA1 0x64114
1582 #define DPB_AUX_CH_DATA2 0x64118
1583 #define DPB_AUX_CH_DATA3 0x6411c
1584 #define DPB_AUX_CH_DATA4 0x64120
1585 #define DPB_AUX_CH_DATA5 0x64124
1587 #define DP_C 0x64200
1588 #define DPC_AUX_CH_CTL 0x64210
1589 #define DPC_AUX_CH_DATA1 0x64214
1590 #define DPC_AUX_CH_DATA2 0x64218
1591 #define DPC_AUX_CH_DATA3 0x6421c
1592 #define DPC_AUX_CH_DATA4 0x64220
1593 #define DPC_AUX_CH_DATA5 0x64224
1595 #define DP_D 0x64300
1596 #define DPD_AUX_CH_CTL 0x64310
1597 #define DPD_AUX_CH_DATA1 0x64314
1598 #define DPD_AUX_CH_DATA2 0x64318
1599 #define DPD_AUX_CH_DATA3 0x6431c
1600 #define DPD_AUX_CH_DATA4 0x64320
1601 #define DPD_AUX_CH_DATA5 0x64324
1604 * Two channel clock control. Turn this on if you need clkb for two channel mode
1605 * Overridden by global LVDS power sequencing
1609 # define LVDS_CLKB_POWER_DOWN (0 << 4)
1611 /* powered up, but clkb forced to 0 */
1612 # define LVDS_CLKB_POWER_PARTIAL (1 << 4)
1614 /* clock B running */
1615 # define LVDS_CLKB_POWER_UP (3 << 4)
1618 * Two channel mode B0-B2 control. Sets state when power is on.
1619 * Set to POWER_DOWN in single channel mode, other settings enable
1620 * two channel mode. The CLKB power control controls whether that clock
1621 * is enabled during two channel mode.
1624 /* Everything is off, including B3 and CLKB */
1625 # define LVDS_B_POWER_DOWN (0 << 2)
1627 /* B0, B1, B2 and data lines forced to 0. timing is active */
1628 # define LVDS_B_POWER_PARTIAL (1 << 2)
1630 /* data lines active (both timing and colour) */
1631 # define LVDS_B_POWER_UP (3 << 2)
1633 /** @defgroup TV_CTL
1636 #define TV_CTL 0x68000
1637 /** Enables the TV encoder */
1638 # define TV_ENC_ENABLE (1 << 31)
1639 /** Sources the TV encoder input from pipe B instead of A. */
1640 # define TV_ENC_PIPEB_SELECT (1 << 30)
1641 /** Outputs composite video (DAC A only) */
1642 # define TV_ENC_OUTPUT_COMPOSITE (0 << 28)
1643 /** Outputs SVideo video (DAC B/C) */
1644 # define TV_ENC_OUTPUT_SVIDEO (1 << 28)
1645 /** Outputs Component video (DAC A/B/C) */
1646 # define TV_ENC_OUTPUT_COMPONENT (2 << 28)
1647 /** Outputs Composite and SVideo (DAC A/B/C) */
1648 # define TV_ENC_OUTPUT_SVIDEO_COMPOSITE (3 << 28)
1649 # define TV_TRILEVEL_SYNC (1 << 21)
1650 /** Enables slow sync generation (945GM only) */
1651 # define TV_SLOW_SYNC (1 << 20)
1652 /** Selects 4x oversampling for 480i and 576p */
1653 # define TV_OVERSAMPLE_4X (0 << 18)
1654 /** Selects 2x oversampling for 720p and 1080i */
1655 # define TV_OVERSAMPLE_2X (1 << 18)
1656 /** Selects no oversampling for 1080p */
1657 # define TV_OVERSAMPLE_NONE (2 << 18)
1658 /** Selects 8x oversampling */
1659 # define TV_OVERSAMPLE_8X (3 << 18)
1660 /** Selects progressive mode rather than interlaced */
1661 # define TV_PROGRESSIVE (1 << 17)
1662 /** Sets the colorburst to PAL mode. Required for non-M PAL modes. */
1663 # define TV_PAL_BURST (1 << 16)
1664 /** Field for setting delay of Y compared to C */
1665 # define TV_YC_SKEW_MASK (7 << 12)
1666 /** Enables a fix for 480p/576p standard definition modes on the 915GM only */
1667 # define TV_ENC_SDP_FIX (1 << 11)
1669 * Enables a fix for the 915GM only.
1671 * Not sure what it does.
1673 # define TV_ENC_C0_FIX (1 << 10)
1674 /** Bits that must be preserved by software */
1675 # define TV_CTL_SAVE ((1 << 11) | (3 << 9) | (7 << 6) | 0xf)
1676 # define TV_FUSE_STATE_MASK (3 << 4)
1677 /** Read-only state that reports all features enabled */
1678 # define TV_FUSE_STATE_ENABLED (0 << 4)
1679 /** Read-only state that reports that Macrovision is disabled in hardware*/
1680 # define TV_FUSE_STATE_NO_MACROVISION (1 << 4)
1681 /** Read-only state that reports that TV-out is disabled in hardware. */
1682 # define TV_FUSE_STATE_DISABLED (2 << 4)
1683 /** Normal operation */
1684 # define TV_TEST_MODE_NORMAL (0 << 0)
1685 /** Encoder test pattern 1 - combo pattern */
1686 # define TV_TEST_MODE_PATTERN_1 (1 << 0)
1687 /** Encoder test pattern 2 - full screen vertical 75% color bars */
1688 # define TV_TEST_MODE_PATTERN_2 (2 << 0)
1689 /** Encoder test pattern 3 - full screen horizontal 75% color bars */
1690 # define TV_TEST_MODE_PATTERN_3 (3 << 0)
1691 /** Encoder test pattern 4 - random noise */
1692 # define TV_TEST_MODE_PATTERN_4 (4 << 0)
1693 /** Encoder test pattern 5 - linear color ramps */
1694 # define TV_TEST_MODE_PATTERN_5 (5 << 0)
1696 * This test mode forces the DACs to 50% of full output.
1698 * This is used for load detection in combination with TVDAC_SENSE_MASK
1700 # define TV_TEST_MODE_MONITOR_DETECT (7 << 0)
1701 # define TV_TEST_MODE_MASK (7 << 0)
1704 /** @defgroup TV_DAC
1707 #define TV_DAC 0x68004
1709 * Reports that DAC state change logic has reported change (RO).
1711 * This gets cleared when TV_DAC_STATE_EN is cleared
1713 # define TVDAC_STATE_CHG (1 << 31)
1714 # define TVDAC_SENSE_MASK (7 << 28)
1715 /** Reports that DAC A voltage is above the detect threshold */
1716 # define TVDAC_A_SENSE (1 << 30)
1717 /** Reports that DAC B voltage is above the detect threshold */
1718 # define TVDAC_B_SENSE (1 << 29)
1719 /** Reports that DAC C voltage is above the detect threshold */
1720 # define TVDAC_C_SENSE (1 << 28)
1722 * Enables DAC state detection logic, for load-based TV detection.
1724 * The PLL of the chosen pipe (in TV_CTL) must be running, and the encoder set
1725 * to off, for load detection to work.
1727 # define TVDAC_STATE_CHG_EN (1 << 27)
1728 /** Sets the DAC A sense value to high */
1729 # define TVDAC_A_SENSE_CTL (1 << 26)
1730 /** Sets the DAC B sense value to high */
1731 # define TVDAC_B_SENSE_CTL (1 << 25)
1732 /** Sets the DAC C sense value to high */
1733 # define TVDAC_C_SENSE_CTL (1 << 24)
1734 /** Overrides the ENC_ENABLE and DAC voltage levels */
1735 # define DAC_CTL_OVERRIDE (1 << 7)
1736 /** Sets the slew rate. Must be preserved in software */
1737 # define ENC_TVDAC_SLEW_FAST (1 << 6)
1738 # define DAC_A_1_3_V (0 << 4)
1739 # define DAC_A_1_1_V (1 << 4)
1740 # define DAC_A_0_7_V (2 << 4)
1741 # define DAC_A_OFF (3 << 4)
1742 # define DAC_B_1_3_V (0 << 2)
1743 # define DAC_B_1_1_V (1 << 2)
1744 # define DAC_B_0_7_V (2 << 2)
1745 # define DAC_B_OFF (3 << 2)
1746 # define DAC_C_1_3_V (0 << 0)
1747 # define DAC_C_1_1_V (1 << 0)
1748 # define DAC_C_0_7_V (2 << 0)
1749 # define DAC_C_OFF (3 << 0)
1753 * CSC coefficients are stored in a floating point format with 9 bits of
1754 * mantissa and 2 or 3 bits of exponent. The exponent is represented as 2**-n,
1755 * where 2-bit exponents are unsigned n, and 3-bit exponents are signed n with
1756 * -1 (0x3) being the only legal negative value.
1758 #define TV_CSC_Y 0x68010
1759 # define TV_RY_MASK 0x07ff0000
1760 # define TV_RY_SHIFT 16
1761 # define TV_GY_MASK 0x00000fff
1762 # define TV_GY_SHIFT 0
1764 #define TV_CSC_Y2 0x68014
1765 # define TV_BY_MASK 0x07ff0000
1766 # define TV_BY_SHIFT 16
1768 * Y attenuation for component video.
1770 * Stored in 1.9 fixed point.
1772 # define TV_AY_MASK 0x000003ff
1773 # define TV_AY_SHIFT 0
1775 #define TV_CSC_U 0x68018
1776 # define TV_RU_MASK 0x07ff0000
1777 # define TV_RU_SHIFT 16
1778 # define TV_GU_MASK 0x000007ff
1779 # define TV_GU_SHIFT 0
1781 #define TV_CSC_U2 0x6801c
1782 # define TV_BU_MASK 0x07ff0000
1783 # define TV_BU_SHIFT 16
1785 * U attenuation for component video.
1787 * Stored in 1.9 fixed point.
1789 # define TV_AU_MASK 0x000003ff
1790 # define TV_AU_SHIFT 0
1792 #define TV_CSC_V 0x68020
1793 # define TV_RV_MASK 0x0fff0000
1794 # define TV_RV_SHIFT 16
1795 # define TV_GV_MASK 0x000007ff
1796 # define TV_GV_SHIFT 0
1798 #define TV_CSC_V2 0x68024
1799 # define TV_BV_MASK 0x07ff0000
1800 # define TV_BV_SHIFT 16
1802 * V attenuation for component video.
1804 * Stored in 1.9 fixed point.
1806 # define TV_AV_MASK 0x000007ff
1807 # define TV_AV_SHIFT 0
1809 /** @defgroup TV_CSC_KNOBS
1812 #define TV_CLR_KNOBS 0x68028
1813 /** 2s-complement brightness adjustment */
1814 # define TV_BRIGHTNESS_MASK 0xff000000
1815 # define TV_BRIGHTNESS_SHIFT 24
1816 /** Contrast adjustment, as a 2.6 unsigned floating point number */
1817 # define TV_CONTRAST_MASK 0x00ff0000
1818 # define TV_CONTRAST_SHIFT 16
1819 /** Saturation adjustment, as a 2.6 unsigned floating point number */
1820 # define TV_SATURATION_MASK 0x0000ff00
1821 # define TV_SATURATION_SHIFT 8
1822 /** Hue adjustment, as an integer phase angle in degrees */
1823 # define TV_HUE_MASK 0x000000ff
1824 # define TV_HUE_SHIFT 0
1827 /** @defgroup TV_CLR_LEVEL
1830 #define TV_CLR_LEVEL 0x6802c
1831 /** Controls the DAC level for black */
1832 # define TV_BLACK_LEVEL_MASK 0x01ff0000
1833 # define TV_BLACK_LEVEL_SHIFT 16
1834 /** Controls the DAC level for blanking */
1835 # define TV_BLANK_LEVEL_MASK 0x000001ff
1836 # define TV_BLANK_LEVEL_SHIFT 0
1839 /** @defgroup TV_H_CTL_1
1842 #define TV_H_CTL_1 0x68030
1843 /** Number of pixels in the hsync. */
1844 # define TV_HSYNC_END_MASK 0x1fff0000
1845 # define TV_HSYNC_END_SHIFT 16
1846 /** Total number of pixels minus one in the line (display and blanking). */
1847 # define TV_HTOTAL_MASK 0x00001fff
1848 # define TV_HTOTAL_SHIFT 0
1851 /** @defgroup TV_H_CTL_2
1854 #define TV_H_CTL_2 0x68034
1855 /** Enables the colorburst (needed for non-component color) */
1856 # define TV_BURST_ENA (1 << 31)
1857 /** Offset of the colorburst from the start of hsync, in pixels minus one. */
1858 # define TV_HBURST_START_SHIFT 16
1859 # define TV_HBURST_START_MASK 0x1fff0000
1860 /** Length of the colorburst */
1861 # define TV_HBURST_LEN_SHIFT 0
1862 # define TV_HBURST_LEN_MASK 0x0001fff
1865 /** @defgroup TV_H_CTL_3
1868 #define TV_H_CTL_3 0x68038
1869 /** End of hblank, measured in pixels minus one from start of hsync */
1870 # define TV_HBLANK_END_SHIFT 16
1871 # define TV_HBLANK_END_MASK 0x1fff0000
1872 /** Start of hblank, measured in pixels minus one from start of hsync */
1873 # define TV_HBLANK_START_SHIFT 0
1874 # define TV_HBLANK_START_MASK 0x0001fff
1877 /** @defgroup TV_V_CTL_1
1880 #define TV_V_CTL_1 0x6803c
1882 # define TV_NBR_END_SHIFT 16
1883 # define TV_NBR_END_MASK 0x07ff0000
1885 # define TV_VI_END_F1_SHIFT 8
1886 # define TV_VI_END_F1_MASK 0x00003f00
1888 # define TV_VI_END_F2_SHIFT 0
1889 # define TV_VI_END_F2_MASK 0x0000003f
1892 /** @defgroup TV_V_CTL_2
1895 #define TV_V_CTL_2 0x68040
1896 /** Length of vsync, in half lines */
1897 # define TV_VSYNC_LEN_MASK 0x07ff0000
1898 # define TV_VSYNC_LEN_SHIFT 16
1899 /** Offset of the start of vsync in field 1, measured in one less than the
1900 * number of half lines.
1902 # define TV_VSYNC_START_F1_MASK 0x00007f00
1903 # define TV_VSYNC_START_F1_SHIFT 8
1905 * Offset of the start of vsync in field 2, measured in one less than the
1906 * number of half lines.
1908 # define TV_VSYNC_START_F2_MASK 0x0000007f
1909 # define TV_VSYNC_START_F2_SHIFT 0
1912 /** @defgroup TV_V_CTL_3
1915 #define TV_V_CTL_3 0x68044
1916 /** Enables generation of the equalization signal */
1917 # define TV_EQUAL_ENA (1 << 31)
1918 /** Length of vsync, in half lines */
1919 # define TV_VEQ_LEN_MASK 0x007f0000
1920 # define TV_VEQ_LEN_SHIFT 16
1921 /** Offset of the start of equalization in field 1, measured in one less than
1922 * the number of half lines.
1924 # define TV_VEQ_START_F1_MASK 0x0007f00
1925 # define TV_VEQ_START_F1_SHIFT 8
1927 * Offset of the start of equalization in field 2, measured in one less than
1928 * the number of half lines.
1930 # define TV_VEQ_START_F2_MASK 0x000007f
1931 # define TV_VEQ_START_F2_SHIFT 0
1934 /** @defgroup TV_V_CTL_4
1937 #define TV_V_CTL_4 0x68048
1939 * Offset to start of vertical colorburst, measured in one less than the
1940 * number of lines from vertical start.
1942 # define TV_VBURST_START_F1_MASK 0x003f0000
1943 # define TV_VBURST_START_F1_SHIFT 16
1945 * Offset to the end of vertical colorburst, measured in one less than the
1946 * number of lines from the start of NBR.
1948 # define TV_VBURST_END_F1_MASK 0x000000ff
1949 # define TV_VBURST_END_F1_SHIFT 0
1952 /** @defgroup TV_V_CTL_5
1955 #define TV_V_CTL_5 0x6804c
1957 * Offset to start of vertical colorburst, measured in one less than the
1958 * number of lines from vertical start.
1960 # define TV_VBURST_START_F2_MASK 0x003f0000
1961 # define TV_VBURST_START_F2_SHIFT 16
1963 * Offset to the end of vertical colorburst, measured in one less than the
1964 * number of lines from the start of NBR.
1966 # define TV_VBURST_END_F2_MASK 0x000000ff
1967 # define TV_VBURST_END_F2_SHIFT 0
1970 /** @defgroup TV_V_CTL_6
1973 #define TV_V_CTL_6 0x68050
1975 * Offset to start of vertical colorburst, measured in one less than the
1976 * number of lines from vertical start.
1978 # define TV_VBURST_START_F3_MASK 0x003f0000
1979 # define TV_VBURST_START_F3_SHIFT 16
1981 * Offset to the end of vertical colorburst, measured in one less than the
1982 * number of lines from the start of NBR.
1984 # define TV_VBURST_END_F3_MASK 0x000000ff
1985 # define TV_VBURST_END_F3_SHIFT 0
1988 /** @defgroup TV_V_CTL_7
1991 #define TV_V_CTL_7 0x68054
1993 * Offset to start of vertical colorburst, measured in one less than the
1994 * number of lines from vertical start.
1996 # define TV_VBURST_START_F4_MASK 0x003f0000
1997 # define TV_VBURST_START_F4_SHIFT 16
1999 * Offset to the end of vertical colorburst, measured in one less than the
2000 * number of lines from the start of NBR.
2002 # define TV_VBURST_END_F4_MASK 0x000000ff
2003 # define TV_VBURST_END_F4_SHIFT 0
2006 /** @defgroup TV_SC_CTL_1
2009 #define TV_SC_CTL_1 0x68060
2010 /** Turns on the first subcarrier phase generation DDA */
2011 # define TV_SC_DDA1_EN (1 << 31)
2012 /** Turns on the first subcarrier phase generation DDA */
2013 # define TV_SC_DDA2_EN (1 << 30)
2014 /** Turns on the first subcarrier phase generation DDA */
2015 # define TV_SC_DDA3_EN (1 << 29)
2016 /** Sets the subcarrier DDA to reset frequency every other field */
2017 # define TV_SC_RESET_EVERY_2 (0 << 24)
2018 /** Sets the subcarrier DDA to reset frequency every fourth field */
2019 # define TV_SC_RESET_EVERY_4 (1 << 24)
2020 /** Sets the subcarrier DDA to reset frequency every eighth field */
2021 # define TV_SC_RESET_EVERY_8 (2 << 24)
2022 /** Sets the subcarrier DDA to never reset the frequency */
2023 # define TV_SC_RESET_NEVER (3 << 24)
2024 /** Sets the peak amplitude of the colorburst.*/
2025 # define TV_BURST_LEVEL_MASK 0x00ff0000
2026 # define TV_BURST_LEVEL_SHIFT 16
2027 /** Sets the increment of the first subcarrier phase generation DDA */
2028 # define TV_SCDDA1_INC_MASK 0x00000fff
2029 # define TV_SCDDA1_INC_SHIFT 0
2032 /** @defgroup TV_SC_CTL_2
2035 #define TV_SC_CTL_2 0x68064
2036 /** Sets the rollover for the second subcarrier phase generation DDA */
2037 # define TV_SCDDA2_SIZE_MASK 0x7fff0000
2038 # define TV_SCDDA2_SIZE_SHIFT 16
2039 /** Sets the increent of the second subcarrier phase generation DDA */
2040 # define TV_SCDDA2_INC_MASK 0x00007fff
2041 # define TV_SCDDA2_INC_SHIFT 0
2044 /** @defgroup TV_SC_CTL_3
2047 #define TV_SC_CTL_3 0x68068
2048 /** Sets the rollover for the third subcarrier phase generation DDA */
2049 # define TV_SCDDA3_SIZE_MASK 0x7fff0000
2050 # define TV_SCDDA3_SIZE_SHIFT 16
2051 /** Sets the increent of the third subcarrier phase generation DDA */
2052 # define TV_SCDDA3_INC_MASK 0x00007fff
2053 # define TV_SCDDA3_INC_SHIFT 0
2056 /** @defgroup TV_WIN_POS
2059 #define TV_WIN_POS 0x68070
2060 /** X coordinate of the display from the start of horizontal active */
2061 # define TV_XPOS_MASK 0x1fff0000
2062 # define TV_XPOS_SHIFT 16
2063 /** Y coordinate of the display from the start of vertical active (NBR) */
2064 # define TV_YPOS_MASK 0x00000fff
2065 # define TV_YPOS_SHIFT 0
2068 /** @defgroup TV_WIN_SIZE
2071 #define TV_WIN_SIZE 0x68074
2072 /** Horizontal size of the display window, measured in pixels*/
2073 # define TV_XSIZE_MASK 0x1fff0000
2074 # define TV_XSIZE_SHIFT 16
2076 * Vertical size of the display window, measured in pixels.
2078 * Must be even for interlaced modes.
2080 # define TV_YSIZE_MASK 0x00000fff
2081 # define TV_YSIZE_SHIFT 0
2084 /** @defgroup TV_FILTER_CTL_1
2087 #define TV_FILTER_CTL_1 0x68080
2089 * Enables automatic scaling calculation.
2091 * If set, the rest of the registers are ignored, and the calculated values can
2092 * be read back from the register.
2094 # define TV_AUTO_SCALE (1 << 31)
2096 * Disables the vertical filter.
2098 * This is required on modes more than 1024 pixels wide */
2099 # define TV_V_FILTER_BYPASS (1 << 29)
2100 /** Enables adaptive vertical filtering */
2101 # define TV_VADAPT (1 << 28)
2102 # define TV_VADAPT_MODE_MASK (3 << 26)
2103 /** Selects the least adaptive vertical filtering mode */
2104 # define TV_VADAPT_MODE_LEAST (0 << 26)
2105 /** Selects the moderately adaptive vertical filtering mode */
2106 # define TV_VADAPT_MODE_MODERATE (1 << 26)
2107 /** Selects the most adaptive vertical filtering mode */
2108 # define TV_VADAPT_MODE_MOST (3 << 26)
2110 * Sets the horizontal scaling factor.
2112 * This should be the fractional part of the horizontal scaling factor divided
2113 * by the oversampling rate. TV_HSCALE should be less than 1, and set to:
2115 * (src width - 1) / ((oversample * dest width) - 1)
2117 # define TV_HSCALE_FRAC_MASK 0x00003fff
2118 # define TV_HSCALE_FRAC_SHIFT 0
2121 /** @defgroup TV_FILTER_CTL_2
2124 #define TV_FILTER_CTL_2 0x68084
2126 * Sets the integer part of the 3.15 fixed-point vertical scaling factor.
2128 * TV_VSCALE should be (src height - 1) / ((interlace * dest height) - 1)
2130 # define TV_VSCALE_INT_MASK 0x00038000
2131 # define TV_VSCALE_INT_SHIFT 15
2133 * Sets the fractional part of the 3.15 fixed-point vertical scaling factor.
2135 * \sa TV_VSCALE_INT_MASK
2137 # define TV_VSCALE_FRAC_MASK 0x00007fff
2138 # define TV_VSCALE_FRAC_SHIFT 0
2141 /** @defgroup TV_FILTER_CTL_3
2144 #define TV_FILTER_CTL_3 0x68088
2146 * Sets the integer part of the 3.15 fixed-point vertical scaling factor.
2148 * TV_VSCALE should be (src height - 1) / (1/4 * (dest height - 1))
2150 * For progressive modes, TV_VSCALE_IP_INT should be set to zeroes.
2152 # define TV_VSCALE_IP_INT_MASK 0x00038000
2153 # define TV_VSCALE_IP_INT_SHIFT 15
2155 * Sets the fractional part of the 3.15 fixed-point vertical scaling factor.
2157 * For progressive modes, TV_VSCALE_IP_INT should be set to zeroes.
2159 * \sa TV_VSCALE_IP_INT_MASK
2161 # define TV_VSCALE_IP_FRAC_MASK 0x00007fff
2162 # define TV_VSCALE_IP_FRAC_SHIFT 0
2165 /** @defgroup TV_CC_CONTROL
2168 #define TV_CC_CONTROL 0x68090
2169 # define TV_CC_ENABLE (1 << 31)
2171 * Specifies which field to send the CC data in.
2173 * CC data is usually sent in field 0.
2175 # define TV_CC_FID_MASK (1 << 27)
2176 # define TV_CC_FID_SHIFT 27
2177 /** Sets the horizontal position of the CC data. Usually 135. */
2178 # define TV_CC_HOFF_MASK 0x03ff0000
2179 # define TV_CC_HOFF_SHIFT 16
2180 /** Sets the vertical position of the CC data. Usually 21 */
2181 # define TV_CC_LINE_MASK 0x0000003f
2182 # define TV_CC_LINE_SHIFT 0
2185 /** @defgroup TV_CC_DATA
2188 #define TV_CC_DATA 0x68094
2189 # define TV_CC_RDY (1 << 31)
2190 /** Second word of CC data to be transmitted. */
2191 # define TV_CC_DATA_2_MASK 0x007f0000
2192 # define TV_CC_DATA_2_SHIFT 16
2193 /** First word of CC data to be transmitted. */
2194 # define TV_CC_DATA_1_MASK 0x0000007f
2195 # define TV_CC_DATA_1_SHIFT 0
2200 #define TV_H_LUMA_0 0x68100
2201 #define TV_H_LUMA_59 0x681ec
2202 #define TV_H_CHROMA_0 0x68200
2203 #define TV_H_CHROMA_59 0x682ec
2204 #define TV_V_LUMA_0 0x68300
2205 #define TV_V_LUMA_42 0x683a8
2206 #define TV_V_CHROMA_0 0x68400
2207 #define TV_V_CHROMA_42 0x684a8
2210 #define PIPEA_DSL 0x70000
2212 #define PIPEACONF 0x70008
2213 #define PIPEACONF_ENABLE (1<<31)
2214 #define PIPEACONF_DISABLE 0
2215 #define PIPEACONF_DOUBLE_WIDE (1<<30)
2216 #define I965_PIPECONF_ACTIVE (1<<30)
2217 #define PIPEACONF_SINGLE_WIDE 0
2218 #define PIPEACONF_PIPE_UNLOCKED 0
2219 #define PIPEACONF_PIPE_LOCKED (1<<25)
2220 #define PIPEACONF_PALETTE 0
2221 #define PIPEACONF_GAMMA (1<<24)
2222 #define PIPECONF_FORCE_BORDER (1<<25)
2223 #define PIPECONF_PROGRESSIVE (0 << 21)
2224 #define PIPECONF_INTERLACE_W_FIELD_INDICATION (6 << 21)
2225 #define PIPECONF_INTERLACE_FIELD_0_ONLY (7 << 21)
2226 /* ironlake: gamma */
2227 #define PIPECONF_PALETTE_8BIT (0<<24)
2228 #define PIPECONF_PALETTE_10BIT (1<<24)
2229 #define PIPECONF_PALETTE_12BIT (2<<24)
2230 #define PIPECONF_FORCE_BORDER (1<<25)
2231 #define PIPECONF_PROGRESSIVE (0 << 21)
2232 #define PIPECONF_INTERLACE_W_FIELD_INDICATION (6 << 21)
2233 #define PIPECONF_INTERLACE_FIELD_0_ONLY (7 << 21)
2235 #define PIPECONF_MSA_TIMING_DELAY (0<<18) /* for eDP */
2236 #define PIPECONF_NO_DYNAMIC_RATE_CHANGE (0 << 16)
2237 #define PIPECONF_NO_ROTATION (0<<14)
2238 #define PIPECONF_FULL_COLOR_RANGE (0<<13)
2239 #define PIPECONF_CE_COLOR_RANGE (1<<13)
2240 #define PIPECONF_COLOR_SPACE_RGB (0<<11)
2241 #define PIPECONF_COLOR_SPACE_YUV601 (1<<11)
2242 #define PIPECONF_COLOR_SPACE_YUV709 (2<<11)
2243 #define PIPECONF_CONNECT_DEFAULT (0<<9)
2244 #define PIPECONF_8BPP (0<<5)
2245 #define PIPECONF_10BPP (1<<5)
2246 #define PIPECONF_6BPP (2<<5)
2247 #define PIPECONF_12BPP (3<<5)
2248 #define PIPECONF_ENABLE_DITHER (1<<4)
2249 #define PIPECONF_DITHER_SPATIAL (0<<2)
2250 #define PIPECONF_DITHER_ST1 (1<<2)
2251 #define PIPECONF_DITHER_ST2 (2<<2)
2252 #define PIPECONF_DITHER_TEMPORAL (3<<2)
2254 #define PIPEAGCMAXRED 0x70010
2255 #define PIPEAGCMAXGREEN 0x70014
2256 #define PIPEAGCMAXBLUE 0x70018
2257 #define PIPEASTAT 0x70024
2258 # define FIFO_UNDERRUN (1 << 31)
2259 # define CRC_ERROR_ENABLE (1 << 29)
2260 # define CRC_DONE_ENABLE (1 << 28)
2261 # define GMBUS_EVENT_ENABLE (1 << 27)
2262 # define VSYNC_INT_ENABLE (1 << 25)
2263 # define DLINE_COMPARE_ENABLE (1 << 24)
2264 # define DPST_EVENT_ENABLE (1 << 23)
2265 # define LBLC_EVENT_ENABLE (1 << 22)
2266 # define OFIELD_INT_ENABLE (1 << 21)
2267 # define EFIELD_INT_ENABLE (1 << 20)
2268 # define SVBLANK_INT_ENABLE (1 << 18)
2269 # define VBLANK_INT_ENABLE (1 << 17)
2270 # define OREG_UPDATE_ENABLE (1 << 16)
2271 # define CRC_ERROR_INT_STATUS (1 << 13)
2272 # define CRC_DONE_INT_STATUS (1 << 12)
2273 # define GMBUS_INT_STATUS (1 << 11)
2274 # define VSYNC_INT_STATUS (1 << 9)
2275 # define DLINE_COMPARE_STATUS (1 << 8)
2276 # define DPST_EVENT_STATUS (1 << 7)
2277 # define LBLC_EVENT_STATUS (1 << 6)
2278 # define OFIELD_INT_STATUS (1 << 5)
2279 # define EFIELD_INT_STATUS (1 << 4)
2280 # define SVBLANK_INT_STATUS (1 << 2)
2281 # define VBLANK_INT_STATUS (1 << 1)
2282 # define OREG_UPDATE_STATUS (1 << 0)
2285 #define DSPARB 0x70030
2286 #define DSPARB_CSTART_SHIFT 7
2287 #define DSPARB_BSTART_SHIFT 0
2288 #define DSPARB_BEND_SHIFT 9 /* on 855 */
2289 #define DSPARB_AEND_SHIFT 0
2290 #define DSPFW1 0x70034
2291 #define DSPFW2 0x70038
2292 #define DSPFW3 0x7003c
2294 * The two pipe frame counter registers are not synchronized, so
2295 * reading a stable value is somewhat tricky. The following code
2299 * high1 = ((INREG(PIPEAFRAMEHIGH) & PIPE_FRAME_HIGH_MASK) >> PIPE_FRAME_HIGH_SHIFT;
2300 * low1 = ((INREG(PIPEAFRAMEPIXEL) & PIPE_FRAME_LOW_MASK) >> PIPE_FRAME_LOW_SHIFT);
2301 * high2 = ((INREG(PIPEAFRAMEHIGH) & PIPE_FRAME_HIGH_MASK) >> PIPE_FRAME_HIGH_SHIFT);
2302 * } while (high1 != high2);
2303 * frame = (high1 << 8) | low1;
2305 #define PIPEAFRAMEHIGH 0x70040
2306 #define PIPE_FRAME_HIGH_MASK 0x0000ffff
2307 #define PIPE_FRAME_HIGH_SHIFT 0
2308 #define PIPEAFRAMEPIXEL 0x70044
2309 #define PIPE_FRAME_LOW_MASK 0xff000000
2310 #define PIPE_FRAME_LOW_SHIFT 24
2312 * Pixel within the current frame is counted in the PIPEAFRAMEPIXEL register
2313 * and is 24 bits wide.
2315 #define PIPE_PIXEL_MASK 0x00ffffff
2316 #define PIPE_PIXEL_SHIFT 0
2319 * Computing GMCH M and N values.
2321 * GMCH M/N = dot clock * bytes per pixel / ls_clk * # of lanes
2323 * ls_clk (we assume) is the DP link clock (1.62 or 2.7 GHz)
2325 * The GMCH value is used internally
2327 #define PIPEA_GMCH_DATA_M 0x70050
2329 /* Transfer unit size for display port - 1, default is 0x3f (for TU size 64) */
2330 #define PIPE_GMCH_DATA_M_TU_SIZE_MASK (0x3f << 25)
2331 #define PIPE_GMCH_DATA_M_TU_SIZE_SHIFT 25
2333 #define PIPE_GMCH_DATA_M_MASK (0xffffff)
2335 #define PIPEA_GMCH_DATA_N 0x70054
2336 #define PIPE_GMCH_DATA_N_MASK (0xffffff)
2339 * Computing Link M and N values.
2341 * Link M / N = pixel_clock / ls_clk
2343 * (the DP spec calls pixel_clock the 'strm_clk')
2345 * The Link value is transmitted in the Main Stream
2346 * Attributes and VB-ID.
2349 #define PIPEA_DP_LINK_M 0x70060
2350 #define PIPEA_DP_LINK_M_MASK (0xffffff)
2352 #define PIPEA_DP_LINK_N 0x70064
2353 #define PIPEA_DP_LINK_N_MASK (0xffffff)
2355 #define PIPEB_DSL 0x71000
2357 #define PIPEBCONF 0x71008
2358 #define PIPEBCONF_ENABLE (1<<31)
2359 #define PIPEBCONF_DISABLE 0
2360 #define PIPEBCONF_DOUBLE_WIDE (1<<30)
2361 #define PIPEBCONF_DISABLE 0
2362 #define PIPEBCONF_GAMMA (1<<24)
2363 #define PIPEBCONF_PALETTE 0
2365 #define PIPEBGCMAXRED 0x71010
2366 #define PIPEBGCMAXGREEN 0x71014
2367 #define PIPEBGCMAXBLUE 0x71018
2368 #define PIPEBSTAT 0x71024
2369 #define PIPEBFRAMEHIGH 0x71040
2370 #define PIPEBFRAMEPIXEL 0x71044
2372 #define PIPEB_GMCH_DATA_M 0x71050
2373 #define PIPEB_GMCH_DATA_N 0x71054
2374 #define PIPEB_DP_LINK_M 0x71060
2375 #define PIPEB_DP_LINK_N 0x71064
2377 #define DSPACNTR 0x70180
2378 #define DSPBCNTR 0x71180
2379 #define DISPLAY_PLANE_ENABLE (1<<31)
2380 #define DISPLAY_PLANE_DISABLE 0
2381 #define DISPLAY_PLANE_TILED (1<<10)
2382 #define DISPPLANE_GAMMA_ENABLE (1<<30)
2383 #define DISPPLANE_GAMMA_DISABLE 0
2384 #define DISPPLANE_PIXFORMAT_MASK (0xf<<26)
2385 #define DISPPLANE_8BPP (0x2<<26)
2386 #define DISPPLANE_15_16BPP (0x4<<26)
2387 #define DISPPLANE_16BPP (0x5<<26)
2388 #define DISPPLANE_32BPP_NO_ALPHA (0x6<<26)
2389 #define DISPPLANE_32BPP (0x7<<26)
2390 #define DISPPLANE_STEREO_ENABLE (1<<25)
2391 #define DISPPLANE_STEREO_DISABLE 0
2392 #define DISPPLANE_SEL_PIPE_MASK (1<<24)
2393 #define DISPPLANE_SEL_PIPE_A 0
2394 #define DISPPLANE_SEL_PIPE_B (1<<24)
2395 #define DISPPLANE_SRC_KEY_ENABLE (1<<22)
2396 #define DISPPLANE_SRC_KEY_DISABLE 0
2397 #define DISPPLANE_LINE_DOUBLE (1<<20)
2398 #define DISPPLANE_NO_LINE_DOUBLE 0
2399 #define DISPPLANE_STEREO_POLARITY_FIRST 0
2400 #define DISPPLANE_STEREO_POLARITY_SECOND (1<<18)
2402 #define DISPPLANE_ALPHA_TRANS_ENABLE (1<<15)
2403 #define DISPPLANE_ALPHA_TRANS_DISABLE 0
2404 #define DISPPLANE_SPRITE_ABOVE_DISPLAYA 0
2405 #define DISPPLANE_SPRITE_ABOVE_OVERLAY (1)
2407 #define DSPABASE 0x70184
2408 #define DSPASTRIDE 0x70188
2410 #define DSPBBASE 0x71184
2411 #define DSPBADDR DSPBBASE
2412 #define DSPBSTRIDE 0x71188
2414 #define DSPAKEYVAL 0x70194
2415 #define DSPAKEYMASK 0x70198
2417 #define DSPAPOS 0x7018C /* reserved */
2418 #define DSPASIZE 0x70190
2419 #define DSPBPOS 0x7118C
2420 #define DSPBSIZE 0x71190
2422 #define DSPASURF 0x7019C
2423 #define DSPATILEOFF 0x701A4
2425 #define DSPBSURF 0x7119C
2426 #define DSPBTILEOFF 0x711A4
2428 #define VGACNTRL 0x71400
2429 # define VGA_DISP_DISABLE (1 << 31)
2430 # define VGA_2X_MODE (1 << 30)
2431 # define VGA_PIPE_B_SELECT (1 << 29)
2433 /* Various masks for reserved bits, etc. */
2434 #define I830_FWATER1_MASK (~((1<<11)|(1<<10)|(1<<9)| \
2435 (1<<8)|(1<<26)|(1<<25)|(1<<24)|(1<<5)|(1<<4)|(1<<3)| \
2436 (1<<2)|(1<<1)|1|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16)))
2437 #define I830_FWATER2_MASK ~(0)
2439 #define DV0A_RESERVED ((1<<26)|(1<<25)|(1<<24)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<16)|(1<<5)|(1<<1)|1)
2440 #define DV0B_RESERVED ((1<<27)|(1<<26)|(1<<25)|(1<<24)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<16)|(1<<5)|(1<<1)|1)
2441 #define VGA0_N_DIVISOR_MASK ((1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16))
2442 #define VGA0_M1_DIVISOR_MASK ((1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8))
2443 #define VGA0_M2_DIVISOR_MASK ((1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|1)
2444 #define VGA0_M1M2N_RESERVED ~(VGA0_N_DIVISOR_MASK|VGA0_M1_DIVISOR_MASK|VGA0_M2_DIVISOR_MASK)
2445 #define VGA0_POSTDIV_MASK ((1<<7)|(1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|1)
2446 #define VGA1_POSTDIV_MASK ((1<<15)|(1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8))
2447 #define VGA_POSTDIV_RESERVED ~(VGA0_POSTDIV_MASK|VGA1_POSTDIV_MASK|(1<<7)|(1<<15))
2448 #define DPLLA_POSTDIV_MASK ((1<<23)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16))
2449 #define DPLLA_RESERVED ((1<<27)|(1<<26)|(1<<25)|(1<<24)|(1<<22)|(1<<15)|(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)|(1<<7)|(1<<6)|(1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|1)
2450 #define ADPA_RESERVED ((1<<2)|(1<<1)|1|(1<<9)|(1<<8)|(1<<7)|(1<<6)|(1<<5)|(1<<30)|(1<<29)|(1<<28)|(1<<27)|(1<<26)|(1<<25)|(1<<24)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16))
2451 #define SUPER_WORD 32
2452 #define BURST_A_MASK ((1<<11)|(1<<10)|(1<<9)|(1<<8))
2453 #define BURST_B_MASK ((1<<26)|(1<<25)|(1<<24))
2454 #define WATER_A_MASK ((1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|1)
2455 #define WATER_B_MASK ((1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16))
2456 #define WATER_RESERVED ((1<<31)|(1<<30)|(1<<29)|(1<<28)|(1<<27)|(1<<23)|(1<<22)|(1<<21)|(1<<15)|(1<<14)|(1<<13)|(1<<12)|(1<<7)|(1<<6))
2457 #define PIPEACONF_RESERVED ((1<<29)|(1<<28)|(1<<27)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16)|0xffff)
2458 #define PIPEBCONF_RESERVED ((1<<30)|(1<<29)|(1<<28)|(1<<27)|(1<<26)|(1<<25)|(1<<23)|(1<<22)|(1<<21)|(1<<20)|(1<<19)|(1<<18)|(1<<17)|(1<<16)|0xffff)
2459 #define DSPACNTR_RESERVED ((1<<23)|(1<<19)|(1<<17)|(1<<16)|0xffff)
2460 #define DSPBCNTR_RESERVED ((1<<23)|(1<<19)|(1<<17)|(1<<16)|0x7ffe)
2462 #define I830_GMCH_CTRL 0x52
2464 #define I830_GMCH_ENABLED 0x4
2465 #define I830_GMCH_MEM_MASK 0x1
2466 #define I830_GMCH_MEM_64M 0x1
2467 #define I830_GMCH_MEM_128M 0
2469 #define I830_GMCH_GMS_MASK 0x70
2470 #define I830_GMCH_GMS_DISABLED 0x00
2471 #define I830_GMCH_GMS_LOCAL 0x10
2472 #define I830_GMCH_GMS_STOLEN_512 0x20
2473 #define I830_GMCH_GMS_STOLEN_1024 0x30
2474 #define I830_GMCH_GMS_STOLEN_8192 0x40
2476 #define I830_RDRAM_CHANNEL_TYPE 0x03010
2477 #define I830_RDRAM_ND(x) (((x) & 0x20) >> 5)
2478 #define I830_RDRAM_DDT(x) (((x) & 0x18) >> 3)
2480 #define I855_GMCH_GMS_MASK (0xF << 4)
2481 #define I855_GMCH_GMS_DISABLED 0x00
2482 #define I855_GMCH_GMS_STOLEN_1M (0x1 << 4)
2483 #define I855_GMCH_GMS_STOLEN_4M (0x2 << 4)
2484 #define I855_GMCH_GMS_STOLEN_8M (0x3 << 4)
2485 #define I855_GMCH_GMS_STOLEN_16M (0x4 << 4)
2486 #define I855_GMCH_GMS_STOLEN_32M (0x5 << 4)
2487 #define I915G_GMCH_GMS_STOLEN_48M (0x6 << 4)
2488 #define I915G_GMCH_GMS_STOLEN_64M (0x7 << 4)
2489 #define G33_GMCH_GMS_STOLEN_128M (0x8 << 4)
2490 #define G33_GMCH_GMS_STOLEN_256M (0x9 << 4)
2491 #define INTEL_GMCH_GMS_STOLEN_96M (0xa << 4)
2492 #define INTEL_GMCH_GMS_STOLEN_160M (0xb << 4)
2493 #define INTEL_GMCH_GMS_STOLEN_224M (0xc << 4)
2494 #define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4)
2497 #define I85X_CAPID 0x44
2498 #define I85X_VARIANT_MASK 0x7
2499 #define I85X_VARIANT_SHIFT 5
2500 #define I855_GME 0x0
2502 #define I852_GME 0x2
2505 #define I915_GCFGC 0xf0
2506 #define I915_LOW_FREQUENCY_ENABLE (1 << 7)
2507 #define I915_DISPLAY_CLOCK_190_200_MHZ (0 << 4)
2508 #define I915_DISPLAY_CLOCK_333_MHZ (4 << 4)
2509 #define I915_DISPLAY_CLOCK_MASK (7 << 4)
2511 #define I855_HPLLCC 0xc0
2512 #define I855_CLOCK_CONTROL_MASK (3 << 0)
2513 #define I855_CLOCK_133_200 (0 << 0)
2514 #define I855_CLOCK_100_200 (1 << 0)
2515 #define I855_CLOCK_100_133 (2 << 0)
2516 #define I855_CLOCK_166_250 (3 << 0)
2519 #define COLOR_BLT_CMD ((2<<29)|(0x40<<22)|(0x3))
2520 #define COLOR_BLT_WRITE_ALPHA (1<<21)
2521 #define COLOR_BLT_WRITE_RGB (1<<20)
2523 #define XY_COLOR_BLT_CMD ((2<<29)|(0x50<<22)|(0x4))
2524 #define XY_COLOR_BLT_WRITE_ALPHA (1<<21)
2525 #define XY_COLOR_BLT_WRITE_RGB (1<<20)
2526 #define XY_COLOR_BLT_TILED (1<<11)
2528 #define XY_SETUP_CLIP_BLT_CMD ((2<<29)|(3<<22)|1)
2530 #define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6)
2531 #define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21)
2532 #define XY_SRC_COPY_BLT_WRITE_RGB (1<<20)
2533 #define XY_SRC_COPY_BLT_SRC_TILED (1<<15)
2534 #define XY_SRC_COPY_BLT_DST_TILED (1<<11)
2536 #define SRC_COPY_BLT_CMD ((2<<29)|(0x43<<22)|0x4)
2537 #define SRC_COPY_BLT_WRITE_ALPHA (1<<21)
2538 #define SRC_COPY_BLT_WRITE_RGB (1<<20)
2540 #define XY_PAT_BLT_IMMEDIATE ((2<<29)|(0x72<<22))
2542 #define XY_MONO_PAT_BLT_CMD ((0x2<<29)|(0x52<<22)|0x7)
2543 #define XY_MONO_PAT_VERT_SEED ((1<<10)|(1<<9)|(1<<8))
2544 #define XY_MONO_PAT_HORT_SEED ((1<<14)|(1<<13)|(1<<12))
2545 #define XY_MONO_PAT_BLT_WRITE_ALPHA (1<<21)
2546 #define XY_MONO_PAT_BLT_WRITE_RGB (1<<20)
2548 #define XY_MONO_SRC_BLT_CMD ((0x2<<29)|(0x54<<22)|(0x6))
2549 #define XY_MONO_SRC_BLT_WRITE_ALPHA (1<<21)
2550 #define XY_MONO_SRC_BLT_WRITE_RGB (1<<20)
2552 #define STATE3D_FOG_MODE ((3<<29)|(0x1d<<24)|(0x89<<16)|2)
2553 #define FOG_MODE_VERTEX (1<<31)
2555 #define DISABLE_TEX_TRANSFORM (1<<28)
2556 #define TEXTURE_SET(x) (x<<29)
2558 #define STATE3D_VERTEX_TRANSFORM ((3<<29)|(0x1d<<24)|(0x8b<<16))
2559 #define DISABLE_VIEWPORT_TRANSFORM (1<<31)
2560 #define DISABLE_PERSPECTIVE_DIVIDE (1<<29)
2562 #define MI_STORE_DWORD_IMM ((0x20<<23)|2)
2563 #define MI_MEM_VIRTUAL (1 << 22) /* 965+ only */
2565 #define MI_SET_CONTEXT (0x18<<23)
2566 #define CTXT_NO_RESTORE (1)
2567 #define CTXT_PALETTE_SAVE_DISABLE (1<<3)
2568 #define CTXT_PALETTE_RESTORE_DISABLE (1<<2)
2571 #define MI_VERTEX_BUFFER (0x17<<23)
2572 #define MI_VERTEX_BUFFER_IDX(x) (x<<20)
2573 #define MI_VERTEX_BUFFER_PITCH(x) (x<<13)
2574 #define MI_VERTEX_BUFFER_WIDTH(x) (x<<6)
2576 #define MI_VERTEX_BUFFER_DISABLE (1)
2579 #define MI_OVERLAY_FLIP (0x11<<23)
2580 #define MI_OVERLAY_FLIP_CONTINUE (0<<21)
2581 #define MI_OVERLAY_FLIP_ON (1<<21)
2582 #define MI_OVERLAY_FLIP_OFF (2<<21)
2584 /* Wait for Events */
2585 #define MI_WAIT_FOR_EVENT (0x03<<23)
2586 #define MI_WAIT_FOR_PIPEB_SVBLANK (1<<18)
2587 #define MI_WAIT_FOR_PIPEA_SVBLANK (1<<17)
2588 #define MI_WAIT_FOR_OVERLAY_FLIP (1<<16)
2589 #define MI_WAIT_FOR_PIPEB_VBLANK (1<<7)
2590 #define MI_WAIT_FOR_PIPEA_VBLANK (1<<3)
2591 #define MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW (1<<5)
2592 #define MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW (1<<1)
2594 #define MI_LOAD_SCAN_LINES_INCL (0x12<<23)
2597 #define MI_FLUSH (0x04<<23)
2598 #define MI_WRITE_DIRTY_STATE (1<<4)
2599 #define MI_END_SCENE (1<<3)
2600 #define MI_GLOBAL_SNAPSHOT_COUNT_RESET (1<<3)
2601 #define MI_INHIBIT_RENDER_CACHE_FLUSH (1<<2)
2602 #define MI_STATE_INSTRUCTION_CACHE_FLUSH (1<<1)
2603 #define MI_INVALIDATE_MAP_CACHE (1<<0)
2604 /* broadwater flush bits */
2605 #define BRW_MI_GLOBAL_SNAPSHOT_RESET (1 << 3)
2608 #define MI_NOOP 0x00
2609 #define MI_NOOP_WRITE_ID (1<<22)
2610 #define MI_NOOP_ID_MASK (1<<22 - 1)
2612 #define STATE3D_COLOR_FACTOR ((0x3<<29)|(0x1d<<24)|(0x01<<16))
2615 #define MI_BATCH_BUFFER ((0x30 << 23) | 1)
2616 #define MI_BATCH_BUFFER_START (0x31 << 23)
2617 #define MI_BATCH_BUFFER_END (0xA << 23)
2618 #define MI_BATCH_NON_SECURE (1)
2619 #define MI_BATCH_NON_SECURE_I965 (1 << 8)
2621 /* STATE3D_FOG_MODE stuff */
2622 #define ENABLE_FOG_SOURCE (1<<27)
2623 #define ENABLE_FOG_CONST (1<<24)
2624 #define ENABLE_FOG_DENSITY (1<<23)
2627 * New regs for broadwater -- we need to split this file up sensibly somehow.
2629 #define BRW_3D(Pipeline,Opcode,Subopcode) ((3 << 29) | \
2630 ((Pipeline) << 27) | \
2631 ((Opcode) << 24) | \
2632 ((Subopcode) << 16))
2634 #define BRW_URB_FENCE BRW_3D(0, 0, 0)
2635 #define BRW_CS_URB_STATE BRW_3D(0, 0, 1)
2636 #define BRW_CONSTANT_BUFFER BRW_3D(0, 0, 2)
2637 #define BRW_STATE_PREFETCH BRW_3D(0, 0, 3)
2639 #define BRW_STATE_BASE_ADDRESS BRW_3D(0, 1, 1)
2640 #define BRW_STATE_SIP BRW_3D(0, 1, 2)
2641 #define BRW_PIPELINE_SELECT BRW_3D(0, 1, 4)
2643 #define NEW_PIPELINE_SELECT BRW_3D(1, 1, 4)
2645 #define BRW_MEDIA_STATE_POINTERS BRW_3D(2, 0, 0)
2646 #define BRW_MEDIA_OBJECT BRW_3D(2, 1, 0)
2648 #define BRW_3DSTATE_PIPELINED_POINTERS BRW_3D(3, 0, 0)
2649 #define BRW_3DSTATE_BINDING_TABLE_POINTERS BRW_3D(3, 0, 1)
2650 #define BRW_3DSTATE_VERTEX_BUFFERS BRW_3D(3, 0, 8)
2651 #define BRW_3DSTATE_VERTEX_ELEMENTS BRW_3D(3, 0, 9)
2652 #define BRW_3DSTATE_INDEX_BUFFER BRW_3D(3, 0, 0xa)
2653 #define BRW_3DSTATE_VF_STATISTICS BRW_3D(3, 0, 0xb)
2655 #define BRW_3DSTATE_DRAWING_RECTANGLE BRW_3D(3, 1, 0)
2656 #define BRW_3DSTATE_CONSTANT_COLOR BRW_3D(3, 1, 1)
2657 #define BRW_3DSTATE_SAMPLER_PALETTE_LOAD BRW_3D(3, 1, 2)
2658 #define BRW_3DSTATE_CHROMA_KEY BRW_3D(3, 1, 4)
2659 #define BRW_3DSTATE_DEPTH_BUFFER BRW_3D(3, 1, 5)
2660 #define BRW_3DSTATE_POLY_STIPPLE_OFFSET BRW_3D(3, 1, 6)
2661 #define BRW_3DSTATE_POLY_STIPPLE_PATTERN BRW_3D(3, 1, 7)
2662 #define BRW_3DSTATE_LINE_STIPPLE BRW_3D(3, 1, 8)
2663 #define BRW_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP BRW_3D(3, 1, 9)
2664 /* These two are BLC and CTG only, not BW or CL */
2665 #define BRW_3DSTATE_AA_LINE_PARAMS BRW_3D(3, 1, 0xa)
2666 #define BRW_3DSTATE_GS_SVB_INDEX BRW_3D(3, 1, 0xb)
2668 #define BRW_PIPE_CONTROL BRW_3D(3, 2, 0)
2670 #define BRW_3DPRIMITIVE BRW_3D(3, 3, 0)
2672 #define PIPELINE_SELECT_3D 0
2673 #define PIPELINE_SELECT_MEDIA 1
2675 #define UF0_CS_REALLOC (1 << 13)
2676 #define UF0_VFE_REALLOC (1 << 12)
2677 #define UF0_SF_REALLOC (1 << 11)
2678 #define UF0_CLIP_REALLOC (1 << 10)
2679 #define UF0_GS_REALLOC (1 << 9)
2680 #define UF0_VS_REALLOC (1 << 8)
2681 #define UF1_CLIP_FENCE_SHIFT 20
2682 #define UF1_GS_FENCE_SHIFT 10
2683 #define UF1_VS_FENCE_SHIFT 0
2684 #define UF2_CS_FENCE_SHIFT 20
2685 #define UF2_VFE_FENCE_SHIFT 10
2686 #define UF2_SF_FENCE_SHIFT 0
2688 /* for BRW_STATE_BASE_ADDRESS */
2689 #define BASE_ADDRESS_MODIFY (1 << 0)
2691 /* for BRW_3DSTATE_PIPELINED_POINTERS */
2692 #define BRW_GS_DISABLE 0
2693 #define BRW_GS_ENABLE 1
2694 #define BRW_CLIP_DISABLE 0
2695 #define BRW_CLIP_ENABLE 1
2697 /* for BRW_PIPE_CONTROL */
2698 #define BRW_PIPE_CONTROL_NOWRITE (0 << 14)
2699 #define BRW_PIPE_CONTROL_WRITE_QWORD (1 << 14)
2700 #define BRW_PIPE_CONTROL_WRITE_DEPTH (2 << 14)
2701 #define BRW_PIPE_CONTROL_WRITE_TIME (3 << 14)
2702 #define BRW_PIPE_CONTROL_DEPTH_STALL (1 << 13)
2703 #define BRW_PIPE_CONTROL_WC_FLUSH (1 << 12)
2704 #define BRW_PIPE_CONTROL_IS_FLUSH (1 << 11)
2705 #define BRW_PIPE_CONTROL_NOTIFY_ENABLE (1 << 8)
2706 #define BRW_PIPE_CONTROL_GLOBAL_GTT (1 << 2)
2707 #define BRW_PIPE_CONTROL_LOCAL_PGTT (0 << 2)
2709 /* VERTEX_BUFFER_STATE Structure */
2710 #define VB0_BUFFER_INDEX_SHIFT 27
2711 #define VB0_VERTEXDATA (0 << 26)
2712 #define VB0_INSTANCEDATA (1 << 26)
2713 #define VB0_BUFFER_PITCH_SHIFT 0
2715 /* VERTEX_ELEMENT_STATE Structure */
2716 #define VE0_VERTEX_BUFFER_INDEX_SHIFT 27
2717 #define VE0_VALID (1 << 26)
2718 #define VE0_FORMAT_SHIFT 16
2719 #define VE0_OFFSET_SHIFT 0
2720 #define VE1_VFCOMPONENT_0_SHIFT 28
2721 #define VE1_VFCOMPONENT_1_SHIFT 24
2722 #define VE1_VFCOMPONENT_2_SHIFT 20
2723 #define VE1_VFCOMPONENT_3_SHIFT 16
2724 #define VE1_DESTINATION_ELEMENT_OFFSET_SHIFT 0
2726 /* 3DPRIMITIVE bits */
2727 #define BRW_3DPRIMITIVE_VERTEX_SEQUENTIAL (0 << 15)
2728 #define BRW_3DPRIMITIVE_VERTEX_RANDOM (1 << 15)
2729 /* Primitive types are in brw_defines.h */
2730 #define BRW_3DPRIMITIVE_TOPOLOGY_SHIFT 10
2732 #define BRW_SVG_CTL 0x7400
2734 #define BRW_SVG_CTL_GS_BA (0 << 8)
2735 #define BRW_SVG_CTL_SS_BA (1 << 8)
2736 #define BRW_SVG_CTL_IO_BA (2 << 8)
2737 #define BRW_SVG_CTL_GS_AUB (3 << 8)
2738 #define BRW_SVG_CTL_IO_AUB (4 << 8)
2739 #define BRW_SVG_CTL_SIP (5 << 8)
2741 #define BRW_SVG_RDATA 0x7404
2742 #define BRW_SVG_WORK_CTL 0x7408
2744 #define BRW_VF_CTL 0x7500
2746 #define BRW_VF_CTL_SNAPSHOT_COMPLETE (1 << 31)
2747 #define BRW_VF_CTL_SNAPSHOT_MUX_SELECT_THREADID (0 << 8)
2748 #define BRW_VF_CTL_SNAPSHOT_MUX_SELECT_VF_DEBUG (1 << 8)
2749 #define BRW_VF_CTL_SNAPSHOT_TYPE_VERTEX_SEQUENCE (0 << 4)
2750 #define BRW_VF_CTL_SNAPSHOT_TYPE_VERTEX_INDEX (1 << 4)
2751 #define BRW_VF_CTL_SKIP_INITIAL_PRIMITIVES (1 << 3)
2752 #define BRW_VF_CTL_MAX_PRIMITIVES_LIMIT_ENABLE (1 << 2)
2753 #define BRW_VF_CTL_VERTEX_RANGE_LIMIT_ENABLE (1 << 1)
2754 #define BRW_VF_CTL_SNAPSHOT_ENABLE (1 << 0)
2756 #define BRW_VF_STRG_VAL 0x7504
2757 #define BRW_VF_STR_VL_OVR 0x7508
2758 #define BRW_VF_VC_OVR 0x750c
2759 #define BRW_VF_STR_PSKIP 0x7510
2760 #define BRW_VF_MAX_PRIM 0x7514
2761 #define BRW_VF_RDATA 0x7518
2763 #define BRW_VS_CTL 0x7600
2764 #define BRW_VS_CTL_SNAPSHOT_COMPLETE (1 << 31)
2765 #define BRW_VS_CTL_SNAPSHOT_MUX_VERTEX_0 (0 << 8)
2766 #define BRW_VS_CTL_SNAPSHOT_MUX_VERTEX_1 (1 << 8)
2767 #define BRW_VS_CTL_SNAPSHOT_MUX_VALID_COUNT (2 << 8)
2768 #define BRW_VS_CTL_SNAPSHOT_MUX_VS_KERNEL_POINTER (3 << 8)
2769 #define BRW_VS_CTL_SNAPSHOT_ALL_THREADS (1 << 2)
2770 #define BRW_VS_CTL_THREAD_SNAPSHOT_ENABLE (1 << 1)
2771 #define BRW_VS_CTL_SNAPSHOT_ENABLE (1 << 0)
2773 #define BRW_VS_STRG_VAL 0x7604
2774 #define BRW_VS_RDATA 0x7608
2776 #define BRW_SF_CTL 0x7b00
2777 #define BRW_SF_CTL_SNAPSHOT_COMPLETE (1 << 31)
2778 #define BRW_SF_CTL_SNAPSHOT_MUX_VERTEX_0_FF_ID (0 << 8)
2779 #define BRW_SF_CTL_SNAPSHOT_MUX_VERTEX_0_REL_COUNT (1 << 8)
2780 #define BRW_SF_CTL_SNAPSHOT_MUX_VERTEX_1_FF_ID (2 << 8)
2781 #define BRW_SF_CTL_SNAPSHOT_MUX_VERTEX_1_REL_COUNT (3 << 8)
2782 #define BRW_SF_CTL_SNAPSHOT_MUX_VERTEX_2_FF_ID (4 << 8)
2783 #define BRW_SF_CTL_SNAPSHOT_MUX_VERTEX_2_REL_COUNT (5 << 8)
2784 #define BRW_SF_CTL_SNAPSHOT_MUX_VERTEX_COUNT (6 << 8)
2785 #define BRW_SF_CTL_SNAPSHOT_MUX_SF_KERNEL_POINTER (7 << 8)
2786 #define BRW_SF_CTL_MIN_MAX_PRIMITIVE_RANGE_ENABLE (1 << 4)
2787 #define BRW_SF_CTL_DEBUG_CLIP_RECTANGLE_ENABLE (1 << 3)
2788 #define BRW_SF_CTL_SNAPSHOT_ALL_THREADS (1 << 2)
2789 #define BRW_SF_CTL_THREAD_SNAPSHOT_ENABLE (1 << 1)
2790 #define BRW_SF_CTL_SNAPSHOT_ENABLE (1 << 0)
2792 #define BRW_SF_STRG_VAL 0x7b04
2793 #define BRW_SF_RDATA 0x7b18
2795 #define BRW_WIZ_CTL 0x7c00
2796 #define BRW_WIZ_CTL_SNAPSHOT_COMPLETE (1 << 31)
2797 #define BRW_WIZ_CTL_SUBSPAN_INSTANCE_SHIFT 16
2798 #define BRW_WIZ_CTL_SNAPSHOT_MUX_WIZ_KERNEL_POINTER (0 << 8)
2799 #define BRW_WIZ_CTL_SNAPSHOT_MUX_SUBSPAN_INSTANCE (1 << 8)
2800 #define BRW_WIZ_CTL_SNAPSHOT_MUX_PRIMITIVE_SEQUENCE (2 << 8)
2801 #define BRW_WIZ_CTL_SINGLE_SUBSPAN_DISPATCH (1 << 6)
2802 #define BRW_WIZ_CTL_IGNORE_COLOR_SCOREBOARD_STALLS (1 << 5)
2803 #define BRW_WIZ_CTL_ENABLE_SUBSPAN_INSTANCE_COMPARE (1 << 4)
2804 #define BRW_WIZ_CTL_USE_UPSTREAM_SNAPSHOT_FLAG (1 << 3)
2805 #define BRW_WIZ_CTL_SNAPSHOT_ALL_THREADS (1 << 2)
2806 #define BRW_WIZ_CTL_THREAD_SNAPSHOT_ENABLE (1 << 1)
2807 #define BRW_WIZ_CTL_SNAPSHOT_ENABLE (1 << 0)
2809 #define BRW_WIZ_STRG_VAL 0x7c04
2810 #define BRW_WIZ_RDATA 0x7c18
2812 #define BRW_TS_CTL 0x7e00
2813 #define BRW_TS_CTL_SNAPSHOT_COMPLETE (1 << 31)
2814 #define BRW_TS_CTL_SNAPSHOT_MESSAGE_ERROR (0 << 8)
2815 #define BRW_TS_CTL_SNAPSHOT_INTERFACE_DESCRIPTOR (3 << 8)
2816 #define BRW_TS_CTL_SNAPSHOT_ALL_CHILD_THREADS (1 << 2)
2817 #define BRW_TS_CTL_SNAPSHOT_ALL_ROOT_THREADS (1 << 1)
2818 #define BRW_TS_CTL_SNAPSHOT_ENABLE (1 << 0)
2820 #define BRW_TS_STRG_VAL 0x7e04
2821 #define BRW_TS_RDATA 0x7e08
2823 #define BRW_TD_CTL 0x8000
2824 #define BRW_TD_CTL_MUX_SHIFT 8
2825 #define BRW_TD_CTL_EXTERNAL_HALT_R0_DEBUG_MATCH (1 << 7)
2826 #define BRW_TD_CTL_FORCE_EXTERNAL_HALT (1 << 6)
2827 #define BRW_TD_CTL_EXCEPTION_MASK_OVERRIDE (1 << 5)
2828 #define BRW_TD_CTL_FORCE_THREAD_BREAKPOINT_ENABLE (1 << 4)
2829 #define BRW_TD_CTL_BREAKPOINT_ENABLE (1 << 2)
2830 #define BRW_TD_CTL2 0x8004
2831 #define BRW_TD_CTL2_ILLEGAL_OPCODE_EXCEPTION_OVERRIDE (1 << 28)
2832 #define BRW_TD_CTL2_MASKSTACK_EXCEPTION_OVERRIDE (1 << 26)
2833 #define BRW_TD_CTL2_SOFTWARE_EXCEPTION_OVERRIDE (1 << 25)
2834 #define BRW_TD_CTL2_ACTIVE_THREAD_LIMIT_SHIFT 16
2835 #define BRW_TD_CTL2_ACTIVE_THREAD_LIMIT_ENABLE (1 << 8)
2836 #define BRW_TD_CTL2_THREAD_SPAWNER_EXECUTION_MASK_ENABLE (1 << 7)
2837 #define BRW_TD_CTL2_WIZ_EXECUTION_MASK_ENABLE (1 << 6)
2838 #define BRW_TD_CTL2_SF_EXECUTION_MASK_ENABLE (1 << 5)
2839 #define BRW_TD_CTL2_CLIPPER_EXECUTION_MASK_ENABLE (1 << 4)
2840 #define BRW_TD_CTL2_GS_EXECUTION_MASK_ENABLE (1 << 3)
2841 #define BRW_TD_CTL2_VS_EXECUTION_MASK_ENABLE (1 << 0)
2842 #define BRW_TD_VF_VS_EMSK 0x8008
2843 #define BRW_TD_GS_EMSK 0x800c
2844 #define BRW_TD_CLIP_EMSK 0x8010
2845 #define BRW_TD_SF_EMSK 0x8014
2846 #define BRW_TD_WIZ_EMSK 0x8018
2847 #define BRW_TD_0_6_EHTRG_VAL 0x801c
2848 #define BRW_TD_0_7_EHTRG_VAL 0x8020
2849 #define BRW_TD_0_6_EHTRG_MSK 0x8024
2850 #define BRW_TD_0_7_EHTRG_MSK 0x8028
2851 #define BRW_TD_RDATA 0x802c
2852 #define BRW_TD_TS_EMSK 0x8030
2854 #define BRW_EU_CTL 0x8800
2855 #define BRW_EU_CTL_SELECT_SHIFT 16
2856 #define BRW_EU_CTL_DATA_MUX_SHIFT 8
2857 #define BRW_EU_ATT_0 0x8810
2858 #define BRW_EU_ATT_1 0x8814
2859 #define BRW_EU_ATT_DATA_0 0x8820
2860 #define BRW_EU_ATT_DATA_1 0x8824
2861 #define BRW_EU_ATT_CLR_0 0x8830
2862 #define BRW_EU_ATT_CLR_1 0x8834
2863 #define BRW_EU_RDATA 0x8840
2865 /* End regs for broadwater */
2867 #define MAX_DISPLAY_PIPES 2
2881 /* What's connected to the pipes (as reported by the BIOS) */
2882 #define PIPE_ACTIVE_MASK 0xff
2883 #define PIPE_CRT_ACTIVE (1 << CrtIndex)
2884 #define PIPE_TV_ACTIVE (1 << TvIndex)
2885 #define PIPE_DFP_ACTIVE (1 << DfpIndex)
2886 #define PIPE_LCD_ACTIVE (1 << LfpIndex)
2887 #define PIPE_CRT2_ACTIVE (1 << Crt2Index)
2888 #define PIPE_TV2_ACTIVE (1 << Tv2Index)
2889 #define PIPE_DFP2_ACTIVE (1 << Dfp2Index)
2890 #define PIPE_LCD2_ACTIVE (1 << Lfp2Index)
2892 #define PIPE_SIZED_DISP_MASK (PIPE_DFP_ACTIVE | \
2896 #define PIPE_A_SHIFT 0
2897 #define PIPE_B_SHIFT 8
2898 #define PIPE_SHIFT(n) ((n) == 0 ? \
2899 PIPE_A_SHIFT : PIPE_B_SHIFT)
2902 * Some BIOS scratch area registers. The 845 (and 830?) store the amount
2903 * of video memory available to the BIOS in SWF1.
2906 #define SWF0 0x71410
2907 #define SWF1 0x71414
2908 #define SWF2 0x71418
2909 #define SWF3 0x7141c
2910 #define SWF4 0x71420
2911 #define SWF5 0x71424
2912 #define SWF6 0x71428
2915 * 855 scratch registers.
2917 #define SWF00 0x70410
2918 #define SWF01 0x70414
2919 #define SWF02 0x70418
2920 #define SWF03 0x7041c
2921 #define SWF04 0x70420
2922 #define SWF05 0x70424
2923 #define SWF06 0x70428
2933 #define SWF30 0x72414
2934 #define SWF31 0x72418
2935 #define SWF32 0x7241c
2938 * Overlay registers. These are overlay registers accessed via MMIO.
2939 * Those loaded via the overlay register page are defined in i830_video.c.
2941 #define OVADD 0x30000
2943 #define DOVSTA 0x30008
2944 #define OC_BUF (0x3<<20)
2946 #define OGAMC5 0x30010
2947 #define OGAMC4 0x30014
2948 #define OGAMC3 0x30018
2949 #define OGAMC2 0x3001c
2950 #define OGAMC1 0x30020
2951 #define OGAMC0 0x30024
2957 #define PALETTE_A 0x0a000
2958 #define PALETTE_B 0x0a800
2960 /* Framebuffer compression */
2961 #define FBC_CFB_BASE 0x03200 /* 4k page aligned */
2962 #define FBC_LL_BASE 0x03204 /* 4k page aligned */
2963 #define FBC_CONTROL 0x03208
2964 #define FBC_CTL_EN (1<<31)
2965 #define FBC_CTL_PERIODIC (1<<30)
2966 #define FBC_CTL_INTERVAL_SHIFT (16)
2967 #define FBC_CTL_UNCOMPRESSIBLE (1<<14)
2968 #define FBC_CTL_STRIDE_SHIFT (5)
2969 #define FBC_CTL_FENCENO (1<<0)
2970 #define FBC_COMMAND 0x0320c
2971 #define FBC_CMD_COMPRESS (1<<0)
2972 #define FBC_STATUS 0x03210
2973 #define FBC_STAT_COMPRESSING (1<<31)
2974 #define FBC_STAT_COMPRESSED (1<<30)
2975 #define FBC_STAT_MODIFIED (1<<29)
2976 #define FBC_STAT_CURRENT_LINE (1<<0)
2977 #define FBC_CONTROL2 0x03214
2978 #define FBC_CTL_FENCE_DBL (0<<4)
2979 #define FBC_CTL_IDLE_IMM (0<<2)
2980 #define FBC_CTL_IDLE_FULL (1<<2)
2981 #define FBC_CTL_IDLE_LINE (2<<2)
2982 #define FBC_CTL_IDLE_DEBUG (3<<2)
2983 #define FBC_CTL_CPU_FENCE (1<<1)
2984 #define FBC_CTL_PLANEA (0<<0)
2985 #define FBC_CTL_PLANEB (1<<0)
2986 #define FBC_FENCE_OFF 0x0321b
2987 #define FBC_MOD_NUM 0x03220
2988 #define FBC_TAG_DEBUG 0x03300
2990 #define FBC_LL_SIZE (1536)
2991 #define FBC_LL_PAD (32)
2993 /* Framebuffer compression version 2 */
2994 #define DPFC_CB_BASE 0x3200
2995 #define DPFC_CONTROL 0x3208
2996 #define DPFC_CTL_EN (1<<31)
2997 #define DPFC_CTL_PLANEA (0<<30)
2998 #define DPFC_CTL_PLANEB (1<<30)
2999 #define DPFC_CTL_FENCE_EN (1<<29)
3000 #define DPFC_CTL_LIMIT_1X (0<<6)
3001 #define DPFC_CTL_LIMIT_2X (1<<6)
3002 #define DPFC_CTL_LIMIT_4X (2<<6)
3003 #define DPFC_RECOMP_CTL 0x320c
3004 #define DPFC_RECOMP_STALL_EN (1<<27)
3005 #define DPFC_RECOMP_STALL_WM_SHIFT (16)
3006 #define DPFC_RECOMP_STALL_WM_MASK (0x07ff0000)
3007 #define DPFC_RECOMP_TIMER_COUNT_SHIFT (0)
3008 #define DPFC_RECOMP_TIMER_COUNT_MASK (0x0000003f)
3009 #define DPFC_STATUS 0x3210
3010 #define DPFC_INVAL_SEG_SHIFT (16)
3011 #define DPFC_INVAL_SEG_MASK (0x07ff0000)
3012 #define DPFC_COMP_SEG_SHIFT (0)
3013 #define DPFC_COMP_SEG_MASK (0x000003ff)
3014 #define DPFC_STATUS2 0x3214
3015 #define DPFC_FENCE_YOFF 0x3218
3017 #define PEG_BAND_GAP_DATA 0x14d68
3019 #define MCHBAR_RENDER_STANDBY 0x111B8
3020 #define RENDER_STANDBY_ENABLE (1 << 30)
3025 /* warmup time in us */
3026 #define WARMUP_PCH_REF_CLK_SSC_MOD 1
3027 #define WARMUP_PCH_FDI_RECEIVER_PLL 25
3028 #define WARMUP_PCH_DPLL 50
3029 #define WARMUP_CPU_DP_PLL 20
3030 #define WARMUP_CPU_FDI_TRANSMITTER_PLL 10
3031 #define WARMUP_DMI_LATENCY 20
3032 #define FDI_TRAIN_PATTERN_1_TIME 0.5
3033 #define FDI_TRAIN_PATTERN_2_TIME 1.5
3034 #define FDI_ONE_IDLE_PATTERN_TIME 31
3036 #define CPU_VGACNTRL 0x41000
3038 #define DIGITAL_PORT_HOTPLUG_CNTRL 0x44030
3039 #define DIGITAL_PORTA_HOTPLUG_ENABLE (1 << 4)
3040 #define DIGITAL_PORTA_SHORT_PULSE_2MS (0 << 2)
3041 #define DIGITAL_PORTA_SHORT_PULSE_4_5MS (1 << 2)
3042 #define DIGITAL_PORTA_SHORT_PULSE_6MS (2 << 2)
3043 #define DIGITAL_PORTA_SHORT_PULSE_100MS (3 << 2)
3044 #define DIGITAL_PORTA_NO_DETECT (0 << 0)
3045 #define DIGITAL_PORTA_LONG_PULSE_DETECT_MASK (1 << 1)
3046 #define DIGITAL_PORTA_SHORT_PULSE_DETECT_MASK (1 << 0)
3048 /* refresh rate hardware control */
3049 #define RR_HW_CTL 0x45300
3050 #define RR_HW_LOW_POWER_FRAMES_MASK 0xff
3051 #define RR_HW_HIGH_POWER_FRAMES_MASK 0xff00
3053 #define FDI_PLL_BIOS_0 0x46000
3054 #define FDI_PLL_BIOS_1 0x46004
3055 #define FDI_PLL_BIOS_2 0x46008
3056 #define DISPLAY_PORT_PLL_BIOS_0 0x4600c
3057 #define DISPLAY_PORT_PLL_BIOS_1 0x46010
3058 #define DISPLAY_PORT_PLL_BIOS_2 0x46014
3060 #define FDI_PLL_FREQ_CTL 0x46030
3061 #define FDI_PLL_FREQ_CHANGE_REQUEST (1<<24)
3062 #define FDI_PLL_FREQ_LOCK_LIMIT_MASK 0xfff00
3063 #define FDI_PLL_FREQ_DISABLE_COUNT_LIMIT_MASK 0xff
3065 #define PIPEA_DATA_M1 0x60030
3066 #define TU_SIZE(x) (((x)-1) << 25) /* default size 64 */
3067 #define TU_SIZE_MASK 0x7e000000
3068 #define PIPEA_DATA_M1_OFFSET 0
3069 #define PIPEA_DATA_N1 0x60034
3070 #define PIPEA_DATA_N1_OFFSET 0
3072 #define PIPEA_DATA_M2 0x60038
3073 #define PIPEA_DATA_M2_OFFSET 0
3074 #define PIPEA_DATA_N2 0x6003c
3075 #define PIPEA_DATA_N2_OFFSET 0
3077 #define PIPEA_LINK_M1 0x60040
3078 #define PIPEA_LINK_M1_OFFSET 0
3079 #define PIPEA_LINK_N1 0x60044
3080 #define PIPEA_LINK_N1_OFFSET 0
3082 #define PIPEA_LINK_M2 0x60048
3083 #define PIPEA_LINK_M2_OFFSET 0
3084 #define PIPEA_LINK_N2 0x6004c
3085 #define PIPEA_LINK_N2_OFFSET 0
3087 /* PIPEB timing regs are same start from 0x61000 */
3089 #define PIPEB_DATA_M1 0x61030
3090 #define PIPEB_DATA_M1_OFFSET 0
3091 #define PIPEB_DATA_N1 0x61034
3092 #define PIPEB_DATA_N1_OFFSET 0
3094 #define PIPEB_DATA_M2 0x61038
3095 #define PIPEB_DATA_M2_OFFSET 0
3096 #define PIPEB_DATA_N2 0x6103c
3097 #define PIPEB_DATA_N2_OFFSET 0
3099 #define PIPEB_LINK_M1 0x61040
3100 #define PIPEB_LINK_M1_OFFSET 0
3101 #define PIPEB_LINK_N1 0x61044
3102 #define PIPEB_LINK_N1_OFFSET 0
3104 #define PIPEB_LINK_M2 0x61048
3105 #define PIPEB_LINK_M2_OFFSET 0
3106 #define PIPEB_LINK_N2 0x6104c
3107 #define PIPEB_LINK_N2_OFFSET 0
3109 /* PIPECONF for pipe A/B addr is same */
3111 /* cusor A is only connected to pipe A,
3112 cursor B is connected to pipe B. Otherwise no change. */
3114 /* Plane A/B, DSPACNTR/DSPBCNTR addr not changed */
3116 /* CPU panel fitter */
3117 #define PFA_CTL_1 0x68080
3118 #define PFB_CTL_1 0x68880
3119 #define PF_ENABLE (1<<31)
3121 #define PFA_WIN_POS 0x68070
3122 #define PFB_WIN_POS 0x68870
3123 #define PFA_WIN_SIZE 0x68074
3124 #define PFB_WIN_SIZE 0x68874
3126 /* legacy palette */
3127 #define LGC_PALETTE_A 0x4a000
3128 #define LGC_PALETTE_B 0x4a800
3131 #define DE_MASTER_IRQ_CONTROL (1 << 31)
3132 #define DE_SPRITEB_FLIP_DONE (1 << 29)
3133 #define DE_SPRITEA_FLIP_DONE (1 << 28)
3134 #define DE_PLANEB_FLIP_DONE (1 << 27)
3135 #define DE_PLANEA_FLIP_DONE (1 << 26)
3136 #define DE_PCU_EVENT (1 << 25)
3137 #define DE_GTT_FAULT (1 << 24)
3138 #define DE_POISON (1 << 23)
3139 #define DE_PERFORM_COUNTER (1 << 22)
3140 #define DE_PCH_EVENT (1 << 21)
3141 #define DE_AUX_CHANNEL_A (1 << 20)
3142 #define DE_DP_A_HOTPLUG (1 << 19)
3143 #define DE_GSE (1 << 18)
3144 #define DE_PIPEB_VBLANK (1 << 15)
3145 #define DE_PIPEB_EVEN_FIELD (1 << 14)
3146 #define DE_PIPEB_ODD_FIELD (1 << 13)
3147 #define DE_PIPEB_LINE_COMPARE (1 << 12)
3148 #define DE_PIPEB_VSYNC (1 << 11)
3149 #define DE_PIPEB_FIFO_UNDERRUN (1 << 8)
3150 #define DE_PIPEA_VBLANK (1 << 7)
3151 #define DE_PIPEA_EVEN_FIELD (1 << 6)
3152 #define DE_PIPEA_ODD_FIELD (1 << 5)
3153 #define DE_PIPEA_LINE_COMPARE (1 << 4)
3154 #define DE_PIPEA_VSYNC (1 << 3)
3155 #define DE_PIPEA_FIFO_UNDERRUN (1 << 0)
3157 #define DEISR 0x44000
3158 #define DEIMR 0x44004
3159 #define DEIIR 0x44008
3160 #define DEIER 0x4400c
3163 #define GT_SYNC_STATUS (1 << 2)
3164 #define GT_USER_INTERRUPT (1 << 0)
3166 #define GTISR 0x44010
3167 #define GTIMR 0x44014
3168 #define GTIIR 0x44018
3169 #define GTIER 0x4401c
3173 /* south display engine interrupt */
3174 #define SDE_CRT_HOTPLUG (1 << 11)
3175 #define SDE_PORTD_HOTPLUG (1 << 10)
3176 #define SDE_PORTC_HOTPLUG (1 << 9)
3177 #define SDE_PORTB_HOTPLUG (1 << 8)
3178 #define SDE_SDVOB_HOTPLUG (1 << 6)
3180 #define SDEISR 0xc4000
3181 #define SDEIMR 0xc4004
3182 #define SDEIIR 0xc4008
3183 #define SDEIER 0xc400c
3185 /* digital port hotplug */
3186 #define PCH_PORT_HOTPLUG 0xc4030
3187 #define PORTD_HOTPLUG_ENABLE (1 << 20)
3188 #define PORTD_PULSE_DURATION_2ms (0)
3189 #define PORTD_PULSE_DURATION_4_5ms (1 << 18)
3190 #define PORTD_PULSE_DURATION_6ms (2 << 18)
3191 #define PORTD_PULSE_DURATION_100ms (3 << 18)
3192 #define PORTD_HOTPLUG_NO_DETECT (0)
3193 #define PORTD_HOTPLUG_SHORT_DETECT (1 << 16)
3194 #define PORTD_HOTPLUG_LONG_DETECT (1 << 17)
3195 #define PORTC_HOTPLUG_ENABLE (1 << 12)
3196 #define PORTC_PULSE_DURATION_2ms (0)
3197 #define PORTC_PULSE_DURATION_4_5ms (1 << 10)
3198 #define PORTC_PULSE_DURATION_6ms (2 << 10)
3199 #define PORTC_PULSE_DURATION_100ms (3 << 10)
3200 #define PORTC_HOTPLUG_NO_DETECT (0)
3201 #define PORTC_HOTPLUG_SHORT_DETECT (1 << 8)
3202 #define PORTC_HOTPLUG_LONG_DETECT (1 << 9)
3203 #define PORTB_HOTPLUG_ENABLE (1 << 4)
3204 #define PORTB_PULSE_DURATION_2ms (0)
3205 #define PORTB_PULSE_DURATION_4_5ms (1 << 2)
3206 #define PORTB_PULSE_DURATION_6ms (2 << 2)
3207 #define PORTB_PULSE_DURATION_100ms (3 << 2)
3208 #define PORTB_HOTPLUG_NO_DETECT (0)
3209 #define PORTB_HOTPLUG_SHORT_DETECT (1 << 0)
3210 #define PORTB_HOTPLUG_LONG_DETECT (1 << 1)
3212 #define PCH_GPIOA 0xc5010
3213 #define PCH_GPIOB 0xc5014
3214 #define PCH_GPIOC 0xc5018
3215 #define PCH_GPIOD 0xc501c
3216 #define PCH_GPIOE 0xc5020
3217 #define PCH_GPIOF 0xc5024
3218 #define PCH_GMBUS0 0xc5100
3219 #define PCH_GMBUS1 0xc5104
3220 #define PCH_GMBUS2 0xc5108
3221 #define PCH_GMBUS3 0xc510c
3222 #define PCH_GMBUS4 0xc5110
3223 #define PCH_GMBUS5 0xc5120
3225 #define PCH_DPLL_A 0xc6014
3226 #define PCH_DPLL_B 0xc6018
3228 #define PCH_FPA0 0xc6040
3229 #define PCH_FPA1 0xc6044
3230 #define PCH_FPB0 0xc6048
3231 #define PCH_FPB1 0xc604c
3233 #define PCH_DPLL_TEST 0xc606c
3235 #define PCH_DREF_CONTROL 0xC6200
3236 #define DREF_CONTROL_MASK 0x7fc3
3237 #define DREF_CPU_SOURCE_OUTPUT_DISABLE (0<<13)
3238 #define DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD (2<<13)
3239 #define DREF_CPU_SOURCE_OUTPUT_NONSPREAD (3<<13)
3240 #define DREF_SSC_SOURCE_DISABLE (0<<11)
3241 #define DREF_SSC_SOURCE_ENABLE (2<<11)
3242 #define DREF_NONSPREAD_SOURCE_DISABLE (0<<9)
3243 #define DREF_NONSPREAD_SOURCE_ENABLE (2<<9)
3244 #define DREF_SUPERSPREAD_SOURCE_DISABLE (0<<7)
3245 #define DREF_SUPERSPREAD_SOURCE_ENABLE (2<<7)
3246 #define DREF_SSC4_DOWNSPREAD (0<<6)
3247 #define DREF_SSC4_CENTERSPREAD (1<<6)
3248 #define DREF_SSC1_DISABLE (0<<1)
3249 #define DREF_SSC1_ENABLE (1<<1)
3250 #define DREF_SSC4_DISABLE (0)
3251 #define DREF_SSC4_ENABLE (1)
3253 #define PCH_RAWCLK_FREQ 0xc6204
3254 #define FDL_TP1_TIMER_SHIFT 12
3255 #define FDL_TP1_TIMER_MASK (3<<12)
3256 #define FDL_TP2_TIMER_SHIFT 10
3257 #define FDL_TP2_TIMER_MASK (3<<10)
3258 #define RAWCLK_FREQ_MASK 0x3ff
3260 #define PCH_DPLL_TMR_CFG 0xc6208
3262 #define PCH_SSC4_PARMS 0xc6210
3263 #define PCH_SSC4_AUX_PARMS 0xc6214
3267 #define TRANS_HTOTAL_A 0xe0000
3268 #define TRANS_HTOTAL_SHIFT 16
3269 #define TRANS_HACTIVE_SHIFT 0
3270 #define TRANS_HBLANK_A 0xe0004
3271 #define TRANS_HBLANK_END_SHIFT 16
3272 #define TRANS_HBLANK_START_SHIFT 0
3273 #define TRANS_HSYNC_A 0xe0008
3274 #define TRANS_HSYNC_END_SHIFT 16
3275 #define TRANS_HSYNC_START_SHIFT 0
3276 #define TRANS_VTOTAL_A 0xe000c
3277 #define TRANS_VTOTAL_SHIFT 16
3278 #define TRANS_VACTIVE_SHIFT 0
3279 #define TRANS_VBLANK_A 0xe0010
3280 #define TRANS_VBLANK_END_SHIFT 16
3281 #define TRANS_VBLANK_START_SHIFT 0
3282 #define TRANS_VSYNC_A 0xe0014
3283 #define TRANS_VSYNC_END_SHIFT 16
3284 #define TRANS_VSYNC_START_SHIFT 0
3286 #define TRANSA_DATA_M1 0xe0030
3287 #define TRANSA_DATA_N1 0xe0034
3288 #define TRANSA_DATA_M2 0xe0038
3289 #define TRANSA_DATA_N2 0xe003c
3290 #define TRANSA_DP_LINK_M1 0xe0040
3291 #define TRANSA_DP_LINK_N1 0xe0044
3292 #define TRANSA_DP_LINK_M2 0xe0048
3293 #define TRANSA_DP_LINK_N2 0xe004c
3295 #define TRANS_HTOTAL_B 0xe1000
3296 #define TRANS_HBLANK_B 0xe1004
3297 #define TRANS_HSYNC_B 0xe1008
3298 #define TRANS_VTOTAL_B 0xe100c
3299 #define TRANS_VBLANK_B 0xe1010
3300 #define TRANS_VSYNC_B 0xe1014
3302 #define TRANSB_DATA_M1 0xe1030
3303 #define TRANSB_DATA_N1 0xe1034
3304 #define TRANSB_DATA_M2 0xe1038
3305 #define TRANSB_DATA_N2 0xe103c
3306 #define TRANSB_DP_LINK_M1 0xe1040
3307 #define TRANSB_DP_LINK_N1 0xe1044
3308 #define TRANSB_DP_LINK_M2 0xe1048
3309 #define TRANSB_DP_LINK_N2 0xe104c
3311 #define TRANSACONF 0xf0008
3312 #define TRANSBCONF 0xf1008
3313 #define TRANS_DISABLE (0<<31)
3314 #define TRANS_ENABLE (1<<31)
3315 #define TRANS_STATE_MASK (1<<30)
3316 #define TRANS_STATE_DISABLE (0<<30)
3317 #define TRANS_STATE_ENABLE (1<<30)
3318 #define TRANS_FSYNC_DELAY_HB1 (0<<27)
3319 #define TRANS_FSYNC_DELAY_HB2 (1<<27)
3320 #define TRANS_FSYNC_DELAY_HB3 (2<<27)
3321 #define TRANS_FSYNC_DELAY_HB4 (3<<27)
3322 #define TRANS_DP_AUDIO_ONLY (1<<26)
3323 #define TRANS_DP_VIDEO_AUDIO (0<<26)
3324 #define TRANS_PROGRESSIVE (0<<21)
3325 #define TRANS_8BPC (0<<5)
3326 #define TRANS_10BPC (1<<5)
3327 #define TRANS_6BPC (2<<5)
3328 #define TRANS_12BPC (3<<5)
3330 #define FDI_RXA_CHICKEN 0xc200c
3331 #define FDI_RXB_CHICKEN 0xc2010
3332 #define FDI_RX_PHASE_SYNC_POINTER_ENABLE (1)
3335 #define FDI_TXA_CTL 0x60100
3336 #define FDI_TXB_CTL 0x61100
3337 #define FDI_TX_DISABLE (0<<31)
3338 #define FDI_TX_ENABLE (1<<31)
3339 #define FDI_LINK_TRAIN_PATTERN_1 (0<<28)
3340 #define FDI_LINK_TRAIN_PATTERN_2 (1<<28)
3341 #define FDI_LINK_TRAIN_PATTERN_IDLE (2<<28)
3342 #define FDI_LINK_TRAIN_NONE (3<<28)
3343 #define FDI_LINK_TRAIN_VOLTAGE_0_4V (0<<25)
3344 #define FDI_LINK_TRAIN_VOLTAGE_0_6V (1<<25)
3345 #define FDI_LINK_TRAIN_VOLTAGE_0_8V (2<<25)
3346 #define FDI_LINK_TRAIN_VOLTAGE_1_2V (3<<25)
3347 #define FDI_LINK_TRAIN_PRE_EMPHASIS_NONE (0<<22)
3348 #define FDI_LINK_TRAIN_PRE_EMPHASIS_1_5X (1<<22)
3349 #define FDI_LINK_TRAIN_PRE_EMPHASIS_2X (2<<22)
3350 #define FDI_LINK_TRAIN_PRE_EMPHASIS_3X (3<<22)
3351 #define FDI_DP_PORT_WIDTH_X1 (0<<19)
3352 #define FDI_DP_PORT_WIDTH_X2 (1<<19)
3353 #define FDI_DP_PORT_WIDTH_X3 (2<<19)
3354 #define FDI_DP_PORT_WIDTH_X4 (3<<19)
3355 #define FDI_TX_ENHANCE_FRAME_ENABLE (1<<18)
3356 /* Ironlake: hardwired to 1 */
3357 #define FDI_TX_PLL_ENABLE (1<<14)
3358 /* both Tx and Rx */
3359 #define FDI_SCRAMBLING_ENABLE (0<<7)
3360 #define FDI_SCRAMBLING_DISABLE (1<<7)
3362 /* FDI_RX, FDI_X is hard-wired to Transcoder_X */
3363 #define FDI_RXA_CTL 0xf000c
3364 #define FDI_RXB_CTL 0xf100c
3365 #define FDI_RX_ENABLE (1<<31)
3366 #define FDI_RX_DISABLE (0<<31)
3367 /* train, dp width same as FDI_TX */
3368 #define FDI_DP_PORT_WIDTH_X8 (7<<19)
3369 #define FDI_8BPC (0<<16)
3370 #define FDI_10BPC (1<<16)
3371 #define FDI_6BPC (2<<16)
3372 #define FDI_12BPC (3<<16)
3373 #define FDI_LINK_REVERSE_OVERWRITE (1<<15)
3374 #define FDI_DMI_LINK_REVERSE_MASK (1<<14)
3375 #define FDI_RX_PLL_ENABLE (1<<13)
3376 #define FDI_FS_ERR_CORRECT_ENABLE (1<<11)
3377 #define FDI_FE_ERR_CORRECT_ENABLE (1<<10)
3378 #define FDI_FS_ERR_REPORT_ENABLE (1<<9)
3379 #define FDI_FE_ERR_REPORT_ENABLE (1<<8)
3380 #define FDI_RX_ENHANCE_FRAME_ENABLE (1<<6)
3381 #define FDI_SEL_RAWCLK (0<<4)
3382 #define FDI_SEL_PCDCLK (1<<4)
3384 #define FDI_RXA_MISC 0xf0010
3385 #define FDI_RXB_MISC 0xf1010
3386 #define FDI_RXA_TUSIZE1 0xf0030
3387 #define FDI_RXA_TUSIZE2 0xf0038
3388 #define FDI_RXB_TUSIZE1 0xf1030
3389 #define FDI_RXB_TUSIZE2 0xf1038
3391 /* FDI_RX interrupt register format */
3392 #define FDI_RX_INTER_LANE_ALIGN (1<<10)
3393 #define FDI_RX_SYMBOL_LOCK (1<<9) /* train 2 */
3394 #define FDI_RX_BIT_LOCK (1<<8) /* train 1 */
3395 #define FDI_RX_TRAIN_PATTERN_2_FAIL (1<<7)
3396 #define FDI_RX_FS_CODE_ERR (1<<6)
3397 #define FDI_RX_FE_CODE_ERR (1<<5)
3398 #define FDI_RX_SYMBOL_ERR_RATE_ABOVE (1<<4)
3399 #define FDI_RX_HDCP_LINK_FAIL (1<<3)
3400 #define FDI_RX_PIXEL_FIFO_OVERFLOW (1<<2)
3401 #define FDI_RX_CROSS_CLOCK_OVERFLOW (1<<1)
3402 #define FDI_RX_SYMBOL_QUEUE_OVERFLOW (1<<0)
3404 #define FDI_RXA_IIR 0xf0014
3405 #define FDI_RXA_IMR 0xf0018
3406 #define FDI_RXB_IIR 0xf1014
3407 #define FDI_RXB_IMR 0xf1018
3409 #define FDI_PLL_CTL_1 0xfe000
3410 #define FDI_PLL_CTL_2 0xfe004
3413 #define PCH_ADPA 0xe1100
3414 #define ADPA_TRANS_SELECT_MASK (1<<30)
3415 #define ADPA_TRANS_A_SELECT 0
3416 #define ADPA_TRANS_B_SELECT (1<<30)
3418 #define ADPA_CRT_HOTPLUG_MASK 0x03ff0000 /* bit 25-16 */
3419 #define ADPA_CRT_HOTPLUG_MONITOR_NONE (0<<24)
3420 #define ADPA_CRT_HOTPLUG_MONITOR_MASK (3<<24)
3421 #define ADPA_CRT_HOTPLUG_MONITOR_COLOR (3<<24)
3422 #define ADPA_CRT_HOTPLUG_MONITOR_MONO (2<<24)
3423 #define ADPA_CRT_HOTPLUG_ENABLE (1<<23)
3424 #define ADPA_CRT_HOTPLUG_PERIOD_64 (0<<22)
3425 #define ADPA_CRT_HOTPLUG_PERIOD_128 (1<<22)
3426 #define ADPA_CRT_HOTPLUG_WARMUP_5MS (0<<21)
3427 #define ADPA_CRT_HOTPLUG_WARMUP_10MS (1<<21)
3428 #define ADPA_CRT_HOTPLUG_SAMPLE_2S (0<<20)
3429 #define ADPA_CRT_HOTPLUG_SAMPLE_4S (1<<20)
3430 #define ADPA_CRT_HOTPLUG_VOLTAGE_40 (0<<18)
3431 #define ADPA_CRT_HOTPLUG_VOLTAGE_50 (1<<18)
3432 #define ADPA_CRT_HOTPLUG_VOLTAGE_60 (2<<18)
3433 #define ADPA_CRT_HOTPLUG_VOLTAGE_70 (3<<18)
3434 #define ADPA_CRT_HOTPLUG_VOLREF_325MV (0<<17)
3435 #define ADPA_CRT_HOTPLUG_VOLREF_475MV (1<<17)
3436 #define ADPA_CRT_HOTPLUG_FORCE_TRIGGER (1<<16)
3437 /* polarity control not changed */
3440 #define HDMIB 0xe1140
3441 #define PORT_ENABLE (1 << 31)
3442 #define TRANSCODER_A (0)
3443 #define TRANSCODER_B (1 << 30)
3444 #define COLOR_FORMAT_8bpc (0)
3445 #define COLOR_FORMAT_12bpc (3 << 26)
3446 #define SDVOB_HOTPLUG_ENABLE (1 << 23)
3447 #define SDVO_ENCODING (0)
3448 #define TMDS_ENCODING (2 << 10)
3449 #define NULL_PACKET_VSYNC_ENABLE (1 << 9)
3450 #define SDVOB_BORDER_ENABLE (1 << 7)
3451 #define AUDIO_ENABLE (1 << 6)
3452 #define VSYNC_ACTIVE_HIGH (1 << 4)
3453 #define HSYNC_ACTIVE_HIGH (1 << 3)
3454 #define PORT_DETECTED (1 << 2)
3456 #define HDMIC 0xe1150
3457 #define HDMID 0xe1160
3458 #define PCH_LVDS 0xe1180
3460 #define AUD_CONFIG 0x62000
3461 #define AUD_DEBUG 0x62010
3462 #define AUD_VID_DID 0x62020
3463 #define AUD_RID 0x62024
3464 #define AUD_SUBN_CNT 0x62028
3465 #define AUD_FUNC_GRP 0x62040
3466 #define AUD_SUBN_CNT2 0x62044
3467 #define AUD_GRP_CAP 0x62048
3468 #define AUD_PWRST 0x6204c
3469 #define AUD_SUPPWR 0x62050
3470 #define AUD_SID 0x62054
3471 #define AUD_OUT_CWCAP 0x62070
3472 #define AUD_OUT_PCMSIZE 0x62074
3473 #define AUD_OUT_STR 0x62078
3474 #define AUD_OUT_DIG_CNVT 0x6207c
3475 #define AUD_OUT_CH_STR 0x62080
3476 #define AUD_OUT_STR_DESC 0x62084
3477 #define AUD_PINW_CAP 0x620a0
3478 #define AUD_PIN_CAP 0x620a4
3479 #define AUD_PINW_CONNLNG 0x620a8
3480 #define AUD_PINW_CONNLST 0x620ac
3481 #define AUD_PINW_CNTR 0x620b0
3482 #define AUD_PINW_UNSOLRESP 0x620b8
3483 #define AUD_CNTL_ST 0x620b4
3484 #define AUD_PINW_CONFIG 0x620bc
3485 #define AUD_HDMIW_STATUS 0x620d4
3486 #define AUD_HDMIW_HDMIEDID 0x6210c
3487 #define AUD_HDMIW_INFOFR 0x62118
3488 #define AUD_CONV_CHCNT 0x62120
3489 #define AUD_CTS_ENABLE 0x62128
3491 #define VIDEO_DIP_CTL 0x61170
3492 #define VIDEO_DIP_DATA 0x61178
3494 #endif /* _I810_REG_H */