Subversion Repositories Kolibri OS

Rev

Rev 3746 | Rev 4280 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3746 Rev 4104
Line 31... Line 31...
31
#define _PORT(port, a, b) ((a) + (port)*((b)-(a)))
31
#define _PORT(port, a, b) ((a) + (port)*((b)-(a)))
Line 32... Line 32...
32
 
32
 
33
#define _MASKED_BIT_ENABLE(a) (((a) << 16) | (a))
33
#define _MASKED_BIT_ENABLE(a) (((a) << 16) | (a))
Line 34... Line -...
34
#define _MASKED_BIT_DISABLE(a) ((a) << 16)
-
 
35
 
-
 
36
/*
-
 
37
 * The Bridge device's PCI config space has information about the
-
 
38
 * fb aperture size and the amount of pre-reserved memory.
-
 
39
 * This is all handled in the intel-gtt.ko module. i915.ko only
-
 
40
 * cares about the vga bit for the vga rbiter.
-
 
41
 */
-
 
42
#define INTEL_GMCH_CTRL		0x52
-
 
43
#define INTEL_GMCH_VGA_DISABLE  (1 << 1)
-
 
44
#define SNB_GMCH_CTRL		0x50
-
 
45
#define    SNB_GMCH_GGMS_SHIFT	8 /* GTT Graphics Memory Size */
-
 
46
#define    SNB_GMCH_GGMS_MASK	0x3
-
 
47
#define    SNB_GMCH_GMS_SHIFT   3 /* Graphics Mode Select */
-
 
48
#define    SNB_GMCH_GMS_MASK    0x1f
-
 
49
 
34
#define _MASKED_BIT_DISABLE(a) ((a) << 16)
Line 50... Line 35...
50
 
35
 
51
/* PCI config space */
36
/* PCI config space */
52
 
37
 
Line 59... Line 44...
59
#define GCFGC2	0xda
44
#define GCFGC2	0xda
60
#define GCFGC	0xf0 /* 915+ only */
45
#define GCFGC	0xf0 /* 915+ only */
61
#define   GC_LOW_FREQUENCY_ENABLE	(1 << 7)
46
#define   GC_LOW_FREQUENCY_ENABLE	(1 << 7)
62
#define   GC_DISPLAY_CLOCK_190_200_MHZ	(0 << 4)
47
#define   GC_DISPLAY_CLOCK_190_200_MHZ	(0 << 4)
63
#define   GC_DISPLAY_CLOCK_333_MHZ	(4 << 4)
48
#define   GC_DISPLAY_CLOCK_333_MHZ	(4 << 4)
-
 
49
#define   GC_DISPLAY_CLOCK_267_MHZ_PNV	(0 << 4)
-
 
50
#define   GC_DISPLAY_CLOCK_333_MHZ_PNV	(1 << 4)
-
 
51
#define   GC_DISPLAY_CLOCK_444_MHZ_PNV	(2 << 4)
-
 
52
#define   GC_DISPLAY_CLOCK_200_MHZ_PNV	(5 << 4)
-
 
53
#define   GC_DISPLAY_CLOCK_133_MHZ_PNV	(6 << 4)
-
 
54
#define   GC_DISPLAY_CLOCK_167_MHZ_PNV	(7 << 4)
64
#define   GC_DISPLAY_CLOCK_MASK		(7 << 4)
55
#define   GC_DISPLAY_CLOCK_MASK		(7 << 4)
65
#define   GM45_GC_RENDER_CLOCK_MASK	(0xf << 0)
56
#define   GM45_GC_RENDER_CLOCK_MASK	(0xf << 0)
66
#define   GM45_GC_RENDER_CLOCK_266_MHZ	(8 << 0)
57
#define   GM45_GC_RENDER_CLOCK_266_MHZ	(8 << 0)
67
#define   GM45_GC_RENDER_CLOCK_320_MHZ	(9 << 0)
58
#define   GM45_GC_RENDER_CLOCK_320_MHZ	(9 << 0)
68
#define   GM45_GC_RENDER_CLOCK_400_MHZ	(0xb << 0)
59
#define   GM45_GC_RENDER_CLOCK_400_MHZ	(0xb << 0)
Line 145... Line 136...
145
#define VGA_MSR_WRITE 0x3c2
136
#define VGA_MSR_WRITE 0x3c2
146
#define VGA_MSR_READ 0x3cc
137
#define VGA_MSR_READ 0x3cc
147
#define   VGA_MSR_MEM_EN (1<<1)
138
#define   VGA_MSR_MEM_EN (1<<1)
148
#define   VGA_MSR_CGA_MODE (1<<0)
139
#define   VGA_MSR_CGA_MODE (1<<0)
Line 149... Line -...
149
 
-
 
150
/*
-
 
151
 * SR01 is the only VGA register touched on non-UMS setups.
-
 
152
 * VLV doesn't do UMS, so the sequencer index/data registers
-
 
153
 * are the only VGA registers which need to include
-
 
154
 * display_mmio_offset.
-
 
155
 */
140
 
156
#define VGA_SR_INDEX (dev_priv->info->display_mmio_offset + 0x3c4)
141
#define VGA_SR_INDEX 0x3c4
157
#define SR01			1
142
#define SR01			1
Line 158... Line 143...
158
#define VGA_SR_DATA (dev_priv->info->display_mmio_offset + 0x3c5)
143
#define VGA_SR_DATA 0x3c5
159
 
144
 
160
#define VGA_AR_INDEX 0x3c0
145
#define VGA_AR_INDEX 0x3c0
161
#define   VGA_AR_VID_EN (1<<5)
146
#define   VGA_AR_VID_EN (1<<5)
Line 243... Line 228...
243
 *   simply ignores the register load under certain conditions.
228
 *   simply ignores the register load under certain conditions.
244
 * - One can actually load arbitrary many arbitrary registers: Simply issue x
229
 * - One can actually load arbitrary many arbitrary registers: Simply issue x
245
 *   address/value pairs. Don't overdue it, though, x <= 2^4 must hold!
230
 *   address/value pairs. Don't overdue it, though, x <= 2^4 must hold!
246
 */
231
 */
247
#define MI_LOAD_REGISTER_IMM(x)	MI_INSTR(0x22, 2*x-1)
232
#define MI_LOAD_REGISTER_IMM(x)	MI_INSTR(0x22, 2*x-1)
-
 
233
#define MI_STORE_REGISTER_MEM(x) MI_INSTR(0x24, 2*x-1)
248
#define MI_FLUSH_DW		MI_INSTR(0x26, 1) /* for GEN6 */
234
#define MI_FLUSH_DW		MI_INSTR(0x26, 1) /* for GEN6 */
249
#define   MI_FLUSH_DW_STORE_INDEX	(1<<21)
235
#define   MI_FLUSH_DW_STORE_INDEX	(1<<21)
250
#define   MI_INVALIDATE_TLB	(1<<18)
236
#define   MI_INVALIDATE_TLB	(1<<18)
251
#define   MI_FLUSH_DW_OP_STOREDW	(1<<14)
237
#define   MI_FLUSH_DW_OP_STOREDW	(1<<14)
252
#define   MI_INVALIDATE_BSD	(1<<7)
238
#define   MI_INVALIDATE_BSD	(1<<7)
Line 263... Line 249...
263
#define MI_SEMAPHORE_MBOX	MI_INSTR(0x16, 1) /* gen6+ */
249
#define MI_SEMAPHORE_MBOX	MI_INSTR(0x16, 1) /* gen6+ */
264
#define  MI_SEMAPHORE_GLOBAL_GTT    (1<<22)
250
#define  MI_SEMAPHORE_GLOBAL_GTT    (1<<22)
265
#define  MI_SEMAPHORE_UPDATE	    (1<<21)
251
#define  MI_SEMAPHORE_UPDATE	    (1<<21)
266
#define  MI_SEMAPHORE_COMPARE	    (1<<20)
252
#define  MI_SEMAPHORE_COMPARE	    (1<<20)
267
#define  MI_SEMAPHORE_REGISTER	    (1<<18)
253
#define  MI_SEMAPHORE_REGISTER	    (1<<18)
-
 
254
#define  MI_SEMAPHORE_SYNC_VR	    (0<<16) /* RCS  wait for VCS  (RVSYNC) */
-
 
255
#define  MI_SEMAPHORE_SYNC_VER	    (1<<16) /* RCS  wait for VECS (RVESYNC) */
-
 
256
#define  MI_SEMAPHORE_SYNC_BR	    (2<<16) /* RCS  wait for BCS  (RBSYNC) */
-
 
257
#define  MI_SEMAPHORE_SYNC_BV	    (0<<16) /* VCS  wait for BCS  (VBSYNC) */
-
 
258
#define  MI_SEMAPHORE_SYNC_VEV	    (1<<16) /* VCS  wait for VECS (VVESYNC) */
268
#define  MI_SEMAPHORE_SYNC_RV	    (2<<16)
259
#define  MI_SEMAPHORE_SYNC_RV	    (2<<16) /* VCS  wait for RCS  (VRSYNC) */
269
#define  MI_SEMAPHORE_SYNC_RB	    (0<<16)
260
#define  MI_SEMAPHORE_SYNC_RB	    (0<<16) /* BCS  wait for RCS  (BRSYNC) */
270
#define  MI_SEMAPHORE_SYNC_VR	    (0<<16)
261
#define  MI_SEMAPHORE_SYNC_VEB	    (1<<16) /* BCS  wait for VECS (BVESYNC) */
271
#define  MI_SEMAPHORE_SYNC_VB	    (2<<16)
262
#define  MI_SEMAPHORE_SYNC_VB	    (2<<16) /* BCS  wait for VCS  (BVSYNC) */
272
#define  MI_SEMAPHORE_SYNC_BR	    (2<<16)
263
#define  MI_SEMAPHORE_SYNC_BVE	    (0<<16) /* VECS wait for BCS  (VEBSYNC) */
-
 
264
#define  MI_SEMAPHORE_SYNC_VVE	    (1<<16) /* VECS wait for VCS  (VEVSYNC) */
273
#define  MI_SEMAPHORE_SYNC_BV	    (0<<16)
265
#define  MI_SEMAPHORE_SYNC_RVE	    (2<<16) /* VECS wait for RCS  (VERSYNC) */
274
#define  MI_SEMAPHORE_SYNC_INVALID  (1<<0)
266
#define  MI_SEMAPHORE_SYNC_INVALID  (3<<16)
275
/*
267
/*
276
 * 3D instructions used by the kernel
268
 * 3D instructions used by the kernel
277
 */
269
 */
278
#define GFX_INSTR(opcode, flags) ((0x3 << 29) | ((opcode) << 24) | (flags))
270
#define GFX_INSTR(opcode, flags) ((0x3 << 29) | ((opcode) << 24) | (flags))
Line 340... Line 332...
340
#define  DEBUG_RESET_FULL		(1<<7)
332
#define  DEBUG_RESET_FULL		(1<<7)
341
#define  DEBUG_RESET_RENDER		(1<<8)
333
#define  DEBUG_RESET_RENDER		(1<<8)
342
#define  DEBUG_RESET_DISPLAY		(1<<9)
334
#define  DEBUG_RESET_DISPLAY		(1<<9)
Line 343... Line 335...
343
 
335
 
-
 
336
/*
-
 
337
 * IOSF sideband
344
/*
338
 */
-
 
339
#define VLV_IOSF_DOORBELL_REQ			(VLV_DISPLAY_BASE + 0x2100)
-
 
340
#define   IOSF_DEVFN_SHIFT			24
-
 
341
#define   IOSF_OPCODE_SHIFT			16
345
 * DPIO - a special bus for various display related registers to hide behind:
342
#define   IOSF_PORT_SHIFT			8
346
 *  0x800c: m1, m2, n, p1, p2, k dividers
343
#define   IOSF_BYTE_ENABLES_SHIFT		4
-
 
344
#define   IOSF_BAR_SHIFT			1
347
 *  0x8014: REF and SFR select
345
#define   IOSF_SB_BUSY				(1<<0)
348
 *  0x8014: N divider, VCO select
346
#define   IOSF_PORT_PUNIT			0x4
-
 
347
#define   IOSF_PORT_NC				0x11
-
 
348
#define   IOSF_PORT_DPIO			0x12
-
 
349
#define VLV_IOSF_DATA				(VLV_DISPLAY_BASE + 0x2104)
-
 
350
#define VLV_IOSF_ADDR				(VLV_DISPLAY_BASE + 0x2108)
-
 
351
 
-
 
352
#define PUNIT_OPCODE_REG_READ			6
-
 
353
#define PUNIT_OPCODE_REG_WRITE			7
-
 
354
 
-
 
355
#define PUNIT_REG_GPU_LFM			0xd3
-
 
356
#define PUNIT_REG_GPU_FREQ_REQ			0xd4
-
 
357
#define PUNIT_REG_GPU_FREQ_STS			0xd8
349
 *  0x801c/3c: core clock bits
358
#define   GENFREQSTATUS				(1<<0)
-
 
359
#define PUNIT_REG_MEDIA_TURBO_FREQ_REQ		0xdc
-
 
360
 
-
 
361
#define PUNIT_FUSE_BUS2				0xf6 /* bits 47:40 */
-
 
362
#define PUNIT_FUSE_BUS1				0xf5 /* bits 55:48 */
-
 
363
 
350
 *  0x8048/68: low pass filter coefficients
364
#define IOSF_NC_FB_GFX_FREQ_FUSE		0x1c
-
 
365
#define   FB_GFX_MAX_FREQ_FUSE_SHIFT		3
-
 
366
#define   FB_GFX_MAX_FREQ_FUSE_MASK		0x000007f8
-
 
367
#define   FB_GFX_FGUARANTEED_FREQ_FUSE_SHIFT	11
-
 
368
#define   FB_GFX_FGUARANTEED_FREQ_FUSE_MASK	0x0007f800
-
 
369
#define IOSF_NC_FB_GFX_FMAX_FUSE_HI		0x34
-
 
370
#define   FB_FMAX_VMIN_FREQ_HI_MASK		0x00000007
-
 
371
#define IOSF_NC_FB_GFX_FMAX_FUSE_LO		0x30
-
 
372
#define   FB_FMAX_VMIN_FREQ_LO_SHIFT		27
-
 
373
#define   FB_FMAX_VMIN_FREQ_LO_MASK		0xf8000000
-
 
374
 
-
 
375
/*
351
 *  0x8100: fast clock controls
376
 * DPIO - a special bus for various display related registers to hide behind
352
 *
377
 *
-
 
378
 * DPIO is VLV only.
-
 
379
 *
353
 * DPIO is VLV only.
380
 * Note: digital port B is DDI0, digital pot C is DDI1
354
 */
-
 
355
#define DPIO_PKT			(VLV_DISPLAY_BASE + 0x2100)
381
 */
356
#define  DPIO_RID			(0<<24)
382
#define DPIO_DEVFN			0
357
#define  DPIO_OP_WRITE			(1<<16)
383
#define DPIO_OPCODE_REG_WRITE		1
358
#define  DPIO_OP_READ			(0<<16)
-
 
359
#define  DPIO_PORTID			(0x12<<8)
-
 
360
#define  DPIO_BYTE			(0xf<<4)
-
 
361
#define  DPIO_BUSY			(1<<0) /* status only */
-
 
362
#define DPIO_DATA			(VLV_DISPLAY_BASE + 0x2104)
-
 
-
 
384
#define DPIO_OPCODE_REG_READ		0
363
#define DPIO_REG			(VLV_DISPLAY_BASE + 0x2108)
385
 
364
#define DPIO_CTL			(VLV_DISPLAY_BASE + 0x2110)
386
#define DPIO_CTL			(VLV_DISPLAY_BASE + 0x2110)
365
#define  DPIO_MODSEL1			(1<<3) /* if ref clk b == 27 */
387
#define  DPIO_MODSEL1			(1<<3) /* if ref clk b == 27 */
366
#define  DPIO_MODSEL0			(1<<2) /* if ref clk a == 27 */
388
#define  DPIO_MODSEL0			(1<<2) /* if ref clk a == 27 */
367
#define  DPIO_SFR_BYPASS		(1<<1)
389
#define  DPIO_SFR_BYPASS		(1<<1)
Line -... Line 390...
-
 
390
#define  DPIO_RESET			(1<<0)
-
 
391
 
-
 
392
#define _DPIO_TX3_SWING_CTL4_A		0x690
-
 
393
#define _DPIO_TX3_SWING_CTL4_B		0x2a90
-
 
394
#define DPIO_TX3_SWING_CTL4(pipe) _PIPE(pipe, _DPIO_TX_SWING_CTL4_A, \
-
 
395
					_DPIO_TX3_SWING_CTL4_B)
-
 
396
 
-
 
397
/*
368
#define  DPIO_RESET			(1<<0)
398
 * Per pipe/PLL DPIO regs
369
 
399
 */
-
 
400
#define _DPIO_DIV_A			0x800c
-
 
401
#define   DPIO_POST_DIV_SHIFT		(28) /* 3 bits */
-
 
402
#define   DPIO_POST_DIV_DAC		0
-
 
403
#define   DPIO_POST_DIV_HDMIDP		1 /* DAC 225-400M rate */
370
#define _DPIO_DIV_A			0x800c
404
#define   DPIO_POST_DIV_LVDS1		2
371
#define   DPIO_POST_DIV_SHIFT		(28) /* 3 bits */
405
#define   DPIO_POST_DIV_LVDS2		3
372
#define   DPIO_K_SHIFT			(24) /* 4 bits */
406
#define   DPIO_K_SHIFT			(24) /* 4 bits */
373
#define   DPIO_P1_SHIFT			(21) /* 3 bits */
407
#define   DPIO_P1_SHIFT			(21) /* 3 bits */
374
#define   DPIO_P2_SHIFT			(16) /* 5 bits */
408
#define   DPIO_P2_SHIFT			(16) /* 5 bits */
Line 392... Line 426...
392
 
426
 
393
#define _DPIO_CORE_CLK_A		0x801c
427
#define _DPIO_CORE_CLK_A		0x801c
394
#define _DPIO_CORE_CLK_B		0x803c
428
#define _DPIO_CORE_CLK_B		0x803c
Line -... Line 429...
-
 
429
#define DPIO_CORE_CLK(pipe) _PIPE(pipe, _DPIO_CORE_CLK_A, _DPIO_CORE_CLK_B)
-
 
430
 
-
 
431
#define _DPIO_IREF_CTL_A		0x8040
-
 
432
#define _DPIO_IREF_CTL_B		0x8060
-
 
433
#define DPIO_IREF_CTL(pipe) _PIPE(pipe, _DPIO_IREF_CTL_A, _DPIO_IREF_CTL_B)
-
 
434
 
-
 
435
#define DPIO_IREF_BCAST			0xc044
-
 
436
#define _DPIO_IREF_A			0x8044
-
 
437
#define _DPIO_IREF_B			0x8064
-
 
438
#define DPIO_IREF(pipe) _PIPE(pipe, _DPIO_IREF_A, _DPIO_IREF_B)
-
 
439
 
-
 
440
#define _DPIO_PLL_CML_A			0x804c
-
 
441
#define _DPIO_PLL_CML_B			0x806c
395
#define DPIO_CORE_CLK(pipe) _PIPE(pipe, _DPIO_CORE_CLK_A, _DPIO_CORE_CLK_B)
442
#define DPIO_PLL_CML(pipe) _PIPE(pipe, _DPIO_PLL_CML_A, _DPIO_PLL_CML_B)
396
 
443
 
397
#define _DPIO_LFP_COEFF_A		0x8048
444
#define _DPIO_LPF_COEFF_A		0x8048
-
 
445
#define _DPIO_LPF_COEFF_B		0x8068
-
 
446
#define DPIO_LPF_COEFF(pipe) _PIPE(pipe, _DPIO_LPF_COEFF_A, _DPIO_LPF_COEFF_B)
Line 398... Line 447...
398
#define _DPIO_LFP_COEFF_B		0x8068
447
 
Line -... Line 448...
-
 
448
#define DPIO_CALIBRATION		0x80ac
-
 
449
 
-
 
450
#define DPIO_FASTCLK_DISABLE		0x8100
-
 
451
 
-
 
452
/*
-
 
453
 * Per DDI channel DPIO regs
-
 
454
 */
-
 
455
 
-
 
456
#define _DPIO_PCS_TX_0			0x8200
-
 
457
#define _DPIO_PCS_TX_1			0x8400
-
 
458
#define   DPIO_PCS_TX_LANE2_RESET	(1<<16)
-
 
459
#define   DPIO_PCS_TX_LANE1_RESET	(1<<7)
-
 
460
#define DPIO_PCS_TX(port) _PORT(port, _DPIO_PCS_TX_0, _DPIO_PCS_TX_1)
-
 
461
 
-
 
462
#define _DPIO_PCS_CLK_0			0x8204
-
 
463
#define _DPIO_PCS_CLK_1			0x8404
-
 
464
#define   DPIO_PCS_CLK_CRI_RXEB_EIOS_EN	(1<<22)
-
 
465
#define   DPIO_PCS_CLK_CRI_RXDIGFILTSG_EN (1<<21)
-
 
466
#define   DPIO_PCS_CLK_DATAWIDTH_SHIFT	(6)
-
 
467
#define   DPIO_PCS_CLK_SOFT_RESET	(1<<5)
-
 
468
#define DPIO_PCS_CLK(port) _PORT(port, _DPIO_PCS_CLK_0, _DPIO_PCS_CLK_1)
-
 
469
 
-
 
470
#define _DPIO_PCS_CTL_OVR1_A		0x8224
-
 
471
#define _DPIO_PCS_CTL_OVR1_B		0x8424
-
 
472
#define DPIO_PCS_CTL_OVER1(port) _PORT(port, _DPIO_PCS_CTL_OVR1_A, \
-
 
473
				       _DPIO_PCS_CTL_OVR1_B)
-
 
474
 
-
 
475
#define _DPIO_PCS_STAGGER0_A		0x822c
-
 
476
#define _DPIO_PCS_STAGGER0_B		0x842c
-
 
477
#define DPIO_PCS_STAGGER0(port) _PORT(port, _DPIO_PCS_STAGGER0_A, \
-
 
478
				      _DPIO_PCS_STAGGER0_B)
-
 
479
 
-
 
480
#define _DPIO_PCS_STAGGER1_A		0x8230
-
 
481
#define _DPIO_PCS_STAGGER1_B		0x8430
-
 
482
#define DPIO_PCS_STAGGER1(port) _PORT(port, _DPIO_PCS_STAGGER1_A, \
-
 
483
				      _DPIO_PCS_STAGGER1_B)
-
 
484
 
-
 
485
#define _DPIO_PCS_CLOCKBUF0_A		0x8238
-
 
486
#define _DPIO_PCS_CLOCKBUF0_B		0x8438
-
 
487
#define DPIO_PCS_CLOCKBUF0(port) _PORT(port, _DPIO_PCS_CLOCKBUF0_A, \
-
 
488
				       _DPIO_PCS_CLOCKBUF0_B)
-
 
489
 
-
 
490
#define _DPIO_PCS_CLOCKBUF8_A		0x825c
-
 
491
#define _DPIO_PCS_CLOCKBUF8_B		0x845c
-
 
492
#define DPIO_PCS_CLOCKBUF8(port) _PORT(port, _DPIO_PCS_CLOCKBUF8_A, \
-
 
493
				       _DPIO_PCS_CLOCKBUF8_B)
-
 
494
 
-
 
495
#define _DPIO_TX_SWING_CTL2_A		0x8288
-
 
496
#define _DPIO_TX_SWING_CTL2_B		0x8488
-
 
497
#define DPIO_TX_SWING_CTL2(port) _PORT(port, _DPIO_TX_SWING_CTL2_A, \
-
 
498
				       _DPIO_TX_SWING_CTL2_B)
-
 
499
 
-
 
500
#define _DPIO_TX_SWING_CTL3_A		0x828c
-
 
501
#define _DPIO_TX_SWING_CTL3_B		0x848c
-
 
502
#define DPIO_TX_SWING_CTL3(port) _PORT(port, _DPIO_TX_SWING_CTL3_A, \
-
 
503
				       _DPIO_TX_SWING_CTL3_B)
-
 
504
 
-
 
505
#define _DPIO_TX_SWING_CTL4_A		0x8290
-
 
506
#define _DPIO_TX_SWING_CTL4_B		0x8490
-
 
507
#define DPIO_TX_SWING_CTL4(port) _PORT(port, _DPIO_TX_SWING_CTL4_A, \
-
 
508
				       _DPIO_TX_SWING_CTL4_B)
-
 
509
 
-
 
510
#define _DPIO_TX_OCALINIT_0		0x8294
-
 
511
#define _DPIO_TX_OCALINIT_1		0x8494
-
 
512
#define   DPIO_TX_OCALINIT_EN		(1<<31)
-
 
513
#define DPIO_TX_OCALINIT(port) _PORT(port, _DPIO_TX_OCALINIT_0, \
-
 
514
				     _DPIO_TX_OCALINIT_1)
-
 
515
 
-
 
516
#define _DPIO_TX_CTL_0			0x82ac
-
 
517
#define _DPIO_TX_CTL_1			0x84ac
-
 
518
#define DPIO_TX_CTL(port) _PORT(port, _DPIO_TX_CTL_0, _DPIO_TX_CTL_1)
-
 
519
 
-
 
520
#define _DPIO_TX_LANE_0			0x82b8
-
 
521
#define _DPIO_TX_LANE_1			0x84b8
-
 
522
#define DPIO_TX_LANE(port) _PORT(port, _DPIO_TX_LANE_0, _DPIO_TX_LANE_1)
-
 
523
 
-
 
524
#define _DPIO_DATA_CHANNEL1		0x8220
-
 
525
#define _DPIO_DATA_CHANNEL2		0x8420
-
 
526
#define DPIO_DATA_CHANNEL(port) _PORT(port, _DPIO_DATA_CHANNEL1, _DPIO_DATA_CHANNEL2)
-
 
527
 
-
 
528
#define _DPIO_PORT0_PCS0		0x0220
-
 
529
#define _DPIO_PORT0_PCS1		0x0420
399
#define DPIO_LFP_COEFF(pipe) _PIPE(pipe, _DPIO_LFP_COEFF_A, _DPIO_LFP_COEFF_B)
530
#define _DPIO_PORT1_PCS2		0x2620
400
 
531
#define _DPIO_PORT1_PCS3		0x2820
Line 401... Line 532...
401
#define DPIO_FASTCLK_DISABLE		0x8100
532
#define DPIO_DATA_LANE_A(port) _PORT(port, _DPIO_PORT0_PCS0, _DPIO_PORT1_PCS2)
402
 
533
#define DPIO_DATA_LANE_B(port) _PORT(port, _DPIO_PORT0_PCS1, _DPIO_PORT1_PCS3)
Line 441... Line 572...
441
 */
572
 */
442
#define PGTBL_ER	0x02024
573
#define PGTBL_ER	0x02024
443
#define RENDER_RING_BASE	0x02000
574
#define RENDER_RING_BASE	0x02000
444
#define BSD_RING_BASE		0x04000
575
#define BSD_RING_BASE		0x04000
445
#define GEN6_BSD_RING_BASE	0x12000
576
#define GEN6_BSD_RING_BASE	0x12000
-
 
577
#define VEBOX_RING_BASE		0x1a000
446
#define BLT_RING_BASE		0x22000
578
#define BLT_RING_BASE		0x22000
447
#define RING_TAIL(base)		((base)+0x30)
579
#define RING_TAIL(base)		((base)+0x30)
448
#define RING_HEAD(base)		((base)+0x34)
580
#define RING_HEAD(base)		((base)+0x34)
449
#define RING_START(base)	((base)+0x38)
581
#define RING_START(base)	((base)+0x38)
450
#define RING_CTL(base)		((base)+0x3c)
582
#define RING_CTL(base)		((base)+0x3c)
451
#define RING_SYNC_0(base)	((base)+0x40)
583
#define RING_SYNC_0(base)	((base)+0x40)
452
#define RING_SYNC_1(base)	((base)+0x44)
584
#define RING_SYNC_1(base)	((base)+0x44)
-
 
585
#define RING_SYNC_2(base)	((base)+0x48)
453
#define GEN6_RVSYNC (RING_SYNC_0(RENDER_RING_BASE))
586
#define GEN6_RVSYNC (RING_SYNC_0(RENDER_RING_BASE))
454
#define GEN6_RBSYNC (RING_SYNC_1(RENDER_RING_BASE))
587
#define GEN6_RBSYNC (RING_SYNC_1(RENDER_RING_BASE))
455
#define GEN6_VRSYNC (RING_SYNC_1(GEN6_BSD_RING_BASE))
588
#define GEN6_RVESYNC	(RING_SYNC_2(RENDER_RING_BASE))
456
#define GEN6_VBSYNC (RING_SYNC_0(GEN6_BSD_RING_BASE))
589
#define GEN6_VBSYNC	(RING_SYNC_0(GEN6_BSD_RING_BASE))
-
 
590
#define GEN6_VRSYNC (RING_SYNC_1(GEN6_BSD_RING_BASE))
-
 
591
#define GEN6_VVESYNC	(RING_SYNC_2(GEN6_BSD_RING_BASE))
457
#define GEN6_BRSYNC (RING_SYNC_0(BLT_RING_BASE))
592
#define GEN6_BRSYNC (RING_SYNC_0(BLT_RING_BASE))
458
#define GEN6_BVSYNC (RING_SYNC_1(BLT_RING_BASE))
593
#define GEN6_BVSYNC (RING_SYNC_1(BLT_RING_BASE))
-
 
594
#define GEN6_BVESYNC	(RING_SYNC_2(BLT_RING_BASE))
-
 
595
#define GEN6_VEBSYNC	(RING_SYNC_0(VEBOX_RING_BASE))
-
 
596
#define GEN6_VERSYNC	(RING_SYNC_1(VEBOX_RING_BASE))
-
 
597
#define GEN6_VEVSYNC	(RING_SYNC_2(VEBOX_RING_BASE))
-
 
598
#define GEN6_NOSYNC 0
459
#define RING_MAX_IDLE(base)	((base)+0x54)
599
#define RING_MAX_IDLE(base)	((base)+0x54)
460
#define RING_HWS_PGA(base)	((base)+0x80)
600
#define RING_HWS_PGA(base)	((base)+0x80)
461
#define RING_HWS_PGA_GEN6(base)	((base)+0x2080)
601
#define RING_HWS_PGA_GEN6(base)	((base)+0x2080)
462
#define ARB_MODE		0x04030
602
#define ARB_MODE		0x04030
463
#define   ARB_MODE_SWIZZLE_SNB	(1<<4)
603
#define   ARB_MODE_SWIZZLE_SNB	(1<<4)
Line 465... Line 605...
465
#define RENDER_HWS_PGA_GEN7	(0x04080)
605
#define RENDER_HWS_PGA_GEN7	(0x04080)
466
#define RING_FAULT_REG(ring)	(0x4094 + 0x100*(ring)->id)
606
#define RING_FAULT_REG(ring)	(0x4094 + 0x100*(ring)->id)
467
#define DONE_REG		0x40b0
607
#define DONE_REG		0x40b0
468
#define BSD_HWS_PGA_GEN7	(0x04180)
608
#define BSD_HWS_PGA_GEN7	(0x04180)
469
#define BLT_HWS_PGA_GEN7	(0x04280)
609
#define BLT_HWS_PGA_GEN7	(0x04280)
-
 
610
#define VEBOX_HWS_PGA_GEN7	(0x04380)
470
#define RING_ACTHD(base)	((base)+0x74)
611
#define RING_ACTHD(base)	((base)+0x74)
471
#define RING_NOPID(base)	((base)+0x94)
612
#define RING_NOPID(base)	((base)+0x94)
472
#define RING_IMR(base)		((base)+0xa8)
613
#define RING_IMR(base)		((base)+0xa8)
473
#define RING_TIMESTAMP(base)	((base)+0x358)
614
#define RING_TIMESTAMP(base)	((base)+0x358)
474
#define   TAIL_ADDR		0x001FFFF8
615
#define   TAIL_ADDR		0x001FFFF8
Line 525... Line 666...
525
#define HWSTAM		0x02098
666
#define HWSTAM		0x02098
526
#define DMA_FADD_I8XX	0x020d0
667
#define DMA_FADD_I8XX	0x020d0
Line 527... Line 668...
527
 
668
 
528
#define ERROR_GEN6	0x040a0
669
#define ERROR_GEN6	0x040a0
-
 
670
#define GEN7_ERR_INT	0x44040
529
#define GEN7_ERR_INT	0x44040
671
#define   ERR_INT_POISON		(1<<31)
-
 
672
#define   ERR_INT_MMIO_UNCLAIMED (1<<13)
-
 
673
#define   ERR_INT_FIFO_UNDERRUN_C	(1<<6)
-
 
674
#define   ERR_INT_FIFO_UNDERRUN_B	(1<<3)
-
 
675
#define   ERR_INT_FIFO_UNDERRUN_A	(1<<0)
Line 530... Line 676...
530
#define   ERR_INT_MMIO_UNCLAIMED (1<<13)
676
#define   ERR_INT_FIFO_UNDERRUN(pipe)	(1<<(pipe*3))
531
 
677
 
Line 532... Line 678...
532
#define FPGA_DBG		0x42300
678
#define FPGA_DBG		0x42300
-
 
679
#define   FPGA_DBG_RM_NOCLAIM	(1<<31)
-
 
680
 
-
 
681
#define DERRMR		0x44050
-
 
682
#define   DERRMR_PIPEA_SCANLINE		(1<<0)
-
 
683
#define   DERRMR_PIPEA_PRI_FLIP_DONE	(1<<1)
-
 
684
#define   DERRMR_PIPEA_SPR_FLIP_DONE	(1<<2)
-
 
685
#define   DERRMR_PIPEA_VBLANK		(1<<3)
-
 
686
#define   DERRMR_PIPEA_HBLANK		(1<<5)
-
 
687
#define   DERRMR_PIPEB_SCANLINE 	(1<<8)
-
 
688
#define   DERRMR_PIPEB_PRI_FLIP_DONE	(1<<9)
-
 
689
#define   DERRMR_PIPEB_SPR_FLIP_DONE	(1<<10)
-
 
690
#define   DERRMR_PIPEB_VBLANK		(1<<11)
-
 
691
#define   DERRMR_PIPEB_HBLANK		(1<<13)
-
 
692
/* Note that PIPEC is not a simple translation of PIPEA/PIPEB */
-
 
693
#define   DERRMR_PIPEC_SCANLINE		(1<<14)
-
 
694
#define   DERRMR_PIPEC_PRI_FLIP_DONE	(1<<15)
-
 
695
#define   DERRMR_PIPEC_SPR_FLIP_DONE	(1<<20)
Line 533... Line 696...
533
#define   FPGA_DBG_RM_NOCLAIM	(1<<31)
696
#define   DERRMR_PIPEC_VBLANK		(1<<21)
534
 
697
#define   DERRMR_PIPEC_HBLANK		(1<<22)
535
#define DERRMR		0x44050
698
 
536
 
699
 
Line 581... Line 744...
581
#define VLV_IIR_RW	(VLV_DISPLAY_BASE + 0x2084)
744
#define VLV_IIR_RW	(VLV_DISPLAY_BASE + 0x2084)
582
#define VLV_IER		(VLV_DISPLAY_BASE + 0x20a0)
745
#define VLV_IER		(VLV_DISPLAY_BASE + 0x20a0)
583
#define VLV_IIR		(VLV_DISPLAY_BASE + 0x20a4)
746
#define VLV_IIR		(VLV_DISPLAY_BASE + 0x20a4)
584
#define VLV_IMR		(VLV_DISPLAY_BASE + 0x20a8)
747
#define VLV_IMR		(VLV_DISPLAY_BASE + 0x20a8)
585
#define VLV_ISR		(VLV_DISPLAY_BASE + 0x20ac)
748
#define VLV_ISR		(VLV_DISPLAY_BASE + 0x20ac)
586
#define   I915_PIPE_CONTROL_NOTIFY_INTERRUPT		(1<<18)
-
 
587
#define   I915_DISPLAY_PORT_INTERRUPT			(1<<17)
-
 
588
#define   I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT	(1<<15)
-
 
589
#define   I915_GMCH_THERMAL_SENSOR_EVENT_INTERRUPT	(1<<14) /* p-state */
-
 
590
#define   I915_HWB_OOM_INTERRUPT			(1<<13)
-
 
591
#define   I915_SYNC_STATUS_INTERRUPT			(1<<12)
-
 
592
#define   I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT	(1<<11)
-
 
593
#define   I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT	(1<<10)
-
 
594
#define   I915_OVERLAY_PLANE_FLIP_PENDING_INTERRUPT	(1<<9)
-
 
595
#define   I915_DISPLAY_PLANE_C_FLIP_PENDING_INTERRUPT	(1<<8)
-
 
596
#define   I915_DISPLAY_PIPE_A_VBLANK_INTERRUPT		(1<<7)
-
 
597
#define   I915_DISPLAY_PIPE_A_EVENT_INTERRUPT		(1<<6)
-
 
598
#define   I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT		(1<<5)
-
 
599
#define   I915_DISPLAY_PIPE_B_EVENT_INTERRUPT		(1<<4)
-
 
600
#define   I915_DEBUG_INTERRUPT				(1<<2)
-
 
601
#define   I915_USER_INTERRUPT				(1<<1)
-
 
602
#define   I915_ASLE_INTERRUPT				(1<<0)
749
#define VLV_PCBR	(VLV_DISPLAY_BASE + 0x2120)
603
#define   I915_BSD_USER_INTERRUPT                      (1<<25)
-
 
604
#define   DISPLAY_PLANE_FLIP_PENDING(plane) (1<<(11-(plane))) /* A and B only */
750
#define   DISPLAY_PLANE_FLIP_PENDING(plane) (1<<(11-(plane))) /* A and B only */
605
#define EIR		0x020b0
751
#define EIR		0x020b0
606
#define EMR		0x020b4
752
#define EMR		0x020b4
607
#define ESR		0x020b8
753
#define ESR		0x020b8
608
#define   GM45_ERROR_PAGE_TABLE				(1<<5)
754
#define   GM45_ERROR_PAGE_TABLE				(1<<5)
Line 615... Line 761...
615
#define   INSTPM_SELF_EN (1<<12) /* 915GM only */
761
#define   INSTPM_SELF_EN (1<<12) /* 915GM only */
616
#define   INSTPM_AGPBUSY_DIS (1<<11) /* gen3: when disabled, pending interrupts
762
#define   INSTPM_AGPBUSY_DIS (1<<11) /* gen3: when disabled, pending interrupts
617
					will not assert AGPBUSY# and will only
763
					will not assert AGPBUSY# and will only
618
					be delivered when out of C3. */
764
					be delivered when out of C3. */
619
#define   INSTPM_FORCE_ORDERING				(1<<7) /* GEN6+ */
765
#define   INSTPM_FORCE_ORDERING				(1<<7) /* GEN6+ */
-
 
766
#define   INSTPM_TLB_INVALIDATE	(1<<9)
-
 
767
#define   INSTPM_SYNC_FLUSH	(1<<5)
620
#define ACTHD	        0x020c8
768
#define ACTHD	        0x020c8
621
#define FW_BLC		0x020d8
769
#define FW_BLC		0x020d8
622
#define FW_BLC2		0x020dc
770
#define FW_BLC2		0x020dc
623
#define FW_BLC_SELF	0x020e0 /* 915+ only */
771
#define FW_BLC_SELF	0x020e0 /* 915+ only */
624
#define   FW_BLC_SELF_EN_MASK      (1<<31)
772
#define   FW_BLC_SELF_EN_MASK      (1<<31)
Line 710... Line 858...
710
#define   ECO_FLIP_DONE		(1<<0)
858
#define   ECO_FLIP_DONE		(1<<0)
Line 711... Line 859...
711
 
859
 
712
#define CACHE_MODE_1		0x7004 /* IVB+ */
860
#define CACHE_MODE_1		0x7004 /* IVB+ */
Line 713... Line -...
713
#define   PIXEL_SUBSPAN_COLLECT_OPT_DISABLE (1<<6)
-
 
714
 
-
 
715
/* GEN6 interrupt control
-
 
716
 * Note that the per-ring interrupt bits do alias with the global interrupt bits
-
 
717
 * in GTIMR. */
-
 
718
#define GEN6_RENDER_HWSTAM	0x2098
-
 
719
#define GEN6_RENDER_IMR		0x20a8
-
 
720
#define   GEN6_RENDER_CONTEXT_SWITCH_INTERRUPT		(1 << 8)
-
 
721
#define   GEN6_RENDER_PPGTT_PAGE_FAULT			(1 << 7)
-
 
722
#define   GEN6_RENDER_TIMEOUT_COUNTER_EXPIRED		(1 << 6)
-
 
723
#define   GEN6_RENDER_L3_PARITY_ERROR			(1 << 5)
-
 
724
#define   GEN6_RENDER_PIPE_CONTROL_NOTIFY_INTERRUPT	(1 << 4)
-
 
725
#define   GEN6_RENDER_COMMAND_PARSER_MASTER_ERROR	(1 << 3)
-
 
726
#define   GEN6_RENDER_SYNC_STATUS			(1 << 2)
-
 
727
#define   GEN6_RENDER_DEBUG_INTERRUPT			(1 << 1)
-
 
728
#define   GEN6_RENDER_USER_INTERRUPT			(1 << 0)
-
 
729
 
-
 
730
#define GEN6_BLITTER_HWSTAM	0x22098
-
 
731
#define GEN6_BLITTER_IMR	0x220a8
-
 
732
#define   GEN6_BLITTER_MI_FLUSH_DW_NOTIFY_INTERRUPT	(1 << 26)
-
 
733
#define   GEN6_BLITTER_COMMAND_PARSER_MASTER_ERROR	(1 << 25)
-
 
734
#define   GEN6_BLITTER_SYNC_STATUS			(1 << 24)
-
 
735
#define   GEN6_BLITTER_USER_INTERRUPT			(1 << 22)
861
#define   PIXEL_SUBSPAN_COLLECT_OPT_DISABLE (1<<6)
736
 
862
 
737
#define GEN6_BLITTER_ECOSKPD	0x221d0
863
#define GEN6_BLITTER_ECOSKPD	0x221d0
Line 738... Line 864...
738
#define   GEN6_BLITTER_LOCK_SHIFT			16
864
#define   GEN6_BLITTER_LOCK_SHIFT			16
739
#define   GEN6_BLITTER_FBC_NOTIFY			(1<<3)
865
#define   GEN6_BLITTER_FBC_NOTIFY			(1<<3)
740
 
866
 
741
#define GEN6_BSD_SLEEP_PSMI_CONTROL	0x12050
867
#define GEN6_BSD_SLEEP_PSMI_CONTROL	0x12050
742
#define   GEN6_BSD_SLEEP_MSG_DISABLE	(1 << 0)
868
#define   GEN6_BSD_SLEEP_MSG_DISABLE	(1 << 0)
Line -... Line 869...
-
 
869
#define   GEN6_BSD_SLEEP_FLUSH_DISABLE	(1 << 2)
-
 
870
#define   GEN6_BSD_SLEEP_INDICATOR	(1 << 3)
-
 
871
#define   GEN6_BSD_GO_INDICATOR		(1 << 4)
-
 
872
 
-
 
873
/* On modern GEN architectures interrupt control consists of two sets
-
 
874
 * of registers. The first set pertains to the ring generating the
-
 
875
 * interrupt. The second control is for the functional block generating the
-
 
876
 * interrupt. These are PM, GT, DE, etc.
-
 
877
 *
-
 
878
 * Luckily *knocks on wood* all the ring interrupt bits match up with the
-
 
879
 * GT interrupt bits, so we don't need to duplicate the defines.
-
 
880
 *
-
 
881
 * These defines should cover us well from SNB->HSW with minor exceptions
-
 
882
 * it can also work on ILK.
-
 
883
 */
-
 
884
#define GT_BLT_FLUSHDW_NOTIFY_INTERRUPT		(1 << 26)
-
 
885
#define GT_BLT_CS_ERROR_INTERRUPT		(1 << 25)
-
 
886
#define GT_BLT_USER_INTERRUPT			(1 << 22)
-
 
887
#define GT_BSD_CS_ERROR_INTERRUPT		(1 << 15)
-
 
888
#define GT_BSD_USER_INTERRUPT			(1 << 12)
-
 
889
#define GT_RENDER_L3_PARITY_ERROR_INTERRUPT	(1 <<  5) /* !snb */
-
 
890
#define GT_RENDER_PIPECTL_NOTIFY_INTERRUPT	(1 <<  4)
-
 
891
#define GT_RENDER_CS_MASTER_ERROR_INTERRUPT	(1 <<  3)
-
 
892
#define GT_RENDER_SYNC_STATUS_INTERRUPT		(1 <<  2)
-
 
893
#define GT_RENDER_DEBUG_INTERRUPT		(1 <<  1)
-
 
894
#define GT_RENDER_USER_INTERRUPT		(1 <<  0)
-
 
895
 
-
 
896
#define PM_VEBOX_CS_ERROR_INTERRUPT		(1 << 12) /* hsw+ */
-
 
897
#define PM_VEBOX_USER_INTERRUPT			(1 << 10) /* hsw+ */
-
 
898
 
-
 
899
/* These are all the "old" interrupts */
-
 
900
#define ILK_BSD_USER_INTERRUPT				(1<<5)
-
 
901
#define I915_PIPE_CONTROL_NOTIFY_INTERRUPT		(1<<18)
-
 
902
#define I915_DISPLAY_PORT_INTERRUPT			(1<<17)
-
 
903
#define I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT	(1<<15)
-
 
904
#define I915_GMCH_THERMAL_SENSOR_EVENT_INTERRUPT	(1<<14) /* p-state */
-
 
905
#define I915_HWB_OOM_INTERRUPT				(1<<13)
-
 
906
#define I915_SYNC_STATUS_INTERRUPT			(1<<12)
-
 
907
#define I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT	(1<<11)
-
 
908
#define I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT	(1<<10)
-
 
909
#define I915_OVERLAY_PLANE_FLIP_PENDING_INTERRUPT	(1<<9)
-
 
910
#define I915_DISPLAY_PLANE_C_FLIP_PENDING_INTERRUPT	(1<<8)
-
 
911
#define I915_DISPLAY_PIPE_A_VBLANK_INTERRUPT		(1<<7)
743
#define   GEN6_BSD_SLEEP_FLUSH_DISABLE	(1 << 2)
912
#define I915_DISPLAY_PIPE_A_EVENT_INTERRUPT		(1<<6)
744
#define   GEN6_BSD_SLEEP_INDICATOR	(1 << 3)
913
#define I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT		(1<<5)
745
#define   GEN6_BSD_GO_INDICATOR		(1 << 4)
914
#define I915_DISPLAY_PIPE_B_EVENT_INTERRUPT		(1<<4)
Line 746... Line 915...
746
 
915
#define I915_DEBUG_INTERRUPT				(1<<2)
Line 747... Line 916...
747
#define GEN6_BSD_HWSTAM			0x12098
916
#define I915_USER_INTERRUPT				(1<<1)
748
#define GEN6_BSD_IMR			0x120a8
917
#define I915_ASLE_INTERRUPT				(1<<0)
Line 805... Line 974...
805
#define DPFC_CB_BASE		0x3200
974
#define DPFC_CB_BASE		0x3200
806
#define DPFC_CONTROL		0x3208
975
#define DPFC_CONTROL		0x3208
807
#define   DPFC_CTL_EN		(1<<31)
976
#define   DPFC_CTL_EN		(1<<31)
808
#define   DPFC_CTL_PLANEA	(0<<30)
977
#define   DPFC_CTL_PLANEA	(0<<30)
809
#define   DPFC_CTL_PLANEB	(1<<30)
978
#define   DPFC_CTL_PLANEB	(1<<30)
-
 
979
#define   IVB_DPFC_CTL_PLANE_SHIFT	(29)
810
#define   DPFC_CTL_FENCE_EN	(1<<29)
980
#define   DPFC_CTL_FENCE_EN	(1<<29)
-
 
981
#define   IVB_DPFC_CTL_FENCE_EN	(1<<28)
811
#define   DPFC_CTL_PERSISTENT_MODE	(1<<25)
982
#define   DPFC_CTL_PERSISTENT_MODE	(1<<25)
812
#define   DPFC_SR_EN		(1<<10)
983
#define   DPFC_SR_EN		(1<<10)
813
#define   DPFC_CTL_LIMIT_1X	(0<<6)
984
#define   DPFC_CTL_LIMIT_1X	(0<<6)
814
#define   DPFC_CTL_LIMIT_2X	(1<<6)
985
#define   DPFC_CTL_LIMIT_2X	(1<<6)
815
#define   DPFC_CTL_LIMIT_4X	(2<<6)
986
#define   DPFC_CTL_LIMIT_4X	(2<<6)
Line 838... Line 1009...
838
#define ILK_DPFC_STATUS		0x43210
1009
#define ILK_DPFC_STATUS		0x43210
839
#define ILK_DPFC_FENCE_YOFF	0x43218
1010
#define ILK_DPFC_FENCE_YOFF	0x43218
840
#define ILK_DPFC_CHICKEN	0x43224
1011
#define ILK_DPFC_CHICKEN	0x43224
841
#define ILK_FBC_RT_BASE		0x2128
1012
#define ILK_FBC_RT_BASE		0x2128
842
#define   ILK_FBC_RT_VALID	(1<<0)
1013
#define   ILK_FBC_RT_VALID	(1<<0)
-
 
1014
#define   SNB_FBC_FRONT_BUFFER	(1<<1)
Line 843... Line 1015...
843
 
1015
 
844
#define ILK_DISPLAY_CHICKEN1	0x42000
1016
#define ILK_DISPLAY_CHICKEN1	0x42000
845
#define   ILK_FBCQ_DIS		(1<<22)
1017
#define   ILK_FBCQ_DIS		(1<<22)
Line 853... Line 1025...
853
 */
1025
 */
854
#define SNB_DPFC_CTL_SA		0x100100
1026
#define SNB_DPFC_CTL_SA		0x100100
855
#define   SNB_CPU_FENCE_ENABLE	(1<<29)
1027
#define   SNB_CPU_FENCE_ENABLE	(1<<29)
856
#define DPFC_CPU_FENCE_OFFSET	0x100104
1028
#define DPFC_CPU_FENCE_OFFSET	0x100104
Line -... Line 1029...
-
 
1029
 
-
 
1030
/* Framebuffer compression for Ivybridge */
-
 
1031
#define IVB_FBC_RT_BASE			0x7020
-
 
1032
 
-
 
1033
#define IPS_CTL		0x43408
-
 
1034
#define   IPS_ENABLE	(1 << 31)
-
 
1035
 
-
 
1036
#define MSG_FBC_REND_STATE	0x50380
-
 
1037
#define   FBC_REND_NUKE		(1<<2)
-
 
1038
#define   FBC_REND_CACHE_CLEAN	(1<<1)
-
 
1039
 
-
 
1040
#define _HSW_PIPE_SLICE_CHICKEN_1_A	0x420B0
-
 
1041
#define _HSW_PIPE_SLICE_CHICKEN_1_B	0x420B4
-
 
1042
#define   HSW_BYPASS_FBC_QUEUE		(1<<22)
-
 
1043
#define HSW_PIPE_SLICE_CHICKEN_1(pipe) _PIPE(pipe, + \
-
 
1044
					     _HSW_PIPE_SLICE_CHICKEN_1_A, + \
-
 
1045
					     _HSW_PIPE_SLICE_CHICKEN_1_B)
-
 
1046
 
-
 
1047
#define HSW_CLKGATE_DISABLE_PART_1	0x46500
Line 857... Line 1048...
857
 
1048
#define   HSW_DPFC_GATING_DISABLE	(1<<23)
858
 
1049
 
859
/*
1050
/*
860
 * GPIO regs
1051
 * GPIO regs
Line 945... Line 1136...
945
#define   VGA1_PD_P1_MASK	(0x1f << 8)
1136
#define   VGA1_PD_P1_MASK	(0x1f << 8)
946
#define _DPLL_A	(dev_priv->info->display_mmio_offset + 0x6014)
1137
#define _DPLL_A	(dev_priv->info->display_mmio_offset + 0x6014)
947
#define _DPLL_B	(dev_priv->info->display_mmio_offset + 0x6018)
1138
#define _DPLL_B	(dev_priv->info->display_mmio_offset + 0x6018)
948
#define DPLL(pipe) _PIPE(pipe, _DPLL_A, _DPLL_B)
1139
#define DPLL(pipe) _PIPE(pipe, _DPLL_A, _DPLL_B)
949
#define   DPLL_VCO_ENABLE		(1 << 31)
1140
#define   DPLL_VCO_ENABLE		(1 << 31)
950
#define   DPLL_DVO_HIGH_SPEED		(1 << 30)
1141
#define   DPLL_SDVO_HIGH_SPEED		(1 << 30)
-
 
1142
#define   DPLL_DVO_2X_MODE		(1 << 30)
951
#define   DPLL_EXT_BUFFER_ENABLE_VLV	(1 << 30)
1143
#define   DPLL_EXT_BUFFER_ENABLE_VLV	(1 << 30)
952
#define   DPLL_SYNCLOCK_ENABLE		(1 << 29)
1144
#define   DPLL_SYNCLOCK_ENABLE		(1 << 29)
953
#define   DPLL_REFA_CLK_ENABLE_VLV	(1 << 29)
1145
#define   DPLL_REFA_CLK_ENABLE_VLV	(1 << 29)
954
#define   DPLL_VGA_MODE_DIS		(1 << 28)
1146
#define   DPLL_VGA_MODE_DIS		(1 << 28)
955
#define   DPLLB_MODE_DAC_SERIAL		(1 << 26) /* i915 */
1147
#define   DPLLB_MODE_DAC_SERIAL		(1 << 26) /* i915 */
Line 961... Line 1153...
961
#define   DPLLB_LVDS_P2_CLOCK_DIV_7	(1 << 24) /* i915 */
1153
#define   DPLLB_LVDS_P2_CLOCK_DIV_7	(1 << 24) /* i915 */
962
#define   DPLL_P2_CLOCK_DIV_MASK	0x03000000 /* i915 */
1154
#define   DPLL_P2_CLOCK_DIV_MASK	0x03000000 /* i915 */
963
#define   DPLL_FPA01_P1_POST_DIV_MASK	0x00ff0000 /* i915 */
1155
#define   DPLL_FPA01_P1_POST_DIV_MASK	0x00ff0000 /* i915 */
964
#define   DPLL_FPA01_P1_POST_DIV_MASK_PINEVIEW	0x00ff8000 /* Pineview */
1156
#define   DPLL_FPA01_P1_POST_DIV_MASK_PINEVIEW	0x00ff8000 /* Pineview */
965
#define   DPLL_LOCK_VLV			(1<<15)
1157
#define   DPLL_LOCK_VLV			(1<<15)
-
 
1158
#define   DPLL_INTEGRATED_CRI_CLK_VLV	(1<<14)
966
#define   DPLL_INTEGRATED_CLOCK_VLV	(1<<13)
1159
#define   DPLL_INTEGRATED_CLOCK_VLV	(1<<13)
-
 
1160
#define   DPLL_PORTC_READY_MASK		(0xf << 4)
-
 
1161
#define   DPLL_PORTB_READY_MASK		(0xf)
Line 967... Line 1162...
967
 
1162
 
968
#define   DPLL_FPA01_P1_POST_DIV_MASK_I830	0x001f0000
1163
#define   DPLL_FPA01_P1_POST_DIV_MASK_I830	0x001f0000
969
/*
1164
/*
970
 * The i830 generation, in LVDS mode, defines P1 as the bit number set within
1165
 * The i830 generation, in LVDS mode, defines P1 as the bit number set within
Line 1071... Line 1266...
1071
#define D_STATE		0x6104
1266
#define D_STATE		0x6104
1072
#define  DSTATE_GFX_RESET_I830			(1<<6)
1267
#define  DSTATE_GFX_RESET_I830			(1<<6)
1073
#define  DSTATE_PLL_D3_OFF			(1<<3)
1268
#define  DSTATE_PLL_D3_OFF			(1<<3)
1074
#define  DSTATE_GFX_CLOCK_GATING		(1<<1)
1269
#define  DSTATE_GFX_CLOCK_GATING		(1<<1)
1075
#define  DSTATE_DOT_CLOCK_GATING		(1<<0)
1270
#define  DSTATE_DOT_CLOCK_GATING		(1<<0)
1076
#define DSPCLK_GATE_D		0x6200
1271
#define DSPCLK_GATE_D	(dev_priv->info->display_mmio_offset + 0x6200)
1077
# define DPUNIT_B_CLOCK_GATE_DISABLE		(1 << 30) /* 965 */
1272
# define DPUNIT_B_CLOCK_GATE_DISABLE		(1 << 30) /* 965 */
1078
# define VSUNIT_CLOCK_GATE_DISABLE		(1 << 29) /* 965 */
1273
# define VSUNIT_CLOCK_GATE_DISABLE		(1 << 29) /* 965 */
1079
# define VRHUNIT_CLOCK_GATE_DISABLE		(1 << 28) /* 965 */
1274
# define VRHUNIT_CLOCK_GATE_DISABLE		(1 << 28) /* 965 */
1080
# define VRDUNIT_CLOCK_GATE_DISABLE		(1 << 27) /* 965 */
1275
# define VRDUNIT_CLOCK_GATE_DISABLE		(1 << 27) /* 965 */
1081
# define AUDUNIT_CLOCK_GATE_DISABLE		(1 << 26) /* 965 */
1276
# define AUDUNIT_CLOCK_GATE_DISABLE		(1 << 26) /* 965 */
Line 1184... Line 1379...
1184
#define DEUC			0x6214          /* CRL only */
1379
#define DEUC			0x6214          /* CRL only */
Line 1185... Line 1380...
1185
 
1380
 
1186
#define FW_BLC_SELF_VLV		(VLV_DISPLAY_BASE + 0x6500)
1381
#define FW_BLC_SELF_VLV		(VLV_DISPLAY_BASE + 0x6500)
Line -... Line 1382...
-
 
1382
#define  FW_CSPWRDWNEN		(1<<15)
-
 
1383
 
1187
#define  FW_CSPWRDWNEN		(1<<15)
1384
#define MI_ARB_VLV		(VLV_DISPLAY_BASE + 0x6504)
1188
 
1385
 
1189
/*
1386
/*
Line 1190... Line 1387...
1190
 * Palette regs
1387
 * Palette regs
Line 1253... Line 1450...
1253
/** snb MCH registers for priority tuning */
1450
/** snb MCH registers for priority tuning */
1254
#define MCH_SSKPD			(MCHBAR_MIRROR_BASE_SNB + 0x5d10)
1451
#define MCH_SSKPD			(MCHBAR_MIRROR_BASE_SNB + 0x5d10)
1255
#define   MCH_SSKPD_WM0_MASK		0x3f
1452
#define   MCH_SSKPD_WM0_MASK		0x3f
1256
#define   MCH_SSKPD_WM0_VAL		0xc
1453
#define   MCH_SSKPD_WM0_VAL		0xc
Line -... Line 1454...
-
 
1454
 
-
 
1455
#define MCH_SECP_NRG_STTS		(MCHBAR_MIRROR_BASE_SNB + 0x592c)
1257
 
1456
 
1258
/* Clocking configuration register */
1457
/* Clocking configuration register */
1259
#define CLKCFG			0x10c00
1458
#define CLKCFG			0x10c00
1260
#define CLKCFG_FSB_400					(5 << 0)	/* hrawclk 100 */
1459
#define CLKCFG_FSB_400					(5 << 0)	/* hrawclk 100 */
1261
#define CLKCFG_FSB_533					(1 << 0)	/* hrawclk 133 */
1460
#define CLKCFG_FSB_533					(1 << 0)	/* hrawclk 133 */
Line 1509... Line 1708...
1509
/*
1708
/*
1510
 * Logical Context regs
1709
 * Logical Context regs
1511
 */
1710
 */
1512
#define CCID			0x2180
1711
#define CCID			0x2180
1513
#define   CCID_EN		(1<<0)
1712
#define   CCID_EN		(1<<0)
-
 
1713
/*
-
 
1714
 * Notes on SNB/IVB/VLV context size:
-
 
1715
 * - Power context is saved elsewhere (LLC or stolen)
-
 
1716
 * - Ring/execlist context is saved on SNB, not on IVB
-
 
1717
 * - Extended context size already includes render context size
-
 
1718
 * - We always need to follow the extended context size.
-
 
1719
 *   SNB BSpec has comments indicating that we should use the
-
 
1720
 *   render context size instead if execlists are disabled, but
-
 
1721
 *   based on empirical testing that's just nonsense.
-
 
1722
 * - Pipelined/VF state is saved on SNB/IVB respectively
-
 
1723
 * - GT1 size just indicates how much of render context
-
 
1724
 *   doesn't need saving on GT1
-
 
1725
 */
1514
#define CXT_SIZE		0x21a0
1726
#define CXT_SIZE		0x21a0
1515
#define GEN6_CXT_POWER_SIZE(cxt_reg)	((cxt_reg >> 24) & 0x3f)
1727
#define GEN6_CXT_POWER_SIZE(cxt_reg)	((cxt_reg >> 24) & 0x3f)
1516
#define GEN6_CXT_RING_SIZE(cxt_reg)	((cxt_reg >> 18) & 0x3f)
1728
#define GEN6_CXT_RING_SIZE(cxt_reg)	((cxt_reg >> 18) & 0x3f)
1517
#define GEN6_CXT_RENDER_SIZE(cxt_reg)	((cxt_reg >> 12) & 0x3f)
1729
#define GEN6_CXT_RENDER_SIZE(cxt_reg)	((cxt_reg >> 12) & 0x3f)
1518
#define GEN6_CXT_EXTENDED_SIZE(cxt_reg)	((cxt_reg >> 6) & 0x3f)
1730
#define GEN6_CXT_EXTENDED_SIZE(cxt_reg)	((cxt_reg >> 6) & 0x3f)
1519
#define GEN6_CXT_PIPELINE_SIZE(cxt_reg)	((cxt_reg >> 0) & 0x3f)
1731
#define GEN6_CXT_PIPELINE_SIZE(cxt_reg)	((cxt_reg >> 0) & 0x3f)
1520
#define GEN6_CXT_TOTAL_SIZE(cxt_reg)	(GEN6_CXT_POWER_SIZE(cxt_reg) + \
1732
#define GEN6_CXT_TOTAL_SIZE(cxt_reg)	(GEN6_CXT_RING_SIZE(cxt_reg) + \
1521
					GEN6_CXT_RING_SIZE(cxt_reg) + \
-
 
1522
					GEN6_CXT_RENDER_SIZE(cxt_reg) + \
-
 
1523
					GEN6_CXT_EXTENDED_SIZE(cxt_reg) + \
1733
					GEN6_CXT_EXTENDED_SIZE(cxt_reg) + \
1524
					GEN6_CXT_PIPELINE_SIZE(cxt_reg))
1734
					GEN6_CXT_PIPELINE_SIZE(cxt_reg))
1525
#define GEN7_CXT_SIZE		0x21a8
1735
#define GEN7_CXT_SIZE		0x21a8
1526
#define GEN7_CXT_POWER_SIZE(ctx_reg)	((ctx_reg >> 25) & 0x7f)
1736
#define GEN7_CXT_POWER_SIZE(ctx_reg)	((ctx_reg >> 25) & 0x7f)
1527
#define GEN7_CXT_RING_SIZE(ctx_reg)	((ctx_reg >> 22) & 0x7)
1737
#define GEN7_CXT_RING_SIZE(ctx_reg)	((ctx_reg >> 22) & 0x7)
1528
#define GEN7_CXT_RENDER_SIZE(ctx_reg)	((ctx_reg >> 16) & 0x3f)
1738
#define GEN7_CXT_RENDER_SIZE(ctx_reg)	((ctx_reg >> 16) & 0x3f)
1529
#define GEN7_CXT_EXTENDED_SIZE(ctx_reg)	((ctx_reg >> 9) & 0x7f)
1739
#define GEN7_CXT_EXTENDED_SIZE(ctx_reg)	((ctx_reg >> 9) & 0x7f)
1530
#define GEN7_CXT_GT1_SIZE(ctx_reg)	((ctx_reg >> 6) & 0x7)
1740
#define GEN7_CXT_GT1_SIZE(ctx_reg)	((ctx_reg >> 6) & 0x7)
1531
#define GEN7_CXT_VFSTATE_SIZE(ctx_reg)	((ctx_reg >> 0) & 0x3f)
1741
#define GEN7_CXT_VFSTATE_SIZE(ctx_reg)	((ctx_reg >> 0) & 0x3f)
1532
#define GEN7_CXT_TOTAL_SIZE(ctx_reg)	(GEN7_CXT_POWER_SIZE(ctx_reg) + \
1742
#define GEN7_CXT_TOTAL_SIZE(ctx_reg)	(GEN7_CXT_EXTENDED_SIZE(ctx_reg) + \
1533
					 GEN7_CXT_RING_SIZE(ctx_reg) + \
-
 
1534
					 GEN7_CXT_RENDER_SIZE(ctx_reg) + \
-
 
1535
					 GEN7_CXT_EXTENDED_SIZE(ctx_reg) + \
-
 
1536
					 GEN7_CXT_GT1_SIZE(ctx_reg) + \
-
 
1537
					 GEN7_CXT_VFSTATE_SIZE(ctx_reg))
1743
					 GEN7_CXT_VFSTATE_SIZE(ctx_reg))
1538
#define HSW_CXT_POWER_SIZE(ctx_reg)	((ctx_reg >> 26) & 0x3f)
1744
/* Haswell does have the CXT_SIZE register however it does not appear to be
1539
#define HSW_CXT_RING_SIZE(ctx_reg)	((ctx_reg >> 23) & 0x7)
1745
 * valid. Now, docs explain in dwords what is in the context object. The full
1540
#define HSW_CXT_RENDER_SIZE(ctx_reg)	((ctx_reg >> 15) & 0xff)
1746
 * size is 70720 bytes, however, the power context and execlist context will
1541
#define HSW_CXT_TOTAL_SIZE(ctx_reg)	(HSW_CXT_POWER_SIZE(ctx_reg) + \
1747
 * never be saved (power context is stored elsewhere, and execlists don't work
1542
					 HSW_CXT_RING_SIZE(ctx_reg) + \
1748
 * on HSW) - so the final size is 66944 bytes, which rounds to 17 pages.
-
 
1749
 */
1543
					 HSW_CXT_RENDER_SIZE(ctx_reg) + \
1750
#define HSW_CXT_TOTAL_SIZE		(17 * PAGE_SIZE)
1544
					 GEN7_CXT_VFSTATE_SIZE(ctx_reg))
-
 
1545
 
-
 
Line 1546... Line 1751...
1546
 
1751
 
1547
/*
1752
/*
1548
 * Overlay regs
1753
 * Overlay regs
Line 1592... Line 1797...
1592
#define VBLANK(trans) _TRANSCODER(trans, _VBLANK_A, _VBLANK_B)
1797
#define VBLANK(trans) _TRANSCODER(trans, _VBLANK_A, _VBLANK_B)
1593
#define VSYNC(trans) _TRANSCODER(trans, _VSYNC_A, _VSYNC_B)
1798
#define VSYNC(trans) _TRANSCODER(trans, _VSYNC_A, _VSYNC_B)
1594
#define BCLRPAT(pipe) _PIPE(pipe, _BCLRPAT_A, _BCLRPAT_B)
1799
#define BCLRPAT(pipe) _PIPE(pipe, _BCLRPAT_A, _BCLRPAT_B)
1595
#define VSYNCSHIFT(trans) _TRANSCODER(trans, _VSYNCSHIFT_A, _VSYNCSHIFT_B)
1800
#define VSYNCSHIFT(trans) _TRANSCODER(trans, _VSYNCSHIFT_A, _VSYNCSHIFT_B)
Line -... Line 1801...
-
 
1801
 
-
 
1802
/* HSW eDP PSR registers */
-
 
1803
#define EDP_PSR_CTL				0x64800
-
 
1804
#define   EDP_PSR_ENABLE			(1<<31)
-
 
1805
#define   EDP_PSR_LINK_DISABLE			(0<<27)
-
 
1806
#define   EDP_PSR_LINK_STANDBY			(1<<27)
-
 
1807
#define   EDP_PSR_MIN_LINK_ENTRY_TIME_MASK	(3<<25)
-
 
1808
#define   EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES	(0<<25)
-
 
1809
#define   EDP_PSR_MIN_LINK_ENTRY_TIME_4_LINES	(1<<25)
-
 
1810
#define   EDP_PSR_MIN_LINK_ENTRY_TIME_2_LINES	(2<<25)
-
 
1811
#define   EDP_PSR_MIN_LINK_ENTRY_TIME_0_LINES	(3<<25)
-
 
1812
#define   EDP_PSR_MAX_SLEEP_TIME_SHIFT		20
-
 
1813
#define   EDP_PSR_SKIP_AUX_EXIT			(1<<12)
-
 
1814
#define   EDP_PSR_TP1_TP2_SEL			(0<<11)
-
 
1815
#define   EDP_PSR_TP1_TP3_SEL			(1<<11)
-
 
1816
#define   EDP_PSR_TP2_TP3_TIME_500us		(0<<8)
-
 
1817
#define   EDP_PSR_TP2_TP3_TIME_100us		(1<<8)
-
 
1818
#define   EDP_PSR_TP2_TP3_TIME_2500us		(2<<8)
-
 
1819
#define   EDP_PSR_TP2_TP3_TIME_0us		(3<<8)
-
 
1820
#define   EDP_PSR_TP1_TIME_500us		(0<<4)
-
 
1821
#define   EDP_PSR_TP1_TIME_100us		(1<<4)
-
 
1822
#define   EDP_PSR_TP1_TIME_2500us		(2<<4)
-
 
1823
#define   EDP_PSR_TP1_TIME_0us			(3<<4)
-
 
1824
#define   EDP_PSR_IDLE_FRAME_SHIFT		0
-
 
1825
 
-
 
1826
#define EDP_PSR_AUX_CTL			0x64810
-
 
1827
#define EDP_PSR_AUX_DATA1		0x64814
-
 
1828
#define   EDP_PSR_DPCD_COMMAND		0x80060000
-
 
1829
#define EDP_PSR_AUX_DATA2		0x64818
-
 
1830
#define   EDP_PSR_DPCD_NORMAL_OPERATION	(1<<24)
-
 
1831
#define EDP_PSR_AUX_DATA3		0x6481c
-
 
1832
#define EDP_PSR_AUX_DATA4		0x64820
-
 
1833
#define EDP_PSR_AUX_DATA5		0x64824
-
 
1834
 
-
 
1835
#define EDP_PSR_STATUS_CTL			0x64840
-
 
1836
#define   EDP_PSR_STATUS_STATE_MASK		(7<<29)
-
 
1837
#define   EDP_PSR_STATUS_STATE_IDLE		(0<<29)
-
 
1838
#define   EDP_PSR_STATUS_STATE_SRDONACK		(1<<29)
-
 
1839
#define   EDP_PSR_STATUS_STATE_SRDENT		(2<<29)
-
 
1840
#define   EDP_PSR_STATUS_STATE_BUFOFF		(3<<29)
-
 
1841
#define   EDP_PSR_STATUS_STATE_BUFON		(4<<29)
-
 
1842
#define   EDP_PSR_STATUS_STATE_AUXACK		(5<<29)
-
 
1843
#define   EDP_PSR_STATUS_STATE_SRDOFFACK	(6<<29)
-
 
1844
#define   EDP_PSR_STATUS_LINK_MASK		(3<<26)
-
 
1845
#define   EDP_PSR_STATUS_LINK_FULL_OFF		(0<<26)
-
 
1846
#define   EDP_PSR_STATUS_LINK_FULL_ON		(1<<26)
-
 
1847
#define   EDP_PSR_STATUS_LINK_STANDBY		(2<<26)
-
 
1848
#define   EDP_PSR_STATUS_MAX_SLEEP_TIMER_SHIFT	20
-
 
1849
#define   EDP_PSR_STATUS_MAX_SLEEP_TIMER_MASK	0x1f
-
 
1850
#define   EDP_PSR_STATUS_COUNT_SHIFT		16
-
 
1851
#define   EDP_PSR_STATUS_COUNT_MASK		0xf
-
 
1852
#define   EDP_PSR_STATUS_AUX_ERROR		(1<<15)
-
 
1853
#define   EDP_PSR_STATUS_AUX_SENDING		(1<<12)
-
 
1854
#define   EDP_PSR_STATUS_SENDING_IDLE		(1<<9)
-
 
1855
#define   EDP_PSR_STATUS_SENDING_TP2_TP3	(1<<8)
-
 
1856
#define   EDP_PSR_STATUS_SENDING_TP1		(1<<4)
-
 
1857
#define   EDP_PSR_STATUS_IDLE_MASK		0xf
-
 
1858
 
-
 
1859
#define EDP_PSR_PERF_CNT		0x64844
-
 
1860
#define   EDP_PSR_PERF_CNT_MASK		0xffffff
-
 
1861
 
-
 
1862
#define EDP_PSR_DEBUG_CTL		0x64860
-
 
1863
#define   EDP_PSR_DEBUG_MASK_LPSP	(1<<27)
-
 
1864
#define   EDP_PSR_DEBUG_MASK_MEMUP	(1<<26)
-
 
1865
#define   EDP_PSR_DEBUG_MASK_HPD	(1<<25)
1596
 
1866
 
1597
/* VGA port control */
1867
/* VGA port control */
1598
#define ADPA			0x61100
1868
#define ADPA			0x61100
1599
#define PCH_ADPA                0xe1100
1869
#define PCH_ADPA                0xe1100
Line 1672... Line 1942...
1672
#define CRT_HOTPLUG_DETECT_DELAY_2G		(1 << 4)
1942
#define CRT_HOTPLUG_DETECT_DELAY_2G		(1 << 4)
1673
#define CRT_HOTPLUG_DETECT_VOLTAGE_325MV	(0 << 2)
1943
#define CRT_HOTPLUG_DETECT_VOLTAGE_325MV	(0 << 2)
1674
#define CRT_HOTPLUG_DETECT_VOLTAGE_475MV	(1 << 2)
1944
#define CRT_HOTPLUG_DETECT_VOLTAGE_475MV	(1 << 2)
Line 1675... Line 1945...
1675
 
1945
 
-
 
1946
#define PORT_HOTPLUG_STAT	(dev_priv->info->display_mmio_offset + 0x61114)
1676
#define PORT_HOTPLUG_STAT	(dev_priv->info->display_mmio_offset + 0x61114)
1947
/*
-
 
1948
 * HDMI/DP bits are gen4+
-
 
1949
 *
-
 
1950
 * WARNING: Bspec for hpd status bits on gen4 seems to be completely confused.
-
 
1951
 * Please check the detailed lore in the commit message for for experimental
-
 
1952
 * evidence.
1677
/* HDMI/DP bits are gen4+ */
1953
 */
1678
#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 29)
1954
#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
1679
#define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
1955
#define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
1680
#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 27)
1956
#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
1681
#define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
1957
#define   PORTD_HOTPLUG_INT_STATUS		(3 << 21)
1682
#define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
1958
#define   PORTC_HOTPLUG_INT_STATUS		(3 << 19)
1683
#define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
1959
#define   PORTB_HOTPLUG_INT_STATUS		(3 << 17)
1684
/* CRT/TV common between gen3+ */
1960
/* CRT/TV common between gen3+ */
Line 1689... Line 1965...
1689
#define   CRT_HOTPLUG_MONITOR_MONO		(2 << 8)
1965
#define   CRT_HOTPLUG_MONITOR_MONO		(2 << 8)
1690
#define   CRT_HOTPLUG_MONITOR_NONE		(0 << 8)
1966
#define   CRT_HOTPLUG_MONITOR_NONE		(0 << 8)
1691
/* SDVO is different across gen3/4 */
1967
/* SDVO is different across gen3/4 */
1692
#define   SDVOC_HOTPLUG_INT_STATUS_G4X		(1 << 3)
1968
#define   SDVOC_HOTPLUG_INT_STATUS_G4X		(1 << 3)
1693
#define   SDVOB_HOTPLUG_INT_STATUS_G4X		(1 << 2)
1969
#define   SDVOB_HOTPLUG_INT_STATUS_G4X		(1 << 2)
-
 
1970
/*
-
 
1971
 * Bspec seems to be seriously misleaded about the SDVO hpd bits on i965g/gm,
-
 
1972
 * since reality corrobates that they're the same as on gen3. But keep these
-
 
1973
 * bits here (and the comment!) to help any other lost wanderers back onto the
-
 
1974
 * right tracks.
-
 
1975
 */
1694
#define   SDVOC_HOTPLUG_INT_STATUS_I965		(3 << 4)
1976
#define   SDVOC_HOTPLUG_INT_STATUS_I965		(3 << 4)
1695
#define   SDVOB_HOTPLUG_INT_STATUS_I965		(3 << 2)
1977
#define   SDVOB_HOTPLUG_INT_STATUS_I965		(3 << 2)
1696
#define   SDVOC_HOTPLUG_INT_STATUS_I915		(1 << 7)
1978
#define   SDVOC_HOTPLUG_INT_STATUS_I915		(1 << 7)
1697
#define   SDVOB_HOTPLUG_INT_STATUS_I915		(1 << 6)
1979
#define   SDVOB_HOTPLUG_INT_STATUS_I915		(1 << 6)
1698
#define   HOTPLUG_INT_STATUS_G4X		(CRT_HOTPLUG_INT_STATUS | \
1980
#define   HOTPLUG_INT_STATUS_G4X		(CRT_HOTPLUG_INT_STATUS | \
Line 1700... Line 1982...
1700
						 SDVOC_HOTPLUG_INT_STATUS_G4X | \
1982
						 SDVOC_HOTPLUG_INT_STATUS_G4X | \
1701
						 PORTB_HOTPLUG_INT_STATUS | \
1983
						 PORTB_HOTPLUG_INT_STATUS | \
1702
						 PORTC_HOTPLUG_INT_STATUS | \
1984
						 PORTC_HOTPLUG_INT_STATUS | \
1703
						 PORTD_HOTPLUG_INT_STATUS)
1985
						 PORTD_HOTPLUG_INT_STATUS)
Line 1704... Line -...
1704
 
-
 
1705
#define HOTPLUG_INT_STATUS_I965			(CRT_HOTPLUG_INT_STATUS | \
-
 
1706
						 SDVOB_HOTPLUG_INT_STATUS_I965 | \
-
 
1707
						 SDVOC_HOTPLUG_INT_STATUS_I965 | \
-
 
1708
						 PORTB_HOTPLUG_INT_STATUS | \
-
 
1709
						 PORTC_HOTPLUG_INT_STATUS | \
-
 
1710
						 PORTD_HOTPLUG_INT_STATUS)
-
 
1711
 
1986
 
1712
#define HOTPLUG_INT_STATUS_I915			(CRT_HOTPLUG_INT_STATUS | \
1987
#define HOTPLUG_INT_STATUS_I915			(CRT_HOTPLUG_INT_STATUS | \
1713
						 SDVOB_HOTPLUG_INT_STATUS_I915 | \
1988
						 SDVOB_HOTPLUG_INT_STATUS_I915 | \
1714
						 SDVOC_HOTPLUG_INT_STATUS_I915 | \
1989
						 SDVOC_HOTPLUG_INT_STATUS_I915 | \
1715
						 PORTB_HOTPLUG_INT_STATUS | \
1990
						 PORTB_HOTPLUG_INT_STATUS | \
Line 1862... Line 2137...
1862
#define VIDEO_DIP_DATA		0x61178
2137
#define VIDEO_DIP_DATA		0x61178
1863
/* Read the description of VIDEO_DIP_DATA (before Haswel) or VIDEO_DIP_ECC
2138
/* Read the description of VIDEO_DIP_DATA (before Haswel) or VIDEO_DIP_ECC
1864
 * (Haswell and newer) to see which VIDEO_DIP_DATA byte corresponds to each byte
2139
 * (Haswell and newer) to see which VIDEO_DIP_DATA byte corresponds to each byte
1865
 * of the infoframe structure specified by CEA-861. */
2140
 * of the infoframe structure specified by CEA-861. */
1866
#define   VIDEO_DIP_DATA_SIZE	32
2141
#define   VIDEO_DIP_DATA_SIZE	32
-
 
2142
#define   VIDEO_DIP_VSC_DATA_SIZE	36
1867
#define VIDEO_DIP_CTL		0x61170
2143
#define VIDEO_DIP_CTL		0x61170
1868
/* Pre HSW: */
2144
/* Pre HSW: */
1869
#define   VIDEO_DIP_ENABLE		(1 << 31)
2145
#define   VIDEO_DIP_ENABLE		(1 << 31)
1870
#define   VIDEO_DIP_PORT_B		(1 << 29)
2146
#define   VIDEO_DIP_PORT_B		(1 << 29)
1871
#define   VIDEO_DIP_PORT_C		(2 << 29)
2147
#define   VIDEO_DIP_PORT_C		(2 << 29)
Line 1965... Line 2241...
1965
#define   BLM_PIPE_SELECT		(1 << 29)
2241
#define   BLM_PIPE_SELECT		(1 << 29)
1966
#define   BLM_PIPE_SELECT_IVB		(3 << 29)
2242
#define   BLM_PIPE_SELECT_IVB		(3 << 29)
1967
#define   BLM_PIPE_A			(0 << 29)
2243
#define   BLM_PIPE_A			(0 << 29)
1968
#define   BLM_PIPE_B			(1 << 29)
2244
#define   BLM_PIPE_B			(1 << 29)
1969
#define   BLM_PIPE_C			(2 << 29) /* ivb + */
2245
#define   BLM_PIPE_C			(2 << 29) /* ivb + */
-
 
2246
#define   BLM_TRANSCODER_A		BLM_PIPE_A /* hsw */
-
 
2247
#define   BLM_TRANSCODER_B		BLM_PIPE_B
-
 
2248
#define   BLM_TRANSCODER_C		BLM_PIPE_C
-
 
2249
#define   BLM_TRANSCODER_EDP		(3 << 29)
1970
#define   BLM_PIPE(pipe)		((pipe) << 29)
2250
#define   BLM_PIPE(pipe)		((pipe) << 29)
1971
#define   BLM_POLARITY_I965		(1 << 28) /* gen4 only */
2251
#define   BLM_POLARITY_I965		(1 << 28) /* gen4 only */
1972
#define   BLM_PHASE_IN_INTERUPT_STATUS	(1 << 26)
2252
#define   BLM_PHASE_IN_INTERUPT_STATUS	(1 << 26)
1973
#define   BLM_PHASE_IN_ENABLE		(1 << 25)
2253
#define   BLM_PHASE_IN_ENABLE		(1 << 25)
1974
#define   BLM_PHASE_IN_INTERUPT_ENABL	(1 << 24)
2254
#define   BLM_PHASE_IN_INTERUPT_ENABL	(1 << 24)
Line 2005... Line 2285...
2005
/* New registers for PCH-split platforms. Safe where new bits show up, the
2285
/* New registers for PCH-split platforms. Safe where new bits show up, the
2006
 * register layout machtes with gen4 BLC_PWM_CTL[12]. */
2286
 * register layout machtes with gen4 BLC_PWM_CTL[12]. */
2007
#define BLC_PWM_CPU_CTL2	0x48250
2287
#define BLC_PWM_CPU_CTL2	0x48250
2008
#define BLC_PWM_CPU_CTL		0x48254
2288
#define BLC_PWM_CPU_CTL		0x48254
Line -... Line 2289...
-
 
2289
 
-
 
2290
#define HSW_BLC_PWM2_CTL	0x48350
2009
 
2291
 
2010
/* PCH CTL1 is totally different, all but the below bits are reserved. CTL2 is
2292
/* PCH CTL1 is totally different, all but the below bits are reserved. CTL2 is
2011
 * like the normal CTL from gen4 and earlier. Hooray for confusing naming. */
2293
 * like the normal CTL from gen4 and earlier. Hooray for confusing naming. */
2012
#define BLC_PWM_PCH_CTL1	0xc8250
2294
#define BLC_PWM_PCH_CTL1	0xc8250
2013
#define   BLM_PCH_PWM_ENABLE			(1 << 31)
2295
#define   BLM_PCH_PWM_ENABLE			(1 << 31)
2014
#define   BLM_PCH_OVERRIDE_ENABLE		(1 << 30)
2296
#define   BLM_PCH_OVERRIDE_ENABLE		(1 << 30)
2015
#define   BLM_PCH_POLARITY			(1 << 29)
2297
#define   BLM_PCH_POLARITY			(1 << 29)
Line -... Line 2298...
-
 
2298
#define BLC_PWM_PCH_CTL2	0xc8254
-
 
2299
 
-
 
2300
#define UTIL_PIN_CTL		0x48400
-
 
2301
#define   UTIL_PIN_ENABLE	(1 << 31)
-
 
2302
 
-
 
2303
#define PCH_GTC_CTL		0xe7000
2016
#define BLC_PWM_PCH_CTL2	0xc8254
2304
#define   PCH_GTC_ENABLE	(1 << 31)
2017
 
2305
 
2018
/* TV port control */
2306
/* TV port control */
2019
#define TV_CTL			0x68000
2307
#define TV_CTL			0x68000
2020
/** Enables the TV encoder */
2308
/** Enables the TV encoder */
Line 2538... Line 2826...
2538
#define   DP_PRE_EMPHASIS_9_5		(3 << 22)
2826
#define   DP_PRE_EMPHASIS_9_5		(3 << 22)
2539
#define   DP_PRE_EMPHASIS_MASK		(7 << 22)
2827
#define   DP_PRE_EMPHASIS_MASK		(7 << 22)
2540
#define   DP_PRE_EMPHASIS_SHIFT		22
2828
#define   DP_PRE_EMPHASIS_SHIFT		22
Line 2541... Line 2829...
2541
 
2829
 
2542
/* How many wires to use. I guess 3 was too hard */
-
 
2543
#define   DP_PORT_WIDTH_1		(0 << 19)
2830
/* How many wires to use. I guess 3 was too hard */
2544
#define   DP_PORT_WIDTH_2		(1 << 19)
-
 
2545
#define   DP_PORT_WIDTH_4		(3 << 19)
2831
#define   DP_PORT_WIDTH(width)		(((width) - 1) << 19)
Line 2546... Line 2832...
2546
#define   DP_PORT_WIDTH_MASK		(7 << 19)
2832
#define   DP_PORT_WIDTH_MASK		(7 << 19)
2547
 
2833
 
Line 2644... Line 2930...
2644
 *
2930
 *
2645
 * bytes_per_pixel is the number of bytes coming out of the plane,
2931
 * bytes_per_pixel is the number of bytes coming out of the plane,
2646
 * which is after the LUTs, so we want the bytes for our color format.
2932
 * which is after the LUTs, so we want the bytes for our color format.
2647
 * For our current usage, this is always 3, one byte for R, G and B.
2933
 * For our current usage, this is always 3, one byte for R, G and B.
2648
 */
2934
 */
2649
#define _PIPEA_GMCH_DATA_M			0x70050
2935
#define _PIPEA_DATA_M_G4X	0x70050
2650
#define _PIPEB_GMCH_DATA_M			0x71050
2936
#define _PIPEB_DATA_M_G4X	0x71050
Line 2651... Line 2937...
2651
 
2937
 
2652
/* Transfer unit size for display port - 1, default is 0x3f (for TU size 64) */
2938
/* Transfer unit size for display port - 1, default is 0x3f (for TU size 64) */
-
 
2939
#define  TU_SIZE(x)             (((x)-1) << 25) /* default size 64 */
2653
#define  TU_SIZE(x)             (((x)-1) << 25) /* default size 64 */
2940
#define  TU_SIZE_SHIFT		25
Line 2654... Line 2941...
2654
#define  TU_SIZE_MASK           (0x3f << 25)
2941
#define  TU_SIZE_MASK           (0x3f << 25)
2655
 
2942
 
Line 2656... Line 2943...
2656
#define  DATA_LINK_M_N_MASK	(0xffffff)
2943
#define  DATA_LINK_M_N_MASK	(0xffffff)
2657
#define  DATA_LINK_N_MAX	(0x800000)
2944
#define  DATA_LINK_N_MAX	(0x800000)
-
 
2945
 
Line 2658... Line 2946...
2658
 
2946
#define _PIPEA_DATA_N_G4X	0x70054
2659
#define _PIPEA_GMCH_DATA_N			0x70054
2947
#define _PIPEB_DATA_N_G4X	0x71054
2660
#define _PIPEB_GMCH_DATA_N			0x71054
2948
#define   PIPE_GMCH_DATA_N_MASK			(0xffffff)
2661
 
2949
 
Line 2668... Line 2956...
2668
 *
2956
 *
2669
 * The Link value is transmitted in the Main Stream
2957
 * The Link value is transmitted in the Main Stream
2670
 * Attributes and VB-ID.
2958
 * Attributes and VB-ID.
2671
 */
2959
 */
Line 2672... Line 2960...
2672
 
2960
 
2673
#define _PIPEA_DP_LINK_M				0x70060
2961
#define _PIPEA_LINK_M_G4X	0x70060
-
 
2962
#define _PIPEB_LINK_M_G4X	0x71060
2674
#define _PIPEB_DP_LINK_M				0x71060
2963
#define   PIPEA_DP_LINK_M_MASK			(0xffffff)
2675
 
2964
 
2676
#define _PIPEA_DP_LINK_N				0x70064
2965
#define _PIPEA_LINK_N_G4X	0x70064
-
 
2966
#define _PIPEB_LINK_N_G4X	0x71064
2677
#define _PIPEB_DP_LINK_N				0x71064
2967
#define   PIPEA_DP_LINK_N_MASK			(0xffffff)
2678
 
2968
 
2679
#define PIPE_GMCH_DATA_M(pipe) _PIPE(pipe, _PIPEA_GMCH_DATA_M, _PIPEB_GMCH_DATA_M)
2969
#define PIPE_DATA_M_G4X(pipe) _PIPE(pipe, _PIPEA_DATA_M_G4X, _PIPEB_DATA_M_G4X)
2680
#define PIPE_GMCH_DATA_N(pipe) _PIPE(pipe, _PIPEA_GMCH_DATA_N, _PIPEB_GMCH_DATA_N)
2970
#define PIPE_DATA_N_G4X(pipe) _PIPE(pipe, _PIPEA_DATA_N_G4X, _PIPEB_DATA_N_G4X)
2681
#define PIPE_DP_LINK_M(pipe) _PIPE(pipe, _PIPEA_DP_LINK_M, _PIPEB_DP_LINK_M)
2971
#define PIPE_LINK_M_G4X(pipe) _PIPE(pipe, _PIPEA_LINK_M_G4X, _PIPEB_LINK_M_G4X)
Line 2682... Line 2972...
2682
#define PIPE_DP_LINK_N(pipe) _PIPE(pipe, _PIPEA_DP_LINK_N, _PIPEB_DP_LINK_N)
2972
#define PIPE_LINK_N_G4X(pipe) _PIPE(pipe, _PIPEA_LINK_N_G4X, _PIPEB_LINK_N_G4X)
Line 2683... Line 2973...
2683
 
2973
 
2684
/* Display & cursor control */
2974
/* Display & cursor control */
Line 2713... Line 3003...
2713
 * saving pixel doubling. */
3003
 * saving pixel doubling. */
2714
#define   PIPECONF_PFIT_PF_INTERLACED_ILK	(1 << 21)
3004
#define   PIPECONF_PFIT_PF_INTERLACED_ILK	(1 << 21)
2715
#define   PIPECONF_INTERLACED_ILK		(3 << 21)
3005
#define   PIPECONF_INTERLACED_ILK		(3 << 21)
2716
#define   PIPECONF_INTERLACED_DBL_ILK		(4 << 21) /* ilk/snb only */
3006
#define   PIPECONF_INTERLACED_DBL_ILK		(4 << 21) /* ilk/snb only */
2717
#define   PIPECONF_PFIT_PF_INTERLACED_DBL_ILK	(5 << 21) /* ilk/snb only */
3007
#define   PIPECONF_PFIT_PF_INTERLACED_DBL_ILK	(5 << 21) /* ilk/snb only */
-
 
3008
#define   PIPECONF_INTERLACE_MODE_MASK		(7 << 21)
2718
#define   PIPECONF_CXSR_DOWNCLOCK	(1<<16)
3009
#define   PIPECONF_CXSR_DOWNCLOCK	(1<<16)
2719
#define   PIPECONF_COLOR_RANGE_SELECT	(1 << 13)
3010
#define   PIPECONF_COLOR_RANGE_SELECT	(1 << 13)
2720
#define   PIPECONF_BPC_MASK	(0x7 << 5)
3011
#define   PIPECONF_BPC_MASK	(0x7 << 5)
2721
#define   PIPECONF_8BPC		(0<<5)
3012
#define   PIPECONF_8BPC		(0<<5)
2722
#define   PIPECONF_10BPC	(1<<5)
3013
#define   PIPECONF_10BPC	(1<<5)
Line 2913... Line 3204...
2913
#define WM1S_LP_ILK		0x45120
3204
#define WM1S_LP_ILK		0x45120
2914
#define WM2S_LP_IVB		0x45124
3205
#define WM2S_LP_IVB		0x45124
2915
#define WM3S_LP_IVB		0x45128
3206
#define WM3S_LP_IVB		0x45128
2916
#define  WM1S_LP_EN		(1<<31)
3207
#define  WM1S_LP_EN		(1<<31)
Line -... Line 3208...
-
 
3208
 
-
 
3209
#define HSW_WM_LP_VAL(lat, fbc, pri, cur) \
-
 
3210
	(WM3_LP_EN | ((lat) << WM1_LP_LATENCY_SHIFT) | \
-
 
3211
	 ((fbc) << WM1_LP_FBC_SHIFT) | ((pri) << WM1_LP_SR_SHIFT) | (cur))
2917
 
3212
 
2918
/* Memory latency timer register */
3213
/* Memory latency timer register */
2919
#define MLTR_ILK		0x11222
3214
#define MLTR_ILK		0x11222
2920
#define  MLTR_WM1_SHIFT		0
3215
#define  MLTR_WM1_SHIFT		0
2921
#define  MLTR_WM2_SHIFT		8
3216
#define  MLTR_WM2_SHIFT		8
2922
/* the unit of memory self-refresh latency time is 0.5us */
3217
/* the unit of memory self-refresh latency time is 0.5us */
2923
#define  ILK_SRLT_MASK		0x3f
-
 
2924
#define ILK_LATENCY(shift)	(I915_READ(MLTR_ILK) >> (shift) & ILK_SRLT_MASK)
-
 
2925
#define ILK_READ_WM1_LATENCY()	ILK_LATENCY(MLTR_WM1_SHIFT)
-
 
Line 2926... Line 3218...
2926
#define ILK_READ_WM2_LATENCY()	ILK_LATENCY(MLTR_WM2_SHIFT)
3218
#define  ILK_SRLT_MASK		0x3f
2927
 
3219
 
2928
/* define the fifo size on Ironlake */
3220
/* define the fifo size on Ironlake */
2929
#define ILK_DISPLAY_FIFO	128
3221
#define ILK_DISPLAY_FIFO	128
Line 2968... Line 3260...
2968
#define SSKPD_WM0_SHIFT		0
3260
#define SSKPD_WM0_SHIFT		0
2969
#define SSKPD_WM1_SHIFT		8
3261
#define SSKPD_WM1_SHIFT		8
2970
#define SSKPD_WM2_SHIFT		16
3262
#define SSKPD_WM2_SHIFT		16
2971
#define SSKPD_WM3_SHIFT		24
3263
#define SSKPD_WM3_SHIFT		24
Line 2972... Line -...
2972
 
-
 
2973
#define SNB_LATENCY(shift)	(I915_READ(MCHBAR_MIRROR_BASE_SNB + SSKPD) >> (shift) & SSKPD_WM_MASK)
-
 
2974
#define SNB_READ_WM0_LATENCY()		SNB_LATENCY(SSKPD_WM0_SHIFT)
-
 
2975
#define SNB_READ_WM1_LATENCY()		SNB_LATENCY(SSKPD_WM1_SHIFT)
-
 
2976
#define SNB_READ_WM2_LATENCY()		SNB_LATENCY(SSKPD_WM2_SHIFT)
-
 
2977
#define SNB_READ_WM3_LATENCY()		SNB_LATENCY(SSKPD_WM3_SHIFT)
-
 
2978
 
3264
 
2979
/*
3265
/*
2980
 * The two pipe frame counter registers are not synchronized, so
3266
 * The two pipe frame counter registers are not synchronized, so
2981
 * reading a stable value is somewhat tricky. The following code
3267
 * reading a stable value is somewhat tricky. The following code
2982
 * should work:
3268
 * should work:
Line 3025... Line 3311...
3025
#define   CURSOR_MODE_64_ARGB_AX ((1 << 5) | CURSOR_MODE_64_32B_AX)
3311
#define   CURSOR_MODE_64_ARGB_AX ((1 << 5) | CURSOR_MODE_64_32B_AX)
3026
#define   MCURSOR_PIPE_SELECT	(1 << 28)
3312
#define   MCURSOR_PIPE_SELECT	(1 << 28)
3027
#define   MCURSOR_PIPE_A	0x00
3313
#define   MCURSOR_PIPE_A	0x00
3028
#define   MCURSOR_PIPE_B	(1 << 28)
3314
#define   MCURSOR_PIPE_B	(1 << 28)
3029
#define   MCURSOR_GAMMA_ENABLE  (1 << 26)
3315
#define   MCURSOR_GAMMA_ENABLE  (1 << 26)
-
 
3316
#define   CURSOR_TRICKLE_FEED_DISABLE	(1 << 14)
3030
#define _CURABASE		(dev_priv->info->display_mmio_offset + 0x70084)
3317
#define _CURABASE		(dev_priv->info->display_mmio_offset + 0x70084)
3031
#define _CURAPOS		(dev_priv->info->display_mmio_offset + 0x70088)
3318
#define _CURAPOS		(dev_priv->info->display_mmio_offset + 0x70088)
3032
#define   CURSOR_POS_MASK       0x007FF
3319
#define   CURSOR_POS_MASK       0x007FF
3033
#define   CURSOR_POS_SIGN       0x8000
3320
#define   CURSOR_POS_SIGN       0x8000
3034
#define   CURSOR_X_SHIFT        0
3321
#define   CURSOR_X_SHIFT        0
Line 3292... Line 3579...
3292
#define SPROFFSET(pipe) _PIPE(pipe, _SPRA_OFFSET, _SPRB_OFFSET)
3579
#define SPROFFSET(pipe) _PIPE(pipe, _SPRA_OFFSET, _SPRB_OFFSET)
3293
#define SPRSCALE(pipe) _PIPE(pipe, _SPRA_SCALE, _SPRB_SCALE)
3580
#define SPRSCALE(pipe) _PIPE(pipe, _SPRA_SCALE, _SPRB_SCALE)
3294
#define SPRGAMC(pipe) _PIPE(pipe, _SPRA_GAMC, _SPRB_GAMC)
3581
#define SPRGAMC(pipe) _PIPE(pipe, _SPRA_GAMC, _SPRB_GAMC)
3295
#define SPRSURFLIVE(pipe) _PIPE(pipe, _SPRA_SURFLIVE, _SPRB_SURFLIVE)
3582
#define SPRSURFLIVE(pipe) _PIPE(pipe, _SPRA_SURFLIVE, _SPRB_SURFLIVE)
Line 3296... Line 3583...
3296
 
3583
 
3297
#define _SPACNTR		0x72180
3584
#define _SPACNTR		(VLV_DISPLAY_BASE + 0x72180)
3298
#define   SP_ENABLE			(1<<31)
3585
#define   SP_ENABLE			(1<<31)
3299
#define   SP_GEAMMA_ENABLE		(1<<30)
3586
#define   SP_GEAMMA_ENABLE		(1<<30)
3300
#define   SP_PIXFORMAT_MASK		(0xf<<26)
3587
#define   SP_PIXFORMAT_MASK		(0xf<<26)
3301
#define   SP_FORMAT_YUV422		(0<<26)
3588
#define   SP_FORMAT_YUV422		(0<<26)
Line 3311... Line 3598...
3311
#define   SP_YUV_ORDER_YUYV		(0<<16)
3598
#define   SP_YUV_ORDER_YUYV		(0<<16)
3312
#define   SP_YUV_ORDER_UYVY		(1<<16)
3599
#define   SP_YUV_ORDER_UYVY		(1<<16)
3313
#define   SP_YUV_ORDER_YVYU		(2<<16)
3600
#define   SP_YUV_ORDER_YVYU		(2<<16)
3314
#define   SP_YUV_ORDER_VYUY		(3<<16)
3601
#define   SP_YUV_ORDER_VYUY		(3<<16)
3315
#define   SP_TILED			(1<<10)
3602
#define   SP_TILED			(1<<10)
3316
#define _SPALINOFF		0x72184
3603
#define _SPALINOFF		(VLV_DISPLAY_BASE + 0x72184)
3317
#define _SPASTRIDE		0x72188
3604
#define _SPASTRIDE		(VLV_DISPLAY_BASE + 0x72188)
3318
#define _SPAPOS			0x7218c
3605
#define _SPAPOS			(VLV_DISPLAY_BASE + 0x7218c)
3319
#define _SPASIZE		0x72190
3606
#define _SPASIZE		(VLV_DISPLAY_BASE + 0x72190)
3320
#define _SPAKEYMINVAL		0x72194
3607
#define _SPAKEYMINVAL		(VLV_DISPLAY_BASE + 0x72194)
3321
#define _SPAKEYMSK		0x72198
3608
#define _SPAKEYMSK		(VLV_DISPLAY_BASE + 0x72198)
3322
#define _SPASURF		0x7219c
3609
#define _SPASURF		(VLV_DISPLAY_BASE + 0x7219c)
3323
#define _SPAKEYMAXVAL		0x721a0
3610
#define _SPAKEYMAXVAL		(VLV_DISPLAY_BASE + 0x721a0)
3324
#define _SPATILEOFF		0x721a4
3611
#define _SPATILEOFF		(VLV_DISPLAY_BASE + 0x721a4)
3325
#define _SPACONSTALPHA		0x721a8
3612
#define _SPACONSTALPHA		(VLV_DISPLAY_BASE + 0x721a8)
3326
#define _SPAGAMC		0x721f4
3613
#define _SPAGAMC		(VLV_DISPLAY_BASE + 0x721f4)
3327
 
3614
 
3328
#define _SPBCNTR		0x72280
3615
#define _SPBCNTR		(VLV_DISPLAY_BASE + 0x72280)
3329
#define _SPBLINOFF		0x72284
3616
#define _SPBLINOFF		(VLV_DISPLAY_BASE + 0x72284)
3330
#define _SPBSTRIDE		0x72288
3617
#define _SPBSTRIDE		(VLV_DISPLAY_BASE + 0x72288)
3331
#define _SPBPOS			0x7228c
3618
#define _SPBPOS			(VLV_DISPLAY_BASE + 0x7228c)
3332
#define _SPBSIZE		0x72290
3619
#define _SPBSIZE		(VLV_DISPLAY_BASE + 0x72290)
3333
#define _SPBKEYMINVAL		0x72294
3620
#define _SPBKEYMINVAL		(VLV_DISPLAY_BASE + 0x72294)
3334
#define _SPBKEYMSK		0x72298
3621
#define _SPBKEYMSK		(VLV_DISPLAY_BASE + 0x72298)
3335
#define _SPBSURF		0x7229c
3622
#define _SPBSURF		(VLV_DISPLAY_BASE + 0x7229c)
3336
#define _SPBKEYMAXVAL		0x722a0
3623
#define _SPBKEYMAXVAL		(VLV_DISPLAY_BASE + 0x722a0)
3337
#define _SPBTILEOFF		0x722a4
3624
#define _SPBTILEOFF		(VLV_DISPLAY_BASE + 0x722a4)
3338
#define _SPBCONSTALPHA		0x722a8
3625
#define _SPBCONSTALPHA		(VLV_DISPLAY_BASE + 0x722a8)
3339
#define _SPBGAMC		0x722f4
3626
#define _SPBGAMC		(VLV_DISPLAY_BASE + 0x722f4)
Line 3340... Line 3627...
3340
 
3627
 
3341
#define SPCNTR(pipe, plane) _PIPE(pipe * 2 + plane, _SPACNTR, _SPBCNTR)
3628
#define SPCNTR(pipe, plane) _PIPE(pipe * 2 + plane, _SPACNTR, _SPBCNTR)
3342
#define SPLINOFF(pipe, plane) _PIPE(pipe * 2 + plane, _SPALINOFF, _SPBLINOFF)
3629
#define SPLINOFF(pipe, plane) _PIPE(pipe * 2 + plane, _SPALINOFF, _SPBLINOFF)
3343
#define SPSTRIDE(pipe, plane) _PIPE(pipe * 2 + plane, _SPASTRIDE, _SPBSTRIDE)
3630
#define SPSTRIDE(pipe, plane) _PIPE(pipe * 2 + plane, _SPASTRIDE, _SPBSTRIDE)
Line 3472... Line 3759...
3472
/* legacy palette */
3759
/* legacy palette */
3473
#define _LGC_PALETTE_A           0x4a000
3760
#define _LGC_PALETTE_A           0x4a000
3474
#define _LGC_PALETTE_B           0x4a800
3761
#define _LGC_PALETTE_B           0x4a800
3475
#define LGC_PALETTE(pipe) _PIPE(pipe, _LGC_PALETTE_A, _LGC_PALETTE_B)
3762
#define LGC_PALETTE(pipe) _PIPE(pipe, _LGC_PALETTE_A, _LGC_PALETTE_B)
Line -... Line 3763...
-
 
3763
 
-
 
3764
#define _GAMMA_MODE_A		0x4a480
-
 
3765
#define _GAMMA_MODE_B		0x4ac80
-
 
3766
#define GAMMA_MODE(pipe) _PIPE(pipe, _GAMMA_MODE_A, _GAMMA_MODE_B)
-
 
3767
#define GAMMA_MODE_MODE_MASK	(3 << 0)
-
 
3768
#define GAMMA_MODE_MODE_8BIT	(0 << 0)
-
 
3769
#define GAMMA_MODE_MODE_10BIT	(1 << 0)
-
 
3770
#define GAMMA_MODE_MODE_12BIT	(2 << 0)
-
 
3771
#define GAMMA_MODE_MODE_SPLIT	(3 << 0)
3476
 
3772
 
3477
/* interrupts */
3773
/* interrupts */
3478
#define DE_MASTER_IRQ_CONTROL   (1 << 31)
3774
#define DE_MASTER_IRQ_CONTROL   (1 << 31)
3479
#define DE_SPRITEB_FLIP_DONE    (1 << 29)
3775
#define DE_SPRITEB_FLIP_DONE    (1 << 29)
3480
#define DE_SPRITEA_FLIP_DONE    (1 << 28)
3776
#define DE_SPRITEA_FLIP_DONE    (1 << 28)
Line 3500... Line 3796...
3500
#define DE_PIPEA_LINE_COMPARE   (1 << 4)
3796
#define DE_PIPEA_LINE_COMPARE   (1 << 4)
3501
#define DE_PIPEA_VSYNC          (1 << 3)
3797
#define DE_PIPEA_VSYNC          (1 << 3)
3502
#define DE_PIPEA_FIFO_UNDERRUN  (1 << 0)
3798
#define DE_PIPEA_FIFO_UNDERRUN  (1 << 0)
Line 3503... Line 3799...
3503
 
3799
 
3504
/* More Ivybridge lolz */
3800
/* More Ivybridge lolz */
3505
#define DE_ERR_DEBUG_IVB		(1<<30)
3801
#define DE_ERR_INT_IVB			(1<<30)
3506
#define DE_GSE_IVB			(1<<29)
3802
#define DE_GSE_IVB			(1<<29)
3507
#define DE_PCH_EVENT_IVB		(1<<28)
3803
#define DE_PCH_EVENT_IVB		(1<<28)
3508
#define DE_DP_A_HOTPLUG_IVB		(1<<27)
3804
#define DE_DP_A_HOTPLUG_IVB		(1<<27)
3509
#define DE_AUX_CHANNEL_A_IVB		(1<<26)
3805
#define DE_AUX_CHANNEL_A_IVB		(1<<26)
Line 3515... Line 3811...
3515
#define DE_PIPEB_VBLANK_IVB		(1<<5)
3811
#define DE_PIPEB_VBLANK_IVB		(1<<5)
3516
#define DE_SPRITEA_FLIP_DONE_IVB	(1<<4)
3812
#define DE_SPRITEA_FLIP_DONE_IVB	(1<<4)
3517
#define DE_PLANEA_FLIP_DONE_IVB		(1<<3)
3813
#define DE_PLANEA_FLIP_DONE_IVB		(1<<3)
3518
#define DE_PIPEA_VBLANK_IVB		(1<<0)
3814
#define DE_PIPEA_VBLANK_IVB		(1<<0)
Line -... Line 3815...
-
 
3815
 
-
 
3816
#define DE_PIPE_VBLANK_ILK(pipe)	(1 << ((pipe * 8) + 7))
-
 
3817
#define DE_PIPE_VBLANK_IVB(pipe)	(1 << (pipe * 5))
3519
 
3818
 
3520
#define VLV_MASTER_IER			0x4400c /* Gunit master IER */
3819
#define VLV_MASTER_IER			0x4400c /* Gunit master IER */
Line 3521... Line 3820...
3521
#define   MASTER_INTERRUPT_ENABLE	(1<<31)
3820
#define   MASTER_INTERRUPT_ENABLE	(1<<31)
3522
 
3821
 
3523
#define DEISR   0x44000
3822
#define DEISR   0x44000
3524
#define DEIMR   0x44004
3823
#define DEIMR   0x44004
Line 3525... Line -...
3525
#define DEIIR   0x44008
-
 
3526
#define DEIER   0x4400c
-
 
3527
 
-
 
3528
/* GT interrupt.
-
 
3529
 * Note that for gen6+ the ring-specific interrupt bits do alias with the
-
 
3530
 * corresponding bits in the per-ring interrupt control registers. */
-
 
3531
#define GT_GEN6_BLT_FLUSHDW_NOTIFY_INTERRUPT	(1 << 26)
-
 
3532
#define GT_GEN6_BLT_CS_ERROR_INTERRUPT		(1 << 25)
-
 
3533
#define GT_GEN6_BLT_USER_INTERRUPT		(1 << 22)
-
 
3534
#define GT_GEN6_BSD_CS_ERROR_INTERRUPT		(1 << 15)
-
 
3535
#define GT_GEN6_BSD_USER_INTERRUPT		(1 << 12)
-
 
3536
#define GT_BSD_USER_INTERRUPT			(1 << 5) /* ilk only */
-
 
3537
#define GT_GEN7_L3_PARITY_ERROR_INTERRUPT	(1 << 5)
-
 
3538
#define GT_PIPE_NOTIFY		(1 << 4)
-
 
3539
#define GT_RENDER_CS_ERROR_INTERRUPT		(1 << 3)
-
 
3540
#define GT_SYNC_STATUS          (1 << 2)
3824
#define DEIIR   0x44008
3541
#define GT_USER_INTERRUPT       (1 << 0)
3825
#define DEIER   0x4400c
3542
 
3826
 
3543
#define GTISR   0x44010
3827
#define GTISR   0x44010
Line 3567... Line 3851...
3567
 
3851
 
3568
#define IVB_CHICKEN3	0x4200c
3852
#define IVB_CHICKEN3	0x4200c
3569
# define CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE	(1 << 5)
3853
# define CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE	(1 << 5)
Line -... Line 3854...
-
 
3854
# define CHICKEN3_DGMG_DONE_FIX_DISABLE		(1 << 2)
-
 
3855
 
-
 
3856
#define CHICKEN_PAR1_1		0x42080
3570
# define CHICKEN3_DGMG_DONE_FIX_DISABLE		(1 << 2)
3857
#define  FORCE_ARB_IDLE_PLANES	(1 << 14)
3571
 
3858
 
3572
#define DISP_ARB_CTL	0x45000
3859
#define DISP_ARB_CTL	0x45000
3573
#define  DISP_TILE_SURFACE_SWIZZLING	(1<<13)
3860
#define  DISP_TILE_SURFACE_SWIZZLING	(1<<13)
3574
#define  DISP_FBC_WM_DIS		(1<<15)
3861
#define  DISP_FBC_WM_DIS		(1<<15)
Line 3592... Line 3879...
3592
 
3879
 
3593
/* WaCatErrorRejectionIssue */
3880
/* WaCatErrorRejectionIssue */
3594
#define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG		0x9030
3881
#define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG		0x9030
Line -... Line 3882...
-
 
3882
#define  GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB	(1<<11)
-
 
3883
 
-
 
3884
#define HSW_SCRATCH1				0xb038
3595
#define  GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB	(1<<11)
3885
#define  HSW_SCRATCH1_L3_DATA_ATOMICS_DISABLE	(1<<27)
3596
 
3886
 
Line 3597... Line 3887...
3597
#define HSW_FUSE_STRAP		0x42014
3887
#define HSW_FUSE_STRAP		0x42014
Line 3659... Line 3949...
3659
				 SDE_SDVOB_HOTPLUG_CPT |	\
3949
				 SDE_SDVOB_HOTPLUG_CPT |	\
3660
				 SDE_PORTD_HOTPLUG_CPT |	\
3950
				 SDE_PORTD_HOTPLUG_CPT |	\
3661
				 SDE_PORTC_HOTPLUG_CPT |	\
3951
				 SDE_PORTC_HOTPLUG_CPT |	\
3662
				 SDE_PORTB_HOTPLUG_CPT)
3952
				 SDE_PORTB_HOTPLUG_CPT)
3663
#define SDE_GMBUS_CPT		(1 << 17)
3953
#define SDE_GMBUS_CPT		(1 << 17)
-
 
3954
#define SDE_ERROR_CPT		(1 << 16)
3664
#define SDE_AUDIO_CP_REQ_C_CPT	(1 << 10)
3955
#define SDE_AUDIO_CP_REQ_C_CPT	(1 << 10)
3665
#define SDE_AUDIO_CP_CHG_C_CPT	(1 << 9)
3956
#define SDE_AUDIO_CP_CHG_C_CPT	(1 << 9)
3666
#define SDE_FDI_RXC_CPT		(1 << 8)
3957
#define SDE_FDI_RXC_CPT		(1 << 8)
3667
#define SDE_AUDIO_CP_REQ_B_CPT	(1 << 6)
3958
#define SDE_AUDIO_CP_REQ_B_CPT	(1 << 6)
3668
#define SDE_AUDIO_CP_CHG_B_CPT	(1 << 5)
3959
#define SDE_AUDIO_CP_CHG_B_CPT	(1 << 5)
Line 3683... Line 3974...
3683
#define SDEISR  0xc4000
3974
#define SDEISR  0xc4000
3684
#define SDEIMR  0xc4004
3975
#define SDEIMR  0xc4004
3685
#define SDEIIR  0xc4008
3976
#define SDEIIR  0xc4008
3686
#define SDEIER  0xc400c
3977
#define SDEIER  0xc400c
Line -... Line 3978...
-
 
3978
 
-
 
3979
#define SERR_INT			0xc4040
-
 
3980
#define  SERR_INT_POISON		(1<<31)
-
 
3981
#define  SERR_INT_TRANS_C_FIFO_UNDERRUN	(1<<6)
-
 
3982
#define  SERR_INT_TRANS_B_FIFO_UNDERRUN	(1<<3)
-
 
3983
#define  SERR_INT_TRANS_A_FIFO_UNDERRUN	(1<<0)
-
 
3984
#define  SERR_INT_TRANS_FIFO_UNDERRUN(pipe)	(1<<(pipe*3))
3687
 
3985
 
3688
/* digital port hotplug */
3986
/* digital port hotplug */
3689
#define PCH_PORT_HOTPLUG        0xc4030		/* SHOTPLUG_CTL */
3987
#define PCH_PORT_HOTPLUG        0xc4030		/* SHOTPLUG_CTL */
3690
#define PORTD_HOTPLUG_ENABLE            (1 << 20)
3988
#define PORTD_HOTPLUG_ENABLE            (1 << 20)
3691
#define PORTD_PULSE_DURATION_2ms        (0)
3989
#define PORTD_PULSE_DURATION_2ms        (0)
Line 3732... Line 4030...
3732
#define PCH_GMBUS4		0xc5110
4030
#define PCH_GMBUS4		0xc5110
3733
#define PCH_GMBUS5		0xc5120
4031
#define PCH_GMBUS5		0xc5120
Line 3734... Line 4032...
3734
 
4032
 
3735
#define _PCH_DPLL_A              0xc6014
4033
#define _PCH_DPLL_A              0xc6014
3736
#define _PCH_DPLL_B              0xc6018
4034
#define _PCH_DPLL_B              0xc6018
Line 3737... Line 4035...
3737
#define _PCH_DPLL(pll) (pll == 0 ? _PCH_DPLL_A : _PCH_DPLL_B)
4035
#define PCH_DPLL(pll) (pll == 0 ? _PCH_DPLL_A : _PCH_DPLL_B)
3738
 
4036
 
3739
#define _PCH_FPA0                0xc6040
4037
#define _PCH_FPA0                0xc6040
3740
#define  FP_CB_TUNE		(0x3<<22)
4038
#define  FP_CB_TUNE		(0x3<<22)
3741
#define _PCH_FPA1                0xc6044
4039
#define _PCH_FPA1                0xc6044
3742
#define _PCH_FPB0                0xc6048
4040
#define _PCH_FPB0                0xc6048
3743
#define _PCH_FPB1                0xc604c
4041
#define _PCH_FPB1                0xc604c
Line 3744... Line 4042...
3744
#define _PCH_FP0(pll) (pll == 0 ? _PCH_FPA0 : _PCH_FPB0)
4042
#define PCH_FP0(pll) (pll == 0 ? _PCH_FPA0 : _PCH_FPB0)
Line 3745... Line 4043...
3745
#define _PCH_FP1(pll) (pll == 0 ? _PCH_FPA1 : _PCH_FPB1)
4043
#define PCH_FP1(pll) (pll == 0 ? _PCH_FPA1 : _PCH_FPB1)
3746
 
4044
 
Line 3780... Line 4078...
3780
 
4078
 
3781
#define PCH_SSC4_PARMS          0xc6210
4079
#define PCH_SSC4_PARMS          0xc6210
Line 3782... Line 4080...
3782
#define PCH_SSC4_AUX_PARMS      0xc6214
4080
#define PCH_SSC4_AUX_PARMS      0xc6214
3783
 
-
 
3784
#define PCH_DPLL_SEL		0xc7000
-
 
3785
#define  TRANSA_DPLL_ENABLE	(1<<3)
-
 
3786
#define	 TRANSA_DPLLB_SEL	(1<<0)
-
 
3787
#define	 TRANSA_DPLLA_SEL	0
4081
 
3788
#define  TRANSB_DPLL_ENABLE	(1<<7)
4082
#define PCH_DPLL_SEL		0xc7000
3789
#define	 TRANSB_DPLLB_SEL	(1<<4)
4083
#define	 TRANS_DPLLB_SEL(pipe)		(1 << (pipe * 4))
3790
#define	 TRANSB_DPLLA_SEL	(0)
-
 
3791
#define  TRANSC_DPLL_ENABLE	(1<<11)
-
 
Line 3792... Line 4084...
3792
#define	 TRANSC_DPLLB_SEL	(1<<8)
4084
#define	 TRANS_DPLLA_SEL(pipe)		0
Line 3793... Line 4085...
3793
#define	 TRANSC_DPLLA_SEL	(0)
4085
#define  TRANS_DPLL_ENABLE(pipe)	(1 << (pipe * 4 + 3))
3794
 
4086
 
3795
/* transcoder */
4087
/* transcoder */
3796
 
4088
 
3797
#define _TRANS_HTOTAL_A          0xe0000
4089
#define _PCH_TRANS_HTOTAL_A		0xe0000
3798
#define  TRANS_HTOTAL_SHIFT     16
4090
#define  TRANS_HTOTAL_SHIFT     16
3799
#define  TRANS_HACTIVE_SHIFT    0
4091
#define  TRANS_HACTIVE_SHIFT    0
3800
#define _TRANS_HBLANK_A          0xe0004
4092
#define _PCH_TRANS_HBLANK_A		0xe0004
3801
#define  TRANS_HBLANK_END_SHIFT 16
4093
#define  TRANS_HBLANK_END_SHIFT 16
3802
#define  TRANS_HBLANK_START_SHIFT 0
4094
#define  TRANS_HBLANK_START_SHIFT 0
3803
#define _TRANS_HSYNC_A           0xe0008
4095
#define _PCH_TRANS_HSYNC_A		0xe0008
3804
#define  TRANS_HSYNC_END_SHIFT  16
4096
#define  TRANS_HSYNC_END_SHIFT  16
3805
#define  TRANS_HSYNC_START_SHIFT 0
4097
#define  TRANS_HSYNC_START_SHIFT 0
3806
#define _TRANS_VTOTAL_A          0xe000c
4098
#define _PCH_TRANS_VTOTAL_A		0xe000c
3807
#define  TRANS_VTOTAL_SHIFT     16
4099
#define  TRANS_VTOTAL_SHIFT     16
3808
#define  TRANS_VACTIVE_SHIFT    0
4100
#define  TRANS_VACTIVE_SHIFT    0
3809
#define _TRANS_VBLANK_A          0xe0010
4101
#define _PCH_TRANS_VBLANK_A		0xe0010
3810
#define  TRANS_VBLANK_END_SHIFT 16
4102
#define  TRANS_VBLANK_END_SHIFT 16
3811
#define  TRANS_VBLANK_START_SHIFT 0
4103
#define  TRANS_VBLANK_START_SHIFT 0
Line 3812... Line 4104...
3812
#define _TRANS_VSYNC_A           0xe0014
4104
#define _PCH_TRANS_VSYNC_A		0xe0014
3813
#define  TRANS_VSYNC_END_SHIFT  16
4105
#define  TRANS_VSYNC_END_SHIFT  16
3814
#define  TRANS_VSYNC_START_SHIFT 0
4106
#define  TRANS_VSYNC_START_SHIFT 0
3815
#define _TRANS_VSYNCSHIFT_A	0xe0028
4107
#define _PCH_TRANS_VSYNCSHIFT_A		0xe0028
3816
 
4108
 
3817
#define _TRANSA_DATA_M1          0xe0030
4109
#define _PCH_TRANSA_DATA_M1	0xe0030
3818
#define _TRANSA_DATA_N1          0xe0034
4110
#define _PCH_TRANSA_DATA_N1	0xe0034
3819
#define _TRANSA_DATA_M2          0xe0038
4111
#define _PCH_TRANSA_DATA_M2	0xe0038
Line 3820... Line 4112...
3820
#define _TRANSA_DATA_N2          0xe003c
4112
#define _PCH_TRANSA_DATA_N2	0xe003c
Line 3821... Line 4113...
3821
#define _TRANSA_DP_LINK_M1       0xe0040
4113
#define _PCH_TRANSA_LINK_M1	0xe0040
3822
#define _TRANSA_DP_LINK_N1       0xe0044
4114
#define _PCH_TRANSA_LINK_N1	0xe0044
Line 3881... Line 4173...
3881
 
4173
 
3882
#define HSW_TVIDEO_DIP_CTL(trans) \
4174
#define HSW_TVIDEO_DIP_CTL(trans) \
3883
	 _TRANSCODER(trans, HSW_VIDEO_DIP_CTL_A, HSW_VIDEO_DIP_CTL_B)
4175
	 _TRANSCODER(trans, HSW_VIDEO_DIP_CTL_A, HSW_VIDEO_DIP_CTL_B)
3884
#define HSW_TVIDEO_DIP_AVI_DATA(trans) \
4176
#define HSW_TVIDEO_DIP_AVI_DATA(trans) \
-
 
4177
	 _TRANSCODER(trans, HSW_VIDEO_DIP_AVI_DATA_A, HSW_VIDEO_DIP_AVI_DATA_B)
-
 
4178
#define HSW_TVIDEO_DIP_VS_DATA(trans) \
3885
	 _TRANSCODER(trans, HSW_VIDEO_DIP_AVI_DATA_A, HSW_VIDEO_DIP_AVI_DATA_B)
4179
	 _TRANSCODER(trans, HSW_VIDEO_DIP_VS_DATA_A, HSW_VIDEO_DIP_VS_DATA_B)
3886
#define HSW_TVIDEO_DIP_SPD_DATA(trans) \
4180
#define HSW_TVIDEO_DIP_SPD_DATA(trans) \
3887
	 _TRANSCODER(trans, HSW_VIDEO_DIP_SPD_DATA_A, HSW_VIDEO_DIP_SPD_DATA_B)
4181
	 _TRANSCODER(trans, HSW_VIDEO_DIP_SPD_DATA_A, HSW_VIDEO_DIP_SPD_DATA_B)
3888
#define HSW_TVIDEO_DIP_GCP(trans) \
4182
#define HSW_TVIDEO_DIP_GCP(trans) \
3889
	_TRANSCODER(trans, HSW_VIDEO_DIP_GCP_A, HSW_VIDEO_DIP_GCP_B)
4183
	_TRANSCODER(trans, HSW_VIDEO_DIP_GCP_A, HSW_VIDEO_DIP_GCP_B)
3890
#define HSW_TVIDEO_DIP_VSC_DATA(trans) \
4184
#define HSW_TVIDEO_DIP_VSC_DATA(trans) \
Line -... Line 4185...
-
 
4185
	 _TRANSCODER(trans, HSW_VIDEO_DIP_VSC_DATA_A, HSW_VIDEO_DIP_VSC_DATA_B)
-
 
4186
 
-
 
4187
#define HSW_STEREO_3D_CTL_A	0x70020
-
 
4188
#define   S3D_ENABLE		(1<<31)
-
 
4189
#define HSW_STEREO_3D_CTL_B	0x71020
-
 
4190
 
-
 
4191
#define HSW_STEREO_3D_CTL(trans) \
3891
	 _TRANSCODER(trans, HSW_VIDEO_DIP_VSC_DATA_A, HSW_VIDEO_DIP_VSC_DATA_B)
4192
	_TRANSCODER(trans, HSW_STEREO_3D_CTL_A, HSW_STEREO_3D_CTL_A)
3892
 
4193
 
3893
#define _TRANS_HTOTAL_B          0xe1000
4194
#define _PCH_TRANS_HTOTAL_B          0xe1000
3894
#define _TRANS_HBLANK_B          0xe1004
4195
#define _PCH_TRANS_HBLANK_B          0xe1004
3895
#define _TRANS_HSYNC_B           0xe1008
4196
#define _PCH_TRANS_HSYNC_B           0xe1008
3896
#define _TRANS_VTOTAL_B          0xe100c
4197
#define _PCH_TRANS_VTOTAL_B          0xe100c
3897
#define _TRANS_VBLANK_B          0xe1010
4198
#define _PCH_TRANS_VBLANK_B          0xe1010
3898
#define _TRANS_VSYNC_B           0xe1014
4199
#define _PCH_TRANS_VSYNC_B           0xe1014
3899
#define _TRANS_VSYNCSHIFT_B	 0xe1028
4200
#define _PCH_TRANS_VSYNCSHIFT_B	 0xe1028
3900
 
4201
 
3901
#define TRANS_HTOTAL(pipe) _PIPE(pipe, _TRANS_HTOTAL_A, _TRANS_HTOTAL_B)
4202
#define PCH_TRANS_HTOTAL(pipe) _PIPE(pipe, _PCH_TRANS_HTOTAL_A, _PCH_TRANS_HTOTAL_B)
3902
#define TRANS_HBLANK(pipe) _PIPE(pipe, _TRANS_HBLANK_A, _TRANS_HBLANK_B)
4203
#define PCH_TRANS_HBLANK(pipe) _PIPE(pipe, _PCH_TRANS_HBLANK_A, _PCH_TRANS_HBLANK_B)
3903
#define TRANS_HSYNC(pipe) _PIPE(pipe, _TRANS_HSYNC_A, _TRANS_HSYNC_B)
4204
#define PCH_TRANS_HSYNC(pipe) _PIPE(pipe, _PCH_TRANS_HSYNC_A, _PCH_TRANS_HSYNC_B)
3904
#define TRANS_VTOTAL(pipe) _PIPE(pipe, _TRANS_VTOTAL_A, _TRANS_VTOTAL_B)
4205
#define PCH_TRANS_VTOTAL(pipe) _PIPE(pipe, _PCH_TRANS_VTOTAL_A, _PCH_TRANS_VTOTAL_B)
3905
#define TRANS_VBLANK(pipe) _PIPE(pipe, _TRANS_VBLANK_A, _TRANS_VBLANK_B)
4206
#define PCH_TRANS_VBLANK(pipe) _PIPE(pipe, _PCH_TRANS_VBLANK_A, _PCH_TRANS_VBLANK_B)
3906
#define TRANS_VSYNC(pipe) _PIPE(pipe, _TRANS_VSYNC_A, _TRANS_VSYNC_B)
4207
#define PCH_TRANS_VSYNC(pipe) _PIPE(pipe, _PCH_TRANS_VSYNC_A, _PCH_TRANS_VSYNC_B)
3907
#define TRANS_VSYNCSHIFT(pipe) _PIPE(pipe, _TRANS_VSYNCSHIFT_A, \
4208
#define PCH_TRANS_VSYNCSHIFT(pipe) _PIPE(pipe, _PCH_TRANS_VSYNCSHIFT_A, \
3908
				     _TRANS_VSYNCSHIFT_B)
4209
					 _PCH_TRANS_VSYNCSHIFT_B)
3909
 
4210
 
3910
#define _TRANSB_DATA_M1          0xe1030
4211
#define _PCH_TRANSB_DATA_M1	0xe1030
3911
#define _TRANSB_DATA_N1          0xe1034
4212
#define _PCH_TRANSB_DATA_N1	0xe1034
3912
#define _TRANSB_DATA_M2          0xe1038
4213
#define _PCH_TRANSB_DATA_M2	0xe1038
3913
#define _TRANSB_DATA_N2          0xe103c
4214
#define _PCH_TRANSB_DATA_N2	0xe103c
3914
#define _TRANSB_DP_LINK_M1       0xe1040
4215
#define _PCH_TRANSB_LINK_M1	0xe1040
3915
#define _TRANSB_DP_LINK_N1       0xe1044
4216
#define _PCH_TRANSB_LINK_N1	0xe1044
3916
#define _TRANSB_DP_LINK_M2       0xe1048
4217
#define _PCH_TRANSB_LINK_M2	0xe1048
3917
#define _TRANSB_DP_LINK_N2       0xe104c
4218
#define _PCH_TRANSB_LINK_N2	0xe104c
3918
 
4219
 
3919
#define TRANSDATA_M1(pipe) _PIPE(pipe, _TRANSA_DATA_M1, _TRANSB_DATA_M1)
4220
#define PCH_TRANS_DATA_M1(pipe) _PIPE(pipe, _PCH_TRANSA_DATA_M1, _PCH_TRANSB_DATA_M1)
3920
#define TRANSDATA_N1(pipe) _PIPE(pipe, _TRANSA_DATA_N1, _TRANSB_DATA_N1)
4221
#define PCH_TRANS_DATA_N1(pipe) _PIPE(pipe, _PCH_TRANSA_DATA_N1, _PCH_TRANSB_DATA_N1)
3921
#define TRANSDATA_M2(pipe) _PIPE(pipe, _TRANSA_DATA_M2, _TRANSB_DATA_M2)
4222
#define PCH_TRANS_DATA_M2(pipe) _PIPE(pipe, _PCH_TRANSA_DATA_M2, _PCH_TRANSB_DATA_M2)
3922
#define TRANSDATA_N2(pipe) _PIPE(pipe, _TRANSA_DATA_N2, _TRANSB_DATA_N2)
4223
#define PCH_TRANS_DATA_N2(pipe) _PIPE(pipe, _PCH_TRANSA_DATA_N2, _PCH_TRANSB_DATA_N2)
3923
#define TRANSDPLINK_M1(pipe) _PIPE(pipe, _TRANSA_DP_LINK_M1, _TRANSB_DP_LINK_M1)
4224
#define PCH_TRANS_LINK_M1(pipe) _PIPE(pipe, _PCH_TRANSA_LINK_M1, _PCH_TRANSB_LINK_M1)
3924
#define TRANSDPLINK_N1(pipe) _PIPE(pipe, _TRANSA_DP_LINK_N1, _TRANSB_DP_LINK_N1)
4225
#define PCH_TRANS_LINK_N1(pipe) _PIPE(pipe, _PCH_TRANSA_LINK_N1, _PCH_TRANSB_LINK_N1)
3925
#define TRANSDPLINK_M2(pipe) _PIPE(pipe, _TRANSA_DP_LINK_M2, _TRANSB_DP_LINK_M2)
4226
#define PCH_TRANS_LINK_M2(pipe) _PIPE(pipe, _PCH_TRANSA_LINK_M2, _PCH_TRANSB_LINK_M2)
3926
#define TRANSDPLINK_N2(pipe) _PIPE(pipe, _TRANSA_DP_LINK_N2, _TRANSB_DP_LINK_N2)
4227
#define PCH_TRANS_LINK_N2(pipe) _PIPE(pipe, _PCH_TRANSA_LINK_N2, _PCH_TRANSB_LINK_N2)
3927
 
4228
 
3928
#define _TRANSACONF              0xf0008
4229
#define _PCH_TRANSACONF              0xf0008
-
 
4230
#define _PCH_TRANSBCONF              0xf1008
3929
#define _TRANSBCONF              0xf1008
4231
#define PCH_TRANSCONF(pipe) _PIPE(pipe, _PCH_TRANSACONF, _PCH_TRANSBCONF)
3930
#define TRANSCONF(plane) _PIPE(plane, _TRANSACONF, _TRANSBCONF)
4232
#define LPT_TRANSCONF		_PCH_TRANSACONF /* lpt has only one transcoder */
3931
#define  TRANS_DISABLE          (0<<31)
4233
#define  TRANS_DISABLE          (0<<31)
3932
#define  TRANS_ENABLE           (1<<31)
4234
#define  TRANS_ENABLE           (1<<31)
3933
#define  TRANS_STATE_MASK       (1<<30)
4235
#define  TRANS_STATE_MASK       (1<<30)
Line 4009... Line 4311...
4009
#define  FDI_LINK_TRAIN_400MV_0DB_SNB_B		(0x0<<22)
4311
#define  FDI_LINK_TRAIN_400MV_0DB_SNB_B		(0x0<<22)
4010
#define  FDI_LINK_TRAIN_400MV_6DB_SNB_B		(0x3a<<22)
4312
#define  FDI_LINK_TRAIN_400MV_6DB_SNB_B		(0x3a<<22)
4011
#define  FDI_LINK_TRAIN_600MV_3_5DB_SNB_B	(0x39<<22)
4313
#define  FDI_LINK_TRAIN_600MV_3_5DB_SNB_B	(0x39<<22)
4012
#define  FDI_LINK_TRAIN_800MV_0DB_SNB_B		(0x38<<22)
4314
#define  FDI_LINK_TRAIN_800MV_0DB_SNB_B		(0x38<<22)
4013
#define  FDI_LINK_TRAIN_VOL_EMP_MASK		(0x3f<<22)
4315
#define  FDI_LINK_TRAIN_VOL_EMP_MASK		(0x3f<<22)
4014
#define  FDI_DP_PORT_WIDTH_X1           (0<<19)
-
 
4015
#define  FDI_DP_PORT_WIDTH_X2           (1<<19)
4316
#define  FDI_DP_PORT_WIDTH_SHIFT		19
4016
#define  FDI_DP_PORT_WIDTH_X3           (2<<19)
4317
#define  FDI_DP_PORT_WIDTH_MASK			(7 << FDI_DP_PORT_WIDTH_SHIFT)
4017
#define  FDI_DP_PORT_WIDTH_X4           (3<<19)
4318
#define  FDI_DP_PORT_WIDTH(width)           (((width) - 1) << FDI_DP_PORT_WIDTH_SHIFT)
4018
#define  FDI_TX_ENHANCE_FRAME_ENABLE    (1<<18)
4319
#define  FDI_TX_ENHANCE_FRAME_ENABLE    (1<<18)
4019
/* Ironlake: hardwired to 1 */
4320
/* Ironlake: hardwired to 1 */
4020
#define  FDI_TX_PLL_ENABLE              (1<<14)
4321
#define  FDI_TX_PLL_ENABLE              (1<<14)
Line 4021... Line 4322...
4021
 
4322
 
Line 4037... Line 4338...
4037
#define FDI_RX_CTL(pipe) _PIPE(pipe, _FDI_RXA_CTL, _FDI_RXB_CTL)
4338
#define FDI_RX_CTL(pipe) _PIPE(pipe, _FDI_RXA_CTL, _FDI_RXB_CTL)
4038
#define  FDI_RX_ENABLE          (1<<31)
4339
#define  FDI_RX_ENABLE          (1<<31)
4039
/* train, dp width same as FDI_TX */
4340
/* train, dp width same as FDI_TX */
4040
#define  FDI_FS_ERRC_ENABLE		(1<<27)
4341
#define  FDI_FS_ERRC_ENABLE		(1<<27)
4041
#define  FDI_FE_ERRC_ENABLE		(1<<26)
4342
#define  FDI_FE_ERRC_ENABLE		(1<<26)
4042
#define  FDI_DP_PORT_WIDTH_X8           (7<<19)
-
 
4043
#define  FDI_RX_POLARITY_REVERSED_LPT	(1<<16)
4343
#define  FDI_RX_POLARITY_REVERSED_LPT	(1<<16)
4044
#define  FDI_8BPC                       (0<<16)
4344
#define  FDI_8BPC                       (0<<16)
4045
#define  FDI_10BPC                      (1<<16)
4345
#define  FDI_10BPC                      (1<<16)
4046
#define  FDI_6BPC                       (2<<16)
4346
#define  FDI_6BPC                       (2<<16)
4047
#define  FDI_12BPC                      (3<<16)
4347
#define  FDI_12BPC                      (3<<16)
Line 4059... Line 4359...
4059
#define  FDI_LINK_TRAIN_PATTERN_1_CPT		(0<<8)
4359
#define  FDI_LINK_TRAIN_PATTERN_1_CPT		(0<<8)
4060
#define  FDI_LINK_TRAIN_PATTERN_2_CPT		(1<<8)
4360
#define  FDI_LINK_TRAIN_PATTERN_2_CPT		(1<<8)
4061
#define  FDI_LINK_TRAIN_PATTERN_IDLE_CPT	(2<<8)
4361
#define  FDI_LINK_TRAIN_PATTERN_IDLE_CPT	(2<<8)
4062
#define  FDI_LINK_TRAIN_NORMAL_CPT		(3<<8)
4362
#define  FDI_LINK_TRAIN_NORMAL_CPT		(3<<8)
4063
#define  FDI_LINK_TRAIN_PATTERN_MASK_CPT	(3<<8)
4363
#define  FDI_LINK_TRAIN_PATTERN_MASK_CPT	(3<<8)
4064
/* LPT */
-
 
4065
#define  FDI_PORT_WIDTH_2X_LPT			(1<<19)
-
 
4066
#define  FDI_PORT_WIDTH_1X_LPT			(0<<19)
-
 
Line 4067... Line 4364...
4067
 
4364
 
4068
#define _FDI_RXA_MISC            0xf0010
4365
#define _FDI_RXA_MISC            0xf0010
4069
#define _FDI_RXB_MISC            0xf1010
4366
#define _FDI_RXB_MISC            0xf1010
4070
#define  FDI_RX_PWRDN_LANE1_MASK	(3<<26)
4367
#define  FDI_RX_PWRDN_LANE1_MASK	(3<<26)
Line 4244... Line 4541...
4244
#define EDP_LINK_TRAIN_400MV_3_5DB_IVB		(0x2a <<22)
4541
#define EDP_LINK_TRAIN_400MV_3_5DB_IVB		(0x2a <<22)
4245
#define EDP_LINK_TRAIN_400MV_6DB_IVB		(0x2f <<22)
4542
#define EDP_LINK_TRAIN_400MV_6DB_IVB		(0x2f <<22)
4246
#define EDP_LINK_TRAIN_600MV_0DB_IVB		(0x30 <<22)
4543
#define EDP_LINK_TRAIN_600MV_0DB_IVB		(0x30 <<22)
4247
#define EDP_LINK_TRAIN_600MV_3_5DB_IVB		(0x36 <<22)
4544
#define EDP_LINK_TRAIN_600MV_3_5DB_IVB		(0x36 <<22)
4248
#define EDP_LINK_TRAIN_800MV_0DB_IVB		(0x38 <<22)
4545
#define EDP_LINK_TRAIN_800MV_0DB_IVB		(0x38 <<22)
4249
#define EDP_LINK_TRAIN_800MV_3_5DB_IVB		(0x33 <<22)
4546
#define EDP_LINK_TRAIN_800MV_3_5DB_IVB		(0x3e <<22)
Line 4250... Line 4547...
4250
 
4547
 
4251
/* legacy values */
4548
/* legacy values */
4252
#define EDP_LINK_TRAIN_500MV_0DB_IVB		(0x00 <<22)
4549
#define EDP_LINK_TRAIN_500MV_0DB_IVB		(0x00 <<22)
4253
#define EDP_LINK_TRAIN_1000MV_0DB_IVB		(0x20 <<22)
4550
#define EDP_LINK_TRAIN_1000MV_0DB_IVB		(0x20 <<22)
Line 4280... Line 4577...
4280
#define    GT_FIFO_IARDERR			(1<<0)
4577
#define    GT_FIFO_IARDERR			(1<<0)
Line 4281... Line 4578...
4281
 
4578
 
4282
#define  GT_FIFO_FREE_ENTRIES			0x120008
4579
#define  GT_FIFO_FREE_ENTRIES			0x120008
Line -... Line 4580...
-
 
4580
#define    GT_FIFO_NUM_RESERVED_ENTRIES		20
-
 
4581
 
-
 
4582
#define  HSW_IDICR				0x9008
-
 
4583
#define    IDIHASHMSK(x)			(((x) & 0x3f) << 16)
4283
#define    GT_FIFO_NUM_RESERVED_ENTRIES		20
4584
#define  HSW_EDRAM_PRESENT			0x120010
4284
 
4585
 
4285
#define GEN6_UCGCTL1				0x9400
4586
#define GEN6_UCGCTL1				0x9400
Line 4286... Line 4587...
4286
# define GEN6_BLBUNIT_CLOCK_GATE_DISABLE		(1 << 5)
4587
# define GEN6_BLBUNIT_CLOCK_GATE_DISABLE		(1 << 5)
Line 4307... Line 4608...
4307
#define   GEN6_RC_CTL_RC6pp_ENABLE		(1<<16)
4608
#define   GEN6_RC_CTL_RC6pp_ENABLE		(1<<16)
4308
#define   GEN6_RC_CTL_RC6p_ENABLE		(1<<17)
4609
#define   GEN6_RC_CTL_RC6p_ENABLE		(1<<17)
4309
#define   GEN6_RC_CTL_RC6_ENABLE		(1<<18)
4610
#define   GEN6_RC_CTL_RC6_ENABLE		(1<<18)
4310
#define   GEN6_RC_CTL_RC1e_ENABLE		(1<<20)
4611
#define   GEN6_RC_CTL_RC1e_ENABLE		(1<<20)
4311
#define   GEN6_RC_CTL_RC7_ENABLE		(1<<22)
4612
#define   GEN6_RC_CTL_RC7_ENABLE		(1<<22)
-
 
4613
#define   GEN7_RC_CTL_TO_MODE			(1<<28)
4312
#define   GEN6_RC_CTL_EI_MODE(x)		((x)<<27)
4614
#define   GEN6_RC_CTL_EI_MODE(x)		((x)<<27)
4313
#define   GEN6_RC_CTL_HW_ENABLE			(1<<31)
4615
#define   GEN6_RC_CTL_HW_ENABLE			(1<<31)
4314
#define GEN6_RP_DOWN_TIMEOUT			0xA010
4616
#define GEN6_RP_DOWN_TIMEOUT			0xA010
4315
#define GEN6_RP_INTERRUPT_LIMITS		0xA014
4617
#define GEN6_RP_INTERRUPT_LIMITS		0xA014
4316
#define GEN6_RPSTAT1				0xA01C
4618
#define GEN6_RPSTAT1				0xA01C
Line 4368... Line 4670...
4368
#define  GEN6_PM_RP_DOWN_TIMEOUT		(1<<6)
4670
#define  GEN6_PM_RP_DOWN_TIMEOUT		(1<<6)
4369
#define  GEN6_PM_RP_UP_THRESHOLD		(1<<5)
4671
#define  GEN6_PM_RP_UP_THRESHOLD		(1<<5)
4370
#define  GEN6_PM_RP_DOWN_THRESHOLD		(1<<4)
4672
#define  GEN6_PM_RP_DOWN_THRESHOLD		(1<<4)
4371
#define  GEN6_PM_RP_UP_EI_EXPIRED		(1<<2)
4673
#define  GEN6_PM_RP_UP_EI_EXPIRED		(1<<2)
4372
#define  GEN6_PM_RP_DOWN_EI_EXPIRED		(1<<1)
4674
#define  GEN6_PM_RP_DOWN_EI_EXPIRED		(1<<1)
4373
#define  GEN6_PM_DEFERRED_EVENTS		(GEN6_PM_RP_UP_THRESHOLD | \
4675
#define  GEN6_PM_RPS_EVENTS			(GEN6_PM_RP_UP_THRESHOLD | \
4374
						 GEN6_PM_RP_DOWN_THRESHOLD | \
4676
						 GEN6_PM_RP_DOWN_THRESHOLD | \
4375
						 GEN6_PM_RP_DOWN_TIMEOUT)
4677
						 GEN6_PM_RP_DOWN_TIMEOUT)
Line 4376... Line 4678...
4376
 
4678
 
4377
#define GEN6_GT_GFX_RC6_LOCKED			0x138104
4679
#define GEN6_GT_GFX_RC6_LOCKED			0x138104
Line 4390... Line 4692...
4390
#define   GEN6_DECODE_RC6_VID(vids)		(((vids) * 5) + 245)
4692
#define   GEN6_DECODE_RC6_VID(vids)		(((vids) * 5) + 245)
4391
#define GEN6_PCODE_DATA				0x138128
4693
#define GEN6_PCODE_DATA				0x138128
4392
#define   GEN6_PCODE_FREQ_IA_RATIO_SHIFT	8
4694
#define   GEN6_PCODE_FREQ_IA_RATIO_SHIFT	8
4393
#define   GEN6_PCODE_FREQ_RING_RATIO_SHIFT	16
4695
#define   GEN6_PCODE_FREQ_RING_RATIO_SHIFT	16
Line 4394... Line -...
4394
 
-
 
4395
#define VLV_IOSF_DOORBELL_REQ			0x182100
-
 
4396
#define   IOSF_DEVFN_SHIFT			24
-
 
4397
#define   IOSF_OPCODE_SHIFT			16
-
 
4398
#define   IOSF_PORT_SHIFT			8
-
 
4399
#define   IOSF_BYTE_ENABLES_SHIFT		4
-
 
4400
#define   IOSF_BAR_SHIFT			1
-
 
4401
#define   IOSF_SB_BUSY				(1<<0)
-
 
4402
#define   IOSF_PORT_PUNIT			0x4
-
 
4403
#define VLV_IOSF_DATA				0x182104
-
 
4404
#define VLV_IOSF_ADDR				0x182108
-
 
4405
 
-
 
4406
#define PUNIT_OPCODE_REG_READ			6
-
 
4407
#define PUNIT_OPCODE_REG_WRITE			7
-
 
4408
 
4696
 
4409
#define GEN6_GT_CORE_STATUS		0x138060
4697
#define GEN6_GT_CORE_STATUS		0x138060
4410
#define   GEN6_CORE_CPD_STATE_MASK	(7<<4)
4698
#define   GEN6_CORE_CPD_STATE_MASK	(7<<4)
4411
#define   GEN6_RCn_MASK			7
4699
#define   GEN6_RCn_MASK			7
4412
#define   GEN6_RC0			0
4700
#define   GEN6_RC0			0
Line 4441... Line 4729...
4441
 
4729
 
4442
#define GEN7_ROW_CHICKEN2		0xe4f4
4730
#define GEN7_ROW_CHICKEN2		0xe4f4
4443
#define GEN7_ROW_CHICKEN2_GT2		0xf4f4
4731
#define GEN7_ROW_CHICKEN2_GT2		0xf4f4
Line -... Line 4732...
-
 
4732
#define   DOP_CLOCK_GATING_DISABLE	(1<<0)
-
 
4733
 
-
 
4734
#define HSW_ROW_CHICKEN3		0xe49c
4444
#define   DOP_CLOCK_GATING_DISABLE	(1<<0)
4735
#define  HSW_ROW_CHICKEN3_L3_GLOBAL_ATOMICS_DISABLE    (1 << 6)
4445
 
4736
 
4446
#define G4X_AUD_VID_DID			(dev_priv->info->display_mmio_offset + 0x62020)
4737
#define G4X_AUD_VID_DID			(dev_priv->info->display_mmio_offset + 0x62020)
4447
#define INTEL_AUDIO_DEVCL		0x808629FB
4738
#define INTEL_AUDIO_DEVCL		0x808629FB
Line 4561... Line 4852...
4561
/* HSW Power Wells */
4852
/* HSW Power Wells */
4562
#define HSW_PWR_WELL_BIOS			0x45400 /* CTL1 */
4853
#define HSW_PWR_WELL_BIOS			0x45400 /* CTL1 */
4563
#define HSW_PWR_WELL_DRIVER			0x45404 /* CTL2 */
4854
#define HSW_PWR_WELL_DRIVER			0x45404 /* CTL2 */
4564
#define HSW_PWR_WELL_KVMR			0x45408 /* CTL3 */
4855
#define HSW_PWR_WELL_KVMR			0x45408 /* CTL3 */
4565
#define HSW_PWR_WELL_DEBUG			0x4540C /* CTL4 */
4856
#define HSW_PWR_WELL_DEBUG			0x4540C /* CTL4 */
4566
#define   HSW_PWR_WELL_ENABLE				(1<<31)
4857
#define   HSW_PWR_WELL_ENABLE_REQUEST		(1<<31)
4567
#define   HSW_PWR_WELL_STATE				(1<<30)
4858
#define   HSW_PWR_WELL_STATE_ENABLED		(1<<30)
4568
#define HSW_PWR_WELL_CTL5		0x45410
4859
#define HSW_PWR_WELL_CTL5		0x45410
4569
#define   HSW_PWR_WELL_ENABLE_SINGLE_STEP	(1<<31)
4860
#define   HSW_PWR_WELL_ENABLE_SINGLE_STEP	(1<<31)
4570
#define   HSW_PWR_WELL_PWR_GATE_OVERRIDE	(1<<20)
4861
#define   HSW_PWR_WELL_PWR_GATE_OVERRIDE	(1<<20)
4571
#define   HSW_PWR_WELL_FORCE_ON				(1<<19)
4862
#define   HSW_PWR_WELL_FORCE_ON				(1<<19)
4572
#define HSW_PWR_WELL_CTL6		0x45414
4863
#define HSW_PWR_WELL_CTL6		0x45414
Line 4600... Line 4891...
4600
#define  TRANS_DDI_EDP_INPUT_A_ON	(0<<12)
4891
#define  TRANS_DDI_EDP_INPUT_A_ON	(0<<12)
4601
#define  TRANS_DDI_EDP_INPUT_A_ONOFF	(4<<12)
4892
#define  TRANS_DDI_EDP_INPUT_A_ONOFF	(4<<12)
4602
#define  TRANS_DDI_EDP_INPUT_B_ONOFF	(5<<12)
4893
#define  TRANS_DDI_EDP_INPUT_B_ONOFF	(5<<12)
4603
#define  TRANS_DDI_EDP_INPUT_C_ONOFF	(6<<12)
4894
#define  TRANS_DDI_EDP_INPUT_C_ONOFF	(6<<12)
4604
#define  TRANS_DDI_BFI_ENABLE		(1<<4)
4895
#define  TRANS_DDI_BFI_ENABLE		(1<<4)
4605
#define  TRANS_DDI_PORT_WIDTH_X1	(0<<1)
-
 
4606
#define  TRANS_DDI_PORT_WIDTH_X2	(1<<1)
-
 
4607
#define  TRANS_DDI_PORT_WIDTH_X4	(3<<1)
-
 
Line 4608... Line 4896...
4608
 
4896
 
4609
/* DisplayPort Transport Control */
4897
/* DisplayPort Transport Control */
4610
#define DP_TP_CTL_A			0x64040
4898
#define DP_TP_CTL_A			0x64040
4611
#define DP_TP_CTL_B			0x64140
4899
#define DP_TP_CTL_B			0x64140
Line 4646... Line 4934...
4646
#define  DDI_BUF_EMP_800MV_3_5DB_HSW	(8<<24)   /* Sel8 */
4934
#define  DDI_BUF_EMP_800MV_3_5DB_HSW	(8<<24)   /* Sel8 */
4647
#define  DDI_BUF_EMP_MASK				(0xf<<24)
4935
#define  DDI_BUF_EMP_MASK				(0xf<<24)
4648
#define  DDI_BUF_PORT_REVERSAL			(1<<16)
4936
#define  DDI_BUF_PORT_REVERSAL			(1<<16)
4649
#define  DDI_BUF_IS_IDLE				(1<<7)
4937
#define  DDI_BUF_IS_IDLE				(1<<7)
4650
#define  DDI_A_4_LANES				(1<<4)
4938
#define  DDI_A_4_LANES				(1<<4)
4651
#define  DDI_PORT_WIDTH_X1				(0<<1)
-
 
4652
#define  DDI_PORT_WIDTH_X2				(1<<1)
4939
#define  DDI_PORT_WIDTH(width)			(((width) - 1) << 1)
4653
#define  DDI_PORT_WIDTH_X4				(3<<1)
-
 
4654
#define  DDI_INIT_DISPLAY_DETECTED		(1<<0)
4940
#define  DDI_INIT_DISPLAY_DETECTED		(1<<0)
Line 4655... Line 4941...
4655
 
4941
 
4656
/* DDI Buffer Translations */
4942
/* DDI Buffer Translations */
4657
#define DDI_BUF_TRANS_A				0x64E00
4943
#define DDI_BUF_TRANS_A				0x64E00
Line 4688... Line 4974...
4688
#define   SBI_SSCCTL_PATHALT			(1<<3)
4974
#define   SBI_SSCCTL_PATHALT			(1<<3)
4689
#define   SBI_SSCCTL_DISABLE		(1<<0)
4975
#define   SBI_SSCCTL_DISABLE		(1<<0)
4690
#define  SBI_SSCAUXDIV6				0x0610
4976
#define  SBI_SSCAUXDIV6				0x0610
4691
#define   SBI_SSCAUXDIV_FINALDIV2SEL(x)		((x)<<4)
4977
#define   SBI_SSCAUXDIV_FINALDIV2SEL(x)		((x)<<4)
4692
#define  SBI_DBUFF0					0x2a00
4978
#define  SBI_DBUFF0					0x2a00
-
 
4979
#define  SBI_GEN0				0x1f00
4693
#define   SBI_DBUFF0_ENABLE			(1<<0)
4980
#define   SBI_GEN0_CFG_BUFFENABLE_DISABLE	(1<<0)
Line 4694... Line 4981...
4694
 
4981
 
4695
/* LPT PIXCLK_GATE */
4982
/* LPT PIXCLK_GATE */
4696
#define PIXCLK_GATE				0xC6020
4983
#define PIXCLK_GATE				0xC6020
4697
#define  PIXCLK_GATE_UNGATE		(1<<0)
4984
#define  PIXCLK_GATE_UNGATE		(1<<0)
Line 4754... Line 5041...
4754
#define  LCPLL_PLL_LOCK			(1<<30)
5041
#define  LCPLL_PLL_LOCK			(1<<30)
4755
#define  LCPLL_CLK_FREQ_MASK		(3<<26)
5042
#define  LCPLL_CLK_FREQ_MASK		(3<<26)
4756
#define  LCPLL_CLK_FREQ_450		(0<<26)
5043
#define  LCPLL_CLK_FREQ_450		(0<<26)
4757
#define  LCPLL_CD_CLOCK_DISABLE	(1<<25)
5044
#define  LCPLL_CD_CLOCK_DISABLE	(1<<25)
4758
#define  LCPLL_CD2X_CLOCK_DISABLE	(1<<23)
5045
#define  LCPLL_CD2X_CLOCK_DISABLE	(1<<23)
-
 
5046
#define  LCPLL_POWER_DOWN_ALLOW		(1<<22)
4759
#define  LCPLL_CD_SOURCE_FCLK		(1<<21)
5047
#define  LCPLL_CD_SOURCE_FCLK		(1<<21)
-
 
5048
#define  LCPLL_CD_SOURCE_FCLK_DONE	(1<<19)
-
 
5049
 
-
 
5050
#define D_COMP				(MCHBAR_MIRROR_BASE_SNB + 0x5F0C)
-
 
5051
#define  D_COMP_RCOMP_IN_PROGRESS	(1<<9)
-
 
5052
#define  D_COMP_COMP_FORCE		(1<<8)
-
 
5053
#define  D_COMP_COMP_DISABLE		(1<<0)
Line 4760... Line 5054...
4760
 
5054
 
4761
/* Pipe WM_LINETIME - watermark line time */
5055
/* Pipe WM_LINETIME - watermark line time */
4762
#define PIPE_WM_LINETIME_A		0x45270
5056
#define PIPE_WM_LINETIME_A		0x45270
4763
#define PIPE_WM_LINETIME_B		0x45274
5057
#define PIPE_WM_LINETIME_B		0x45274
Line 4772... Line 5066...
4772
#define SFUSE_STRAP				0xc2014
5066
#define SFUSE_STRAP				0xc2014
4773
#define  SFUSE_STRAP_DDIB_DETECTED	(1<<2)
5067
#define  SFUSE_STRAP_DDIB_DETECTED	(1<<2)
4774
#define  SFUSE_STRAP_DDIC_DETECTED	(1<<1)
5068
#define  SFUSE_STRAP_DDIC_DETECTED	(1<<1)
4775
#define  SFUSE_STRAP_DDID_DETECTED	(1<<0)
5069
#define  SFUSE_STRAP_DDID_DETECTED	(1<<0)
Line -... Line 5070...
-
 
5070
 
-
 
5071
#define WM_MISC				0x45260
-
 
5072
#define  WM_MISC_DATA_PARTITION_5_6	(1 << 0)
4776
 
5073
 
4777
#define WM_DBG				0x45280
5074
#define WM_DBG				0x45280
4778
#define  WM_DBG_DISALLOW_MULTIPLE_LP	(1<<0)
5075
#define  WM_DBG_DISALLOW_MULTIPLE_LP	(1<<0)
4779
#define  WM_DBG_DISALLOW_MAXFIFO	(1<<1)
5076
#define  WM_DBG_DISALLOW_MAXFIFO	(1<<1)
Line 4785... Line 5082...
4785
#define _PIPE_A_CSC_COEFF_RU_GU	0x49018
5082
#define _PIPE_A_CSC_COEFF_RU_GU	0x49018
4786
#define _PIPE_A_CSC_COEFF_BU	0x4901c
5083
#define _PIPE_A_CSC_COEFF_BU	0x4901c
4787
#define _PIPE_A_CSC_COEFF_RV_GV	0x49020
5084
#define _PIPE_A_CSC_COEFF_RV_GV	0x49020
4788
#define _PIPE_A_CSC_COEFF_BV	0x49024
5085
#define _PIPE_A_CSC_COEFF_BV	0x49024
4789
#define _PIPE_A_CSC_MODE	0x49028
5086
#define _PIPE_A_CSC_MODE	0x49028
-
 
5087
#define   CSC_BLACK_SCREEN_OFFSET	(1 << 2)
-
 
5088
#define   CSC_POSITION_BEFORE_GAMMA	(1 << 1)
-
 
5089
#define   CSC_MODE_YUV_TO_RGB		(1 << 0)
4790
#define _PIPE_A_CSC_PREOFF_HI	0x49030
5090
#define _PIPE_A_CSC_PREOFF_HI	0x49030
4791
#define _PIPE_A_CSC_PREOFF_ME	0x49034
5091
#define _PIPE_A_CSC_PREOFF_ME	0x49034
4792
#define _PIPE_A_CSC_PREOFF_LO	0x49038
5092
#define _PIPE_A_CSC_PREOFF_LO	0x49038
4793
#define _PIPE_A_CSC_POSTOFF_HI	0x49040
5093
#define _PIPE_A_CSC_POSTOFF_HI	0x49040
4794
#define _PIPE_A_CSC_POSTOFF_ME	0x49044
5094
#define _PIPE_A_CSC_POSTOFF_ME	0x49044
Line 4806... Line 5106...
4806
#define _PIPE_B_CSC_PREOFF_LO	0x49138
5106
#define _PIPE_B_CSC_PREOFF_LO	0x49138
4807
#define _PIPE_B_CSC_POSTOFF_HI	0x49140
5107
#define _PIPE_B_CSC_POSTOFF_HI	0x49140
4808
#define _PIPE_B_CSC_POSTOFF_ME	0x49144
5108
#define _PIPE_B_CSC_POSTOFF_ME	0x49144
4809
#define _PIPE_B_CSC_POSTOFF_LO	0x49148
5109
#define _PIPE_B_CSC_POSTOFF_LO	0x49148
Line 4810... Line -...
4810
 
-
 
4811
#define CSC_BLACK_SCREEN_OFFSET (1 << 2)
-
 
4812
#define CSC_POSITION_BEFORE_GAMMA (1 << 1)
-
 
4813
#define CSC_MODE_YUV_TO_RGB (1 << 0)
-
 
4814
 
5110
 
4815
#define PIPE_CSC_COEFF_RY_GY(pipe) _PIPE(pipe, _PIPE_A_CSC_COEFF_RY_GY, _PIPE_B_CSC_COEFF_RY_GY)
5111
#define PIPE_CSC_COEFF_RY_GY(pipe) _PIPE(pipe, _PIPE_A_CSC_COEFF_RY_GY, _PIPE_B_CSC_COEFF_RY_GY)
4816
#define PIPE_CSC_COEFF_BY(pipe) _PIPE(pipe, _PIPE_A_CSC_COEFF_BY, _PIPE_B_CSC_COEFF_BY)
5112
#define PIPE_CSC_COEFF_BY(pipe) _PIPE(pipe, _PIPE_A_CSC_COEFF_BY, _PIPE_B_CSC_COEFF_BY)
4817
#define PIPE_CSC_COEFF_RU_GU(pipe) _PIPE(pipe, _PIPE_A_CSC_COEFF_RU_GU, _PIPE_B_CSC_COEFF_RU_GU)
5113
#define PIPE_CSC_COEFF_RU_GU(pipe) _PIPE(pipe, _PIPE_A_CSC_COEFF_RU_GU, _PIPE_B_CSC_COEFF_RU_GU)
4818
#define PIPE_CSC_COEFF_BU(pipe) _PIPE(pipe, _PIPE_A_CSC_COEFF_BU, _PIPE_B_CSC_COEFF_BU)
5114
#define PIPE_CSC_COEFF_BU(pipe) _PIPE(pipe, _PIPE_A_CSC_COEFF_BU, _PIPE_B_CSC_COEFF_BU)