xref: /linux/drivers/gpu/drm/i915/gt/intel_gt_regs.h (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
10d6419e9SMatt Roper /* SPDX-License-Identifier: MIT */
20d6419e9SMatt Roper /*
30d6419e9SMatt Roper  * Copyright © 2022 Intel Corporation
40d6419e9SMatt Roper  */
50d6419e9SMatt Roper 
60d6419e9SMatt Roper #ifndef __INTEL_GT_REGS__
70d6419e9SMatt Roper #define __INTEL_GT_REGS__
80d6419e9SMatt Roper 
90d6419e9SMatt Roper #include "i915_reg_defs.h"
106e4e9fbdSJani Nikula 
116e4e9fbdSJani Nikula #define VLV_GUNIT_BASE			0x180000
120d6419e9SMatt Roper 
1358bc2453SMatt Roper /*
1458bc2453SMatt Roper  * The perf control registers are technically multicast registers, but the
1558bc2453SMatt Roper  * driver never needs to read/write them directly; we only use them to build
1658bc2453SMatt Roper  * lists of registers (where they're mixed in with other non-MCR registers)
1758bc2453SMatt Roper  * and then operate on the offset directly.  For now we'll just define them
1858bc2453SMatt Roper  * as non-multicast so we can place them on the same list, but we may want
1958bc2453SMatt Roper  * to try to come up with a better way to handle heterogeneous lists of
2058bc2453SMatt Roper  * registers in the future.
2158bc2453SMatt Roper  */
2258bc2453SMatt Roper #define PERF_REG(offset)			_MMIO(offset)
23a9e69428SMatt Roper 
2422009b6dSBadal Nilawar /* MTL workpoint reg to get core C state and actual freq of 3D, SAMedia */
2522009b6dSBadal Nilawar #define MTL_MIRROR_TARGET_WP1			_MMIO(0xc60)
2622009b6dSBadal Nilawar #define   MTL_CAGF_MASK				REG_GENMASK(8, 0)
274bb9ca7eSBadal Nilawar #define   MTL_CC0				0x0
284bb9ca7eSBadal Nilawar #define   MTL_CC6				0x3
29b17e6840SBadal Nilawar #define   MTL_CC_MASK				REG_GENMASK(10, 9)
3022009b6dSBadal Nilawar 
310d53879fSMatt Roper /* RPM unit config (Gen8+) */
320d53879fSMatt Roper #define RPM_CONFIG0				_MMIO(0xd00)
330d53879fSMatt Roper #define   GEN9_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_SHIFT	3
340d53879fSMatt Roper #define   GEN9_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_MASK	(1 << GEN9_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_SHIFT)
350d53879fSMatt Roper #define   GEN9_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_19_2_MHZ	0
360d53879fSMatt Roper #define   GEN9_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_24_MHZ	1
370d53879fSMatt Roper #define   GEN11_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_SHIFT	3
380d53879fSMatt Roper #define   GEN11_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_MASK	(0x7 << GEN11_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_SHIFT)
390d53879fSMatt Roper #define   GEN11_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_24_MHZ	0
400d53879fSMatt Roper #define   GEN11_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_19_2_MHZ	1
410d53879fSMatt Roper #define   GEN11_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_38_4_MHZ	2
420d53879fSMatt Roper #define   GEN11_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_25_MHZ	3
430d53879fSMatt Roper #define   GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_SHIFT	1
440d53879fSMatt Roper #define   GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK	(0x3 << GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_SHIFT)
450d53879fSMatt Roper 
460d53879fSMatt Roper #define RPM_CONFIG1				_MMIO(0xd04)
470d53879fSMatt Roper #define   GEN10_GT_NOA_ENABLE			(1 << 9)
480d53879fSMatt Roper 
490d53879fSMatt Roper /* RCP unit config (Gen8+) */
500d53879fSMatt Roper #define RCP_CONFIG				_MMIO(0xd08)
510d53879fSMatt Roper 
520d53879fSMatt Roper #define RC6_LOCATION				_MMIO(0xd40)
530d53879fSMatt Roper #define   RC6_CTX_IN_DRAM			(1 << 0)
540d53879fSMatt Roper #define RC6_CTX_BASE				_MMIO(0xd48)
550d53879fSMatt Roper #define   RC6_CTX_BASE_MASK			0xFFFFFFF0
560d53879fSMatt Roper 
570d53879fSMatt Roper #define FORCEWAKE_ACK_MEDIA_VDBOX_GEN11(n)	_MMIO(0xd50 + (n) * 4)
580d53879fSMatt Roper #define FORCEWAKE_ACK_MEDIA_VEBOX_GEN11(n)	_MMIO(0xd70 + (n) * 4)
590d53879fSMatt Roper #define FORCEWAKE_ACK_RENDER_GEN9		_MMIO(0xd84)
600d53879fSMatt Roper #define FORCEWAKE_ACK_MEDIA_GEN9		_MMIO(0xd88)
610d53879fSMatt Roper 
6214f2f9bfSMatt Roper #define FORCEWAKE_ACK_GSC			_MMIO(0xdf8)
6314f2f9bfSMatt Roper #define FORCEWAKE_ACK_GT_MTL			_MMIO(0xdfc)
6414f2f9bfSMatt Roper 
65c2c70752SMatt Roper #define GMD_ID_GRAPHICS				_MMIO(0xd8c)
66c2c70752SMatt Roper #define GMD_ID_MEDIA				_MMIO(MTL_MEDIA_GSI_BASE + 0xd8c)
67c2c70752SMatt Roper 
680d53879fSMatt Roper #define MCFG_MCR_SELECTOR			_MMIO(0xfd0)
693100240bSMatt Roper #define MTL_STEER_SEMAPHORE			_MMIO(0xfd0)
70f32898c9SMatt Roper #define MTL_MCR_SELECTOR			_MMIO(0xfd4)
710d53879fSMatt Roper #define SF_MCR_SELECTOR				_MMIO(0xfd8)
720d53879fSMatt Roper #define GEN8_MCR_SELECTOR			_MMIO(0xfdc)
7307a70f38SMatt Roper #define GAM_MCR_SELECTOR			_MMIO(0xfe0)
740d53879fSMatt Roper #define   GEN8_MCR_SLICE(slice)			(((slice) & 3) << 26)
750d53879fSMatt Roper #define   GEN8_MCR_SLICE_MASK			GEN8_MCR_SLICE(3)
760d53879fSMatt Roper #define   GEN8_MCR_SUBSLICE(subslice)		(((subslice) & 3) << 24)
770d53879fSMatt Roper #define   GEN8_MCR_SUBSLICE_MASK		GEN8_MCR_SUBSLICE(3)
7831a86f00SMatt Roper #define   GEN11_MCR_MULTICAST			REG_BIT(31)
790d53879fSMatt Roper #define   GEN11_MCR_SLICE(slice)		(((slice) & 0xf) << 27)
800d53879fSMatt Roper #define   GEN11_MCR_SLICE_MASK			GEN11_MCR_SLICE(0xf)
810d53879fSMatt Roper #define   GEN11_MCR_SUBSLICE(subslice)		(((subslice) & 0x7) << 24)
820d53879fSMatt Roper #define   GEN11_MCR_SUBSLICE_MASK		GEN11_MCR_SUBSLICE(0x7)
83f32898c9SMatt Roper #define   MTL_MCR_GROUPID			REG_GENMASK(11, 8)
84f32898c9SMatt Roper #define   MTL_MCR_INSTANCEID			REG_GENMASK(3, 0)
850d53879fSMatt Roper 
860d53879fSMatt Roper #define IPEIR_I965				_MMIO(0x2064)
870d53879fSMatt Roper #define IPEHR_I965				_MMIO(0x2068)
880d53879fSMatt Roper 
890d53879fSMatt Roper /*
900d53879fSMatt Roper  * On GEN4, only the render ring INSTDONE exists and has a different
910d53879fSMatt Roper  * layout than the GEN7+ version.
920d53879fSMatt Roper  * The GEN2 counterpart of this register is GEN2_INSTDONE.
930d53879fSMatt Roper  */
940d53879fSMatt Roper #define INSTPS					_MMIO(0x2070) /* 965+ only */
950d53879fSMatt Roper #define GEN4_INSTDONE1				_MMIO(0x207c) /* 965+ only, aka INSTDONE_2 on SNB */
960d53879fSMatt Roper #define ACTHD_I965				_MMIO(0x2074)
970d53879fSMatt Roper #define HWS_PGA					_MMIO(0x2080)
980d53879fSMatt Roper #define   HWS_ADDRESS_MASK			0xfffff000
990d53879fSMatt Roper #define   HWS_START_ADDRESS_SHIFT		4
1000d53879fSMatt Roper 
1010d53879fSMatt Roper #define _3D_CHICKEN				_MMIO(0x2084)
1020d53879fSMatt Roper #define   _3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB	(1 << 10)
1030d53879fSMatt Roper 
1040d53879fSMatt Roper #define PWRCTXA					_MMIO(0x2088) /* 965GM+ only */
1050d53879fSMatt Roper #define   PWRCTX_EN				(1 << 0)
1060d53879fSMatt Roper 
1070d53879fSMatt Roper #define FF_SLICE_CHICKEN			_MMIO(0x2088)
1080d53879fSMatt Roper #define   FF_SLICE_CHICKEN_CL_PROVOKING_VERTEX_FIX	(1 << 1)
1090d53879fSMatt Roper 
1100d53879fSMatt Roper /* GM45+ chicken bits -- debug workaround bits that may be required
1110d53879fSMatt Roper  * for various sorts of correct behavior.  The top 16 bits of each are
1120d53879fSMatt Roper  * the enables for writing to the corresponding low bit.
1130d53879fSMatt Roper  */
1140d53879fSMatt Roper #define _3D_CHICKEN2				_MMIO(0x208c)
1150d53879fSMatt Roper /* Disables pipelining of read flushes past the SF-WIZ interface.
1160d53879fSMatt Roper  * Required on all Ironlake steppings according to the B-Spec, but the
1170d53879fSMatt Roper  * particular danger of not doing so is not specified.
1180d53879fSMatt Roper  */
1190d53879fSMatt Roper #define   _3D_CHICKEN2_WM_READ_PIPELINED	(1 << 14)
1200d53879fSMatt Roper 
1210d53879fSMatt Roper #define _3D_CHICKEN3				_MMIO(0x2090)
1220d53879fSMatt Roper #define   _3D_CHICKEN_SF_PROVOKING_VERTEX_FIX	(1 << 12)
1230d53879fSMatt Roper #define   _3D_CHICKEN_SF_DISABLE_OBJEND_CULL	(1 << 10)
1240d53879fSMatt Roper #define   _3D_CHICKEN3_AA_LINE_QUALITY_FIX_ENABLE	(1 << 5)
1250d53879fSMatt Roper #define   _3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL	(1 << 5)
1260d53879fSMatt Roper #define   _3D_CHICKEN_SDE_LIMIT_FIFO_POLY_DEPTH(x)	((x) << 1) /* gen8+ */
1270d53879fSMatt Roper #define   _3D_CHICKEN3_SF_DISABLE_PIPELINED_ATTR_FETCH	(1 << 1) /* gen6 */
1280d53879fSMatt Roper 
1290d53879fSMatt Roper #define GEN2_INSTDONE				_MMIO(0x2090)
1300d53879fSMatt Roper #define NOPID					_MMIO(0x2094)
1310d53879fSMatt Roper #define HWSTAM					_MMIO(0x2098)
1320d53879fSMatt Roper 
1330d53879fSMatt Roper #define WAIT_FOR_RC6_EXIT			_MMIO(0x20cc)
1340d53879fSMatt Roper /* HSW only */
1350d53879fSMatt Roper #define   HSW_SELECTIVE_READ_ADDRESSING_SHIFT	2
1360d53879fSMatt Roper #define   HSW_SELECTIVE_READ_ADDRESSING_MASK	(0x3 << HSW_SLECTIVE_READ_ADDRESSING_SHIFT)
1370d53879fSMatt Roper #define   HSW_SELECTIVE_WRITE_ADDRESS_SHIFT	4
1380d53879fSMatt Roper #define   HSW_SELECTIVE_WRITE_ADDRESS_MASK	(0x7 << HSW_SELECTIVE_WRITE_ADDRESS_SHIFT)
1390d53879fSMatt Roper /* HSW+ */
1400d53879fSMatt Roper #define   HSW_WAIT_FOR_RC6_EXIT_ENABLE		(1 << 0)
1410d53879fSMatt Roper #define   HSW_RCS_CONTEXT_ENABLE		(1 << 7)
1420d53879fSMatt Roper #define   HSW_RCS_INHIBIT			(1 << 8)
1430d53879fSMatt Roper /* Gen8 */
1440d53879fSMatt Roper #define   GEN8_SELECTIVE_WRITE_ADDRESS_SHIFT	4
1450d53879fSMatt Roper #define   GEN8_SELECTIVE_WRITE_ADDRESS_MASK	(0x3 << GEN8_SELECTIVE_WRITE_ADDRESS_SHIFT)
1460d53879fSMatt Roper #define   GEN8_SELECTIVE_WRITE_ADDRESS_SHIFT	4
1470d53879fSMatt Roper #define   GEN8_SELECTIVE_WRITE_ADDRESS_MASK	(0x3 << GEN8_SELECTIVE_WRITE_ADDRESS_SHIFT)
1480d53879fSMatt Roper #define   GEN8_SELECTIVE_WRITE_ADDRESSING_ENABLE	(1 << 6)
1490d53879fSMatt Roper #define   GEN8_SELECTIVE_READ_SUBSLICE_SELECT_SHIFT	9
1500d53879fSMatt Roper #define   GEN8_SELECTIVE_READ_SUBSLICE_SELECT_MASK	(0x3 << GEN8_SELECTIVE_READ_SUBSLICE_SELECT_SHIFT)
1510d53879fSMatt Roper #define   GEN8_SELECTIVE_READ_SLICE_SELECT_SHIFT	11
1520d53879fSMatt Roper #define   GEN8_SELECTIVE_READ_SLICE_SELECT_MASK	(0x3 << GEN8_SELECTIVE_READ_SLICE_SELECT_SHIFT)
1530d53879fSMatt Roper #define   GEN8_SELECTIVE_READ_ADDRESSING_ENABLE	(1 << 13)
1540d53879fSMatt Roper 
1550d53879fSMatt Roper #define GEN6_GT_MODE				_MMIO(0x20d0)
1560d53879fSMatt Roper #define   GEN6_WIZ_HASHING(hi, lo)		(((hi) << 9) | ((lo) << 7))
1570d53879fSMatt Roper #define   GEN6_WIZ_HASHING_8x8			GEN6_WIZ_HASHING(0, 0)
1580d53879fSMatt Roper #define   GEN6_WIZ_HASHING_8x4			GEN6_WIZ_HASHING(0, 1)
1590d53879fSMatt Roper #define   GEN6_WIZ_HASHING_16x4			GEN6_WIZ_HASHING(1, 0)
1600d53879fSMatt Roper #define   GEN6_WIZ_HASHING_MASK			GEN6_WIZ_HASHING(1, 1)
1610d53879fSMatt Roper #define   GEN6_TD_FOUR_ROW_DISPATCH_DISABLE	(1 << 5)
1620d53879fSMatt Roper 
1630d53879fSMatt Roper /* chicken reg for WaConextSwitchWithConcurrentTLBInvalidate */
1640d53879fSMatt Roper #define GEN9_CSFE_CHICKEN1_RCS			_MMIO(0x20d4)
1650d53879fSMatt Roper #define   GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE	(1 << 2)
1660d53879fSMatt Roper #define   GEN11_ENABLE_32_PLANE_MODE		(1 << 7)
16798fa06e4SDnyaneshwar Bhadane #define GEN12_CS_DEBUG_MODE2			_MMIO(0x20d8)
16898fa06e4SDnyaneshwar Bhadane #define   INSTRUCTION_STATE_CACHE_INVALIDATE	REG_BIT(6)
1690d53879fSMatt Roper 
1700d53879fSMatt Roper #define GEN7_FF_SLICE_CS_CHICKEN1		_MMIO(0x20e0)
1710d53879fSMatt Roper #define   GEN9_FFSC_PERCTX_PREEMPT_CTRL		(1 << 14)
1720d53879fSMatt Roper 
1730d53879fSMatt Roper #define FF_SLICE_CS_CHICKEN2			_MMIO(0x20e4)
1740d53879fSMatt Roper #define   GEN9_TSG_BARRIER_ACK_DISABLE		(1 << 8)
1750d53879fSMatt Roper #define   GEN9_POOLED_EU_LOAD_BALANCING_FIX_DISABLE	(1 << 10)
176c5cb0002SMatt Roper #define   GEN12_PERF_FIX_BALANCING_CFE_DISABLE	REG_BIT(15)
1770d53879fSMatt Roper 
1780d53879fSMatt Roper #define GEN9_CS_DEBUG_MODE1			_MMIO(0x20ec)
1790d53879fSMatt Roper #define   FF_DOP_CLOCK_GATE_DISABLE		REG_BIT(1)
1800d53879fSMatt Roper #define GEN12_CS_DEBUG_MODE1_CCCSUNIT_BE_COMMON	_MMIO(0x20ec)
1810d53879fSMatt Roper #define   GEN12_REPLAY_MODE_GRANULARITY		REG_BIT(0)
1820d53879fSMatt Roper 
1830d53879fSMatt Roper /* WaClearTdlStateAckDirtyBits */
1840d53879fSMatt Roper #define GEN8_STATE_ACK				_MMIO(0x20f0)
1850d53879fSMatt Roper #define GEN9_STATE_ACK_SLICE1			_MMIO(0x20f8)
1860d53879fSMatt Roper #define GEN9_STATE_ACK_SLICE2			_MMIO(0x2100)
1870d53879fSMatt Roper #define   GEN9_STATE_ACK_TDL0			(1 << 12)
1880d53879fSMatt Roper #define   GEN9_STATE_ACK_TDL1			(1 << 13)
1890d53879fSMatt Roper #define   GEN9_STATE_ACK_TDL2			(1 << 14)
1900d53879fSMatt Roper #define   GEN9_STATE_ACK_TDL3			(1 << 15)
1910d53879fSMatt Roper #define   GEN9_SUBSLICE_TDL_ACK_BITS	\
1920d53879fSMatt Roper 	(GEN9_STATE_ACK_TDL3 | GEN9_STATE_ACK_TDL2 | \
1930d53879fSMatt Roper 	 GEN9_STATE_ACK_TDL1 | GEN9_STATE_ACK_TDL0)
1940d53879fSMatt Roper 
1950d53879fSMatt Roper #define CACHE_MODE_0				_MMIO(0x2120) /* 915+ only */
1960d53879fSMatt Roper #define   CM0_PIPELINED_RENDER_FLUSH_DISABLE	(1 << 8)
1970d53879fSMatt Roper #define   CM0_IZ_OPT_DISABLE			(1 << 6)
1980d53879fSMatt Roper #define   CM0_ZR_OPT_DISABLE			(1 << 5)
1990d53879fSMatt Roper #define	  CM0_STC_EVICT_DISABLE_LRA_SNB		(1 << 5)
2000d53879fSMatt Roper #define   CM0_DEPTH_EVICT_DISABLE		(1 << 4)
2010d53879fSMatt Roper #define   CM0_COLOR_EVICT_DISABLE		(1 << 3)
2020d53879fSMatt Roper #define   CM0_DEPTH_WRITE_DISABLE		(1 << 1)
2030d53879fSMatt Roper #define   CM0_RC_OP_FLUSH_DISABLE		(1 << 0)
2040d53879fSMatt Roper 
2050d53879fSMatt Roper #define GFX_FLSH_CNTL				_MMIO(0x2170) /* 915+ only */
2060d53879fSMatt Roper 
2070d53879fSMatt Roper /*
2080d53879fSMatt Roper  * Logical Context regs
2090d53879fSMatt Roper  */
2100d53879fSMatt Roper /*
2110d53879fSMatt Roper  * Notes on SNB/IVB/VLV context size:
2120d53879fSMatt Roper  * - Power context is saved elsewhere (LLC or stolen)
2130d53879fSMatt Roper  * - Ring/execlist context is saved on SNB, not on IVB
2140d53879fSMatt Roper  * - Extended context size already includes render context size
2150d53879fSMatt Roper  * - We always need to follow the extended context size.
2160d53879fSMatt Roper  *   SNB BSpec has comments indicating that we should use the
2170d53879fSMatt Roper  *   render context size instead if execlists are disabled, but
2180d53879fSMatt Roper  *   based on empirical testing that's just nonsense.
2190d53879fSMatt Roper  * - Pipelined/VF state is saved on SNB/IVB respectively
2200d53879fSMatt Roper  * - GT1 size just indicates how much of render context
2210d53879fSMatt Roper  *   doesn't need saving on GT1
2220d53879fSMatt Roper  */
2230d53879fSMatt Roper #define CXT_SIZE				_MMIO(0x21a0)
2240d53879fSMatt Roper #define   GEN6_CXT_POWER_SIZE(cxt_reg)		(((cxt_reg) >> 24) & 0x3f)
2250d53879fSMatt Roper #define   GEN6_CXT_RING_SIZE(cxt_reg)		(((cxt_reg) >> 18) & 0x3f)
2260d53879fSMatt Roper #define   GEN6_CXT_RENDER_SIZE(cxt_reg)		(((cxt_reg) >> 12) & 0x3f)
2270d53879fSMatt Roper #define   GEN6_CXT_EXTENDED_SIZE(cxt_reg)	(((cxt_reg) >> 6) & 0x3f)
2280d53879fSMatt Roper #define   GEN6_CXT_PIPELINE_SIZE(cxt_reg)	(((cxt_reg) >> 0) & 0x3f)
2290d53879fSMatt Roper #define   GEN6_CXT_TOTAL_SIZE(cxt_reg)		(GEN6_CXT_RING_SIZE(cxt_reg) + \
2300d53879fSMatt Roper 						GEN6_CXT_EXTENDED_SIZE(cxt_reg) + \
2310d53879fSMatt Roper 						GEN6_CXT_PIPELINE_SIZE(cxt_reg))
2320d53879fSMatt Roper #define GEN7_CXT_SIZE				_MMIO(0x21a8)
2330d53879fSMatt Roper #define   GEN7_CXT_POWER_SIZE(ctx_reg)		(((ctx_reg) >> 25) & 0x7f)
2340d53879fSMatt Roper #define   GEN7_CXT_RING_SIZE(ctx_reg)		(((ctx_reg) >> 22) & 0x7)
2350d53879fSMatt Roper #define   GEN7_CXT_RENDER_SIZE(ctx_reg)		(((ctx_reg) >> 16) & 0x3f)
2360d53879fSMatt Roper #define   GEN7_CXT_EXTENDED_SIZE(ctx_reg)	(((ctx_reg) >> 9) & 0x7f)
2370d53879fSMatt Roper #define   GEN7_CXT_GT1_SIZE(ctx_reg)		(((ctx_reg) >> 6) & 0x7)
2380d53879fSMatt Roper #define   GEN7_CXT_VFSTATE_SIZE(ctx_reg)	(((ctx_reg) >> 0) & 0x3f)
2390d53879fSMatt Roper #define   GEN7_CXT_TOTAL_SIZE(ctx_reg)		(GEN7_CXT_EXTENDED_SIZE(ctx_reg) + \
2400d53879fSMatt Roper 						 GEN7_CXT_VFSTATE_SIZE(ctx_reg))
2410d53879fSMatt Roper 
2420d53879fSMatt Roper #define HSW_MI_PREDICATE_RESULT_2		_MMIO(0x2214)
2430d53879fSMatt Roper 
2440d53879fSMatt Roper #define GEN9_CTX_PREEMPT_REG			_MMIO(0x2248)
2450d53879fSMatt Roper #define   GEN12_DISABLE_POSH_BUSY_FF_DOP_CG	REG_BIT(11)
2460d53879fSMatt Roper 
2470d53879fSMatt Roper #define GPGPU_THREADS_DISPATCHED		_MMIO(0x2290)
2480d53879fSMatt Roper #define GPGPU_THREADS_DISPATCHED_UDW		_MMIO(0x2290 + 4)
2490d53879fSMatt Roper 
2500d53879fSMatt Roper #define GEN9_RCS_FE_FSM2			_MMIO(0x22a4)
2510d53879fSMatt Roper #define GEN6_RCS_PWR_FSM			_MMIO(0x22ac)
2520d53879fSMatt Roper 
2530d53879fSMatt Roper #define HS_INVOCATION_COUNT			_MMIO(0x2300)
2540d53879fSMatt Roper #define HS_INVOCATION_COUNT_UDW			_MMIO(0x2300 + 4)
2550d53879fSMatt Roper #define DS_INVOCATION_COUNT			_MMIO(0x2308)
2560d53879fSMatt Roper #define DS_INVOCATION_COUNT_UDW			_MMIO(0x2308 + 4)
2570d53879fSMatt Roper #define IA_VERTICES_COUNT			_MMIO(0x2310)
2580d53879fSMatt Roper #define IA_VERTICES_COUNT_UDW			_MMIO(0x2310 + 4)
2590d53879fSMatt Roper #define IA_PRIMITIVES_COUNT			_MMIO(0x2318)
2600d53879fSMatt Roper #define IA_PRIMITIVES_COUNT_UDW			_MMIO(0x2318 + 4)
2610d53879fSMatt Roper #define VS_INVOCATION_COUNT			_MMIO(0x2320)
2620d53879fSMatt Roper #define VS_INVOCATION_COUNT_UDW			_MMIO(0x2320 + 4)
2630d53879fSMatt Roper #define GS_INVOCATION_COUNT			_MMIO(0x2328)
2640d53879fSMatt Roper #define GS_INVOCATION_COUNT_UDW			_MMIO(0x2328 + 4)
2650d53879fSMatt Roper #define GS_PRIMITIVES_COUNT			_MMIO(0x2330)
2660d53879fSMatt Roper #define GS_PRIMITIVES_COUNT_UDW			_MMIO(0x2330 + 4)
2670d53879fSMatt Roper #define CL_INVOCATION_COUNT			_MMIO(0x2338)
2680d53879fSMatt Roper #define CL_INVOCATION_COUNT_UDW			_MMIO(0x2338 + 4)
2690d53879fSMatt Roper #define CL_PRIMITIVES_COUNT			_MMIO(0x2340)
2700d53879fSMatt Roper #define CL_PRIMITIVES_COUNT_UDW			_MMIO(0x2340 + 4)
2710d53879fSMatt Roper #define PS_INVOCATION_COUNT			_MMIO(0x2348)
2720d53879fSMatt Roper #define PS_INVOCATION_COUNT_UDW			_MMIO(0x2348 + 4)
2730d53879fSMatt Roper #define PS_DEPTH_COUNT				_MMIO(0x2350)
2740d53879fSMatt Roper #define PS_DEPTH_COUNT_UDW			_MMIO(0x2350 + 4)
2750d53879fSMatt Roper #define GEN7_3DPRIM_END_OFFSET			_MMIO(0x2420)
2760d53879fSMatt Roper #define GEN7_3DPRIM_START_VERTEX		_MMIO(0x2430)
2770d53879fSMatt Roper #define GEN7_3DPRIM_VERTEX_COUNT		_MMIO(0x2434)
2780d53879fSMatt Roper #define GEN7_3DPRIM_INSTANCE_COUNT		_MMIO(0x2438)
2790d53879fSMatt Roper #define GEN7_3DPRIM_START_INSTANCE		_MMIO(0x243c)
2800d53879fSMatt Roper #define GEN7_3DPRIM_BASE_VERTEX			_MMIO(0x2440)
2810d53879fSMatt Roper #define GEN7_GPGPU_DISPATCHDIMX			_MMIO(0x2500)
2820d53879fSMatt Roper #define GEN7_GPGPU_DISPATCHDIMY			_MMIO(0x2504)
2830d53879fSMatt Roper #define GEN7_GPGPU_DISPATCHDIMZ			_MMIO(0x2508)
2840d53879fSMatt Roper 
2850d53879fSMatt Roper #define GFX_MODE				_MMIO(0x2520)
2860d53879fSMatt Roper 
2870d53879fSMatt Roper #define GEN8_CS_CHICKEN1			_MMIO(0x2580)
2880d53879fSMatt Roper #define   GEN9_PREEMPT_3D_OBJECT_LEVEL		(1 << 0)
2890d53879fSMatt Roper #define   GEN9_PREEMPT_GPGPU_LEVEL(hi, lo)	(((hi) << 2) | ((lo) << 1))
2900d53879fSMatt Roper #define   GEN9_PREEMPT_GPGPU_MID_THREAD_LEVEL	GEN9_PREEMPT_GPGPU_LEVEL(0, 0)
2910d53879fSMatt Roper #define   GEN9_PREEMPT_GPGPU_THREAD_GROUP_LEVEL	GEN9_PREEMPT_GPGPU_LEVEL(0, 1)
2920d53879fSMatt Roper #define   GEN9_PREEMPT_GPGPU_COMMAND_LEVEL	GEN9_PREEMPT_GPGPU_LEVEL(1, 0)
2930d53879fSMatt Roper #define   GEN9_PREEMPT_GPGPU_LEVEL_MASK		GEN9_PREEMPT_GPGPU_LEVEL(1, 1)
2940d53879fSMatt Roper 
2956dc85721SMatt Roper #define DRAW_WATERMARK				_MMIO(0x26c0)
2966dc85721SMatt Roper #define   VERT_WM_VAL				REG_GENMASK(9, 0)
2976dc85721SMatt Roper 
2980d53879fSMatt Roper #define GEN12_GLOBAL_MOCS(i)			_MMIO(0x4000 + (i) * 4) /* Global MOCS regs */
2990d53879fSMatt Roper 
3000d53879fSMatt Roper #define RENDER_HWS_PGA_GEN7			_MMIO(0x4080)
3010d53879fSMatt Roper 
3020d53879fSMatt Roper #define GEN8_GAMW_ECO_DEV_RW_IA			_MMIO(0x4080)
3030d53879fSMatt Roper #define   GAMW_ECO_ENABLE_64K_IPS_FIELD		0xF
3040d53879fSMatt Roper #define   GAMW_ECO_DEV_CTX_RELOAD_DISABLE	(1 << 7)
3050d53879fSMatt Roper 
3060d53879fSMatt Roper #define GAM_ECOCHK				_MMIO(0x4090)
3070d53879fSMatt Roper #define   BDW_DISABLE_HDC_INVALIDATION		(1 << 25)
3080d53879fSMatt Roper #define   ECOCHK_SNB_BIT			(1 << 10)
3090d53879fSMatt Roper #define   ECOCHK_DIS_TLB			(1 << 8)
3100d53879fSMatt Roper #define   HSW_ECOCHK_ARB_PRIO_SOL		(1 << 6)
3110d53879fSMatt Roper #define   ECOCHK_PPGTT_CACHE64B			(0x3 << 3)
3120d53879fSMatt Roper #define   ECOCHK_PPGTT_CACHE4B			(0x0 << 3)
3130d53879fSMatt Roper #define   ECOCHK_PPGTT_GFDT_IVB			(0x1 << 4)
3140d53879fSMatt Roper #define   ECOCHK_PPGTT_LLC_IVB			(0x1 << 3)
3150d53879fSMatt Roper #define   ECOCHK_PPGTT_UC_HSW			(0x1 << 3)
3160d53879fSMatt Roper #define   ECOCHK_PPGTT_WT_HSW			(0x2 << 3)
3170d53879fSMatt Roper #define   ECOCHK_PPGTT_WB_HSW			(0x3 << 3)
3180d53879fSMatt Roper 
3190d53879fSMatt Roper #define GEN8_RING_FAULT_REG			_MMIO(0x4094)
3200d53879fSMatt Roper #define _RING_FAULT_REG_RCS			0x4094
3210d53879fSMatt Roper #define _RING_FAULT_REG_VCS			0x4194
3220d53879fSMatt Roper #define _RING_FAULT_REG_BCS			0x4294
3230d53879fSMatt Roper #define _RING_FAULT_REG_VECS			0x4394
3240d53879fSMatt Roper #define RING_FAULT_REG(engine)			_MMIO(_PICK((engine)->class, \
3250d53879fSMatt Roper 							    _RING_FAULT_REG_RCS, \
3260d53879fSMatt Roper 							    _RING_FAULT_REG_VCS, \
3270d53879fSMatt Roper 							    _RING_FAULT_REG_VECS, \
3280d53879fSMatt Roper 							    _RING_FAULT_REG_BCS))
3290d53879fSMatt Roper 
3300d53879fSMatt Roper #define ERROR_GEN6				_MMIO(0x40a0)
3310d53879fSMatt Roper 
3320d53879fSMatt Roper #define DONE_REG				_MMIO(0x40b0)
3330d53879fSMatt Roper #define GEN8_PRIVATE_PAT_LO			_MMIO(0x40e0)
3340d53879fSMatt Roper #define GEN8_PRIVATE_PAT_HI			_MMIO(0x40e0 + 4)
3350d53879fSMatt Roper #define GEN10_PAT_INDEX(index)			_MMIO(0x40e0 + (index) * 4)
3360d53879fSMatt Roper #define BSD_HWS_PGA_GEN7			_MMIO(0x4180)
3372f0b927dSAndi Shyti 
3382f0b927dSAndi Shyti #define GEN12_CCS_AUX_INV			_MMIO(0x4208)
3392f0b927dSAndi Shyti #define GEN12_VD0_AUX_INV			_MMIO(0x4218)
3402f0b927dSAndi Shyti #define GEN12_VE0_AUX_INV			_MMIO(0x4238)
3412f0b927dSAndi Shyti #define GEN12_BCS0_AUX_INV			_MMIO(0x4248)
3420d53879fSMatt Roper 
3430d53879fSMatt Roper #define GEN8_RTCR				_MMIO(0x4260)
3440d53879fSMatt Roper #define GEN8_M1TCR				_MMIO(0x4264)
3450d53879fSMatt Roper #define GEN8_M2TCR				_MMIO(0x4268)
3460d53879fSMatt Roper #define GEN8_BTCR				_MMIO(0x426c)
3470d53879fSMatt Roper #define GEN8_VTCR				_MMIO(0x4270)
3480d53879fSMatt Roper 
3490d53879fSMatt Roper #define BLT_HWS_PGA_GEN7			_MMIO(0x4280)
3500d53879fSMatt Roper 
3512f0b927dSAndi Shyti #define GEN12_VD2_AUX_INV			_MMIO(0x4298)
3522f0b927dSAndi Shyti #define GEN12_CCS0_AUX_INV			_MMIO(0x42c8)
3530d53879fSMatt Roper #define   AUX_INV				REG_BIT(0)
3542f0b927dSAndi Shyti 
3550d53879fSMatt Roper #define VEBOX_HWS_PGA_GEN7			_MMIO(0x4380)
3560d53879fSMatt Roper 
3570d53879fSMatt Roper #define GEN12_AUX_ERR_DBG			_MMIO(0x43f4)
3580d53879fSMatt Roper 
3590d53879fSMatt Roper #define GEN7_TLB_RD_ADDR			_MMIO(0x4700)
3600d53879fSMatt Roper 
3610d53879fSMatt Roper #define GEN12_PAT_INDEX(index)			_MMIO(0x4800 + (index) * 4)
362b76c0deeSMadhumitha Tolakanahalli Pradeep #define _PAT_INDEX(index)			_PICK_EVEN_2RANGES(index, 8, \
363b76c0deeSMadhumitha Tolakanahalli Pradeep 								   0x4800, 0x4804, \
364b76c0deeSMadhumitha Tolakanahalli Pradeep 								   0x4848, 0x484c)
365b76c0deeSMadhumitha Tolakanahalli Pradeep #define XEHP_PAT_INDEX(index)			MCR_REG(_PAT_INDEX(index))
366b76c0deeSMadhumitha Tolakanahalli Pradeep #define XELPMP_PAT_INDEX(index)			_MMIO(_PAT_INDEX(index))
3670d53879fSMatt Roper 
368a9e69428SMatt Roper #define XEHP_TILE0_ADDR_RANGE			MCR_REG(0x4900)
3697d809707SMatt Roper #define   XEHP_TILE_LMEM_RANGE_SHIFT		8
3708524bb67SMatt Roper 
371a9e69428SMatt Roper #define XEHP_FLAT_CCS_BASE_ADDR			MCR_REG(0x4910)
3727d809707SMatt Roper #define   XEHP_CCS_BASE_SHIFT			8
37330424ebaSRodrigo Vivi 
3740d53879fSMatt Roper #define GAMTARBMODE				_MMIO(0x4a08)
3750d53879fSMatt Roper #define   ARB_MODE_BWGTLB_DISABLE		(1 << 9)
3760d53879fSMatt Roper #define   ARB_MODE_SWIZZLE_BDW			(1 << 1)
3770d53879fSMatt Roper 
3780d53879fSMatt Roper #define GEN9_GAMT_ECO_REG_RW_IA			_MMIO(0x4ab0)
3790d53879fSMatt Roper #define   GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS	(1 << 18)
3800d53879fSMatt Roper 
3810d53879fSMatt Roper #define GAMT_CHKN_BIT_REG			_MMIO(0x4ab8)
3820d53879fSMatt Roper #define   GAMT_CHKN_DISABLE_L3_COH_PIPE		(1 << 31)
3830d53879fSMatt Roper #define   GAMT_CHKN_DISABLE_DYNAMIC_CREDIT_SHARING	(1 << 28)
3840d53879fSMatt Roper #define   GAMT_CHKN_DISABLE_I2M_CYCLE_ON_WR_PORT	(1 << 24)
3850d53879fSMatt Roper 
3860d53879fSMatt Roper #define GEN8_FAULT_TLB_DATA0			_MMIO(0x4b10)
3870d53879fSMatt Roper #define GEN8_FAULT_TLB_DATA1			_MMIO(0x4b14)
3880d53879fSMatt Roper 
3890d53879fSMatt Roper #define GEN11_GACB_PERF_CTRL			_MMIO(0x4b80)
3900d53879fSMatt Roper #define   GEN11_HASH_CTRL_MASK			(0x3 << 12 | 0xf << 0)
3910d53879fSMatt Roper #define   GEN11_HASH_CTRL_BIT0			(1 << 0)
3920d53879fSMatt Roper #define   GEN11_HASH_CTRL_BIT4			(1 << 12)
3930d53879fSMatt Roper 
3940d53879fSMatt Roper /* gamt regs */
3950d53879fSMatt Roper #define GEN8_L3_LRA_1_GPGPU			_MMIO(0x4dd4)
3960d53879fSMatt Roper #define   GEN8_L3_LRA_1_GPGPU_DEFAULT_VALUE_BDW	0x67F1427F /* max/min for LRA1/2 */
3970d53879fSMatt Roper #define   GEN8_L3_LRA_1_GPGPU_DEFAULT_VALUE_CHV	0x5FF101FF /* max/min for LRA1/2 */
3980d53879fSMatt Roper #define   GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_SKL	0x67F1427F /*    "        " */
3990d53879fSMatt Roper #define   GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_BXT	0x5FF101FF /*    "        " */
4000d53879fSMatt Roper 
4010d53879fSMatt Roper #define MMCD_MISC_CTRL				_MMIO(0x4ddc) /* skl+ */
4020d53879fSMatt Roper #define   MMCD_PCLA				(1 << 31)
4030d53879fSMatt Roper #define   MMCD_HOTSPOT_EN			(1 << 27)
4040d53879fSMatt Roper 
4050d53879fSMatt Roper /* There are the 4 64-bit counter registers, one for each stream output */
4060d53879fSMatt Roper #define GEN7_SO_NUM_PRIMS_WRITTEN(n)		_MMIO(0x5200 + (n) * 8)
4070d53879fSMatt Roper #define GEN7_SO_NUM_PRIMS_WRITTEN_UDW(n)	_MMIO(0x5200 + (n) * 8 + 4)
4080d53879fSMatt Roper 
4090d53879fSMatt Roper #define GEN7_SO_PRIM_STORAGE_NEEDED(n)		_MMIO(0x5240 + (n) * 8)
4100d53879fSMatt Roper #define GEN7_SO_PRIM_STORAGE_NEEDED_UDW(n)	_MMIO(0x5240 + (n) * 8 + 4)
4110d53879fSMatt Roper 
4120d53879fSMatt Roper #define GEN9_WM_CHICKEN3			_MMIO(0x5588)
4130d53879fSMatt Roper #define   GEN9_FACTOR_IN_CLR_VAL_HIZ		(1 << 9)
4140d53879fSMatt Roper 
415262a6cd0SMatt Roper #define XEHP_CULLBIT1				MCR_REG(0x6100)
416262a6cd0SMatt Roper 
41710903b0aSGustavo Sousa #define CHICKEN_RASTER_2			MCR_REG(0x6208)
4186dc85721SMatt Roper #define   TBIMR_FAST_CLIP			REG_BIT(5)
4196dc85721SMatt Roper 
420a9e69428SMatt Roper #define VFLSKPD					MCR_REG(0x62a8)
42141bb543fSMatt Roper #define   VF_PREFETCH_TLB_DIS			REG_BIT(5)
4220d53879fSMatt Roper #define   DIS_OVER_FETCH_CACHE			REG_BIT(1)
4230d53879fSMatt Roper #define   DIS_MULT_MISS_RD_SQUASH		REG_BIT(0)
4240d53879fSMatt Roper 
42577fa9efcSMatt Roper #define GEN12_FF_MODE2				_MMIO(0x6604)
426a9e69428SMatt Roper #define XEHP_FF_MODE2				MCR_REG(0x6604)
4270d53879fSMatt Roper #define   FF_MODE2_GS_TIMER_MASK		REG_GENMASK(31, 24)
4280d53879fSMatt Roper #define   FF_MODE2_GS_TIMER_224			REG_FIELD_PREP(FF_MODE2_GS_TIMER_MASK, 224)
4290d53879fSMatt Roper #define   FF_MODE2_TDS_TIMER_MASK		REG_GENMASK(23, 16)
4300d53879fSMatt Roper #define   FF_MODE2_TDS_TIMER_128		REG_FIELD_PREP(FF_MODE2_TDS_TIMER_MASK, 4)
4310d53879fSMatt Roper 
432a9e69428SMatt Roper #define XEHPG_INSTDONE_GEOM_SVG			MCR_REG(0x666c)
4330d53879fSMatt Roper 
4340d53879fSMatt Roper #define CACHE_MODE_0_GEN7			_MMIO(0x7000) /* IVB+ */
4350d53879fSMatt Roper #define   RC_OP_FLUSH_ENABLE			(1 << 0)
4360d53879fSMatt Roper #define   HIZ_RAW_STALL_OPT_DISABLE		(1 << 2)
4370d53879fSMatt Roper #define CACHE_MODE_1				_MMIO(0x7004) /* IVB+ */
438900a80c5SMatt Atwood #define   MSAA_OPTIMIZATION_REDUC_DISABLE	REG_BIT(11)
439900a80c5SMatt Atwood #define   PIXEL_SUBSPAN_COLLECT_OPT_DISABLE	REG_BIT(6)
440900a80c5SMatt Atwood #define   GEN8_4x4_STC_OPTIMIZATION_DISABLE	REG_BIT(6)
441900a80c5SMatt Atwood #define   GEN9_PARTIAL_RESOLVE_IN_VC_DISABLE	REG_BIT(1)
4420d53879fSMatt Roper 
4430d53879fSMatt Roper #define GEN7_GT_MODE				_MMIO(0x7008)
4440d53879fSMatt Roper #define   GEN9_IZ_HASHING_MASK(slice)		(0x3 << ((slice) * 2))
4450d53879fSMatt Roper #define   GEN9_IZ_HASHING(slice, val)		((val) << ((slice) * 2))
4460d53879fSMatt Roper 
4470d53879fSMatt Roper /* GEN7 chicken */
4480d53879fSMatt Roper #define GEN7_COMMON_SLICE_CHICKEN1		_MMIO(0x7010)
4490d53879fSMatt Roper #define   GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC	(1 << 10)
4500d53879fSMatt Roper #define   GEN9_RHWO_OPTIMIZATION_DISABLE	(1 << 14)
4510d53879fSMatt Roper 
4520d53879fSMatt Roper #define COMMON_SLICE_CHICKEN2			_MMIO(0x7014)
4530d53879fSMatt Roper #define   GEN9_PBE_COMPRESSED_HASH_SELECTION	(1 << 13)
4540d53879fSMatt Roper #define   GEN9_DISABLE_GATHER_AT_SET_SHADER_COMMON_SLICE	(1 << 12)
4550d53879fSMatt Roper #define   GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION	(1 << 8)
4560d53879fSMatt Roper #define   GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE	(1 << 0)
4570d53879fSMatt Roper 
4580d53879fSMatt Roper #define HIZ_CHICKEN				_MMIO(0x7018)
4590d53879fSMatt Roper #define   CHV_HZ_8X8_MODE_IN_1X			REG_BIT(15)
4600d53879fSMatt Roper #define   DG1_HZ_READ_SUPPRESSION_OPTIMIZATION_DISABLE	REG_BIT(14)
461e62f31e1SGustavo Sousa #define   HZ_DEPTH_TEST_LE_GE_OPT_DISABLE	REG_BIT(13)
4620d53879fSMatt Roper #define   BDW_HIZ_POWER_COMPILER_CLOCK_GATING_DISABLE	REG_BIT(3)
4630d53879fSMatt Roper 
464262a6cd0SMatt Roper #define XEHP_CULLBIT2				MCR_REG(0x7030)
465262a6cd0SMatt Roper 
4660d53879fSMatt Roper #define GEN8_L3CNTLREG				_MMIO(0x7034)
4670d53879fSMatt Roper #define   GEN8_ERRDETBCTRL			(1 << 9)
4680d53879fSMatt Roper 
46941badc01SGustavo Sousa #define XEHP_PSS_MODE2				MCR_REG(0x703c)
470468a4e63SMatt Atwood #define   SCOREBOARD_STALL_FLUSH_CONTROL	REG_BIT(5)
471468a4e63SMatt Atwood 
47297bb5e69SHaridhar Kalvala #define XEHP_PSS_CHICKEN			MCR_REG(0x7044)
47397bb5e69SHaridhar Kalvala #define   FD_END_COLLECT			REG_BIT(5)
47497bb5e69SHaridhar Kalvala 
4750d53879fSMatt Roper #define GEN7_SC_INSTDONE			_MMIO(0x7100)
4760d53879fSMatt Roper #define GEN12_SC_INSTDONE_EXTRA			_MMIO(0x7104)
4770d53879fSMatt Roper #define GEN12_SC_INSTDONE_EXTRA2		_MMIO(0x7108)
4780d53879fSMatt Roper 
4790d53879fSMatt Roper /* GEN8 chicken */
4800d53879fSMatt Roper #define HDC_CHICKEN0				_MMIO(0x7300)
4810d53879fSMatt Roper #define   HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE	(1 << 15)
4820d53879fSMatt Roper #define   HDC_FENCE_DEST_SLM_DISABLE		(1 << 14)
4830d53879fSMatt Roper #define   HDC_DONOT_FETCH_MEM_WHEN_MASKED	(1 << 11)
4840d53879fSMatt Roper #define   HDC_FORCE_CONTEXT_SAVE_RESTORE_NON_COHERENT	(1 << 5)
4850d53879fSMatt Roper #define   HDC_FORCE_NON_COHERENT		(1 << 4)
4860d53879fSMatt Roper #define   HDC_BARRIER_PERFORMANCE_DISABLE	(1 << 10)
4870d53879fSMatt Roper 
488e67db9d2SGustavo Sousa #define COMMON_SLICE_CHICKEN4			_MMIO(0x7300)
489e67db9d2SGustavo Sousa #define   DISABLE_TDC_LOAD_BALANCING_CALC	REG_BIT(6)
490e67db9d2SGustavo Sousa 
4910d53879fSMatt Roper #define GEN8_HDC_CHICKEN1			_MMIO(0x7304)
4920d53879fSMatt Roper 
4930d53879fSMatt Roper #define GEN11_COMMON_SLICE_CHICKEN3		_MMIO(0x7304)
494a9e69428SMatt Roper #define XEHP_COMMON_SLICE_CHICKEN3		MCR_REG(0x7304)
4950d53879fSMatt Roper #define   DG1_FLOAT_POINT_BLEND_OPT_STRICT_MODE_EN	REG_BIT(12)
4960d53879fSMatt Roper #define   XEHP_DUAL_SIMD8_SEQ_MERGE_DISABLE	REG_BIT(12)
4970d53879fSMatt Roper #define   GEN11_BLEND_EMB_FIX_DISABLE_IN_RCC	REG_BIT(11)
4980d53879fSMatt Roper #define   GEN12_DISABLE_CPS_AWARE_COLOR_PIPE	REG_BIT(9)
4990d53879fSMatt Roper 
5000d53879fSMatt Roper #define GEN9_SLICE_COMMON_ECO_CHICKEN1		_MMIO(0x731c)
501a9e69428SMatt Roper #define XEHP_SLICE_COMMON_ECO_CHICKEN1		MCR_REG(0x731c)
5020d53879fSMatt Roper #define   MSC_MSAA_REODER_BUF_BYPASS_DISABLE	REG_BIT(14)
50377fa9efcSMatt Roper #define   GEN11_STATE_CACHE_REDIRECT_TO_CS	(1 << 11)
5040d53879fSMatt Roper 
5050d53879fSMatt Roper #define GEN9_SLICE_PGCTL_ACK(slice)		_MMIO(0x804c + (slice) * 0x4)
5060d53879fSMatt Roper #define GEN10_SLICE_PGCTL_ACK(slice)		_MMIO(0x804c + ((slice) / 3) * 0x34 + \
5070d53879fSMatt Roper 						      ((slice) % 3) * 0x4)
5080d53879fSMatt Roper #define   GEN9_PGCTL_SLICE_ACK			(1 << 0)
5090d53879fSMatt Roper #define   GEN9_PGCTL_SS_ACK(subslice)		(1 << (2 + (subslice) * 2))
5100d53879fSMatt Roper #define   GEN10_PGCTL_VALID_SS_MASK(slice)	((slice) == 0 ? 0x7F : 0x1F)
5110d53879fSMatt Roper 
5120d53879fSMatt Roper #define GEN9_SS01_EU_PGCTL_ACK(slice)		_MMIO(0x805c + (slice) * 0x8)
5130d53879fSMatt Roper #define GEN10_SS01_EU_PGCTL_ACK(slice)		_MMIO(0x805c + ((slice) / 3) * 0x30 + \
5140d53879fSMatt Roper 						      ((slice) % 3) * 0x8)
5150d53879fSMatt Roper #define GEN9_SS23_EU_PGCTL_ACK(slice)		_MMIO(0x8060 + (slice) * 0x8)
5160d53879fSMatt Roper #define GEN10_SS23_EU_PGCTL_ACK(slice)		_MMIO(0x8060 + ((slice) / 3) * 0x30 + \
5170d53879fSMatt Roper 						      ((slice) % 3) * 0x8)
5180d53879fSMatt Roper #define   GEN9_PGCTL_SSA_EU08_ACK		(1 << 0)
5190d53879fSMatt Roper #define   GEN9_PGCTL_SSA_EU19_ACK		(1 << 2)
5200d53879fSMatt Roper #define   GEN9_PGCTL_SSA_EU210_ACK		(1 << 4)
5210d53879fSMatt Roper #define   GEN9_PGCTL_SSA_EU311_ACK		(1 << 6)
5220d53879fSMatt Roper #define   GEN9_PGCTL_SSB_EU08_ACK		(1 << 8)
5230d53879fSMatt Roper #define   GEN9_PGCTL_SSB_EU19_ACK		(1 << 10)
5240d53879fSMatt Roper #define   GEN9_PGCTL_SSB_EU210_ACK		(1 << 12)
5250d53879fSMatt Roper #define   GEN9_PGCTL_SSB_EU311_ACK		(1 << 14)
5260d53879fSMatt Roper 
5271be6b46fSClint Taylor #define VF_PREEMPTION				_MMIO(0x83a4)
5281be6b46fSClint Taylor #define   PREEMPTION_VERTEX_COUNT		REG_GENMASK(15, 0)
5291be6b46fSClint Taylor 
530ea9c6215SWayne Boyer #define VFG_PREEMPTION_CHICKEN			_MMIO(0x83b4)
531ea9c6215SWayne Boyer #define   POLYGON_TRIFAN_LINELOOP_DISABLE	REG_BIT(4)
532ea9c6215SWayne Boyer 
5330d53879fSMatt Roper #define GEN8_RC6_CTX_INFO			_MMIO(0x8504)
5340d53879fSMatt Roper 
535a7fa1537SRadhakrishna Sripada #define GEN12_SQCNT1				_MMIO(0x8718)
536a7fa1537SRadhakrishna Sripada #define   GEN12_SQCNT1_PMON_ENABLE		REG_BIT(30)
537a7fa1537SRadhakrishna Sripada #define   GEN12_SQCNT1_OABPC			REG_BIT(29)
538a7fa1537SRadhakrishna Sripada #define   GEN12_STRICT_RAR_ENABLE		REG_BIT(23)
539a7fa1537SRadhakrishna Sripada 
540a9e69428SMatt Roper #define XEHP_SQCM				MCR_REG(0x8724)
5410d53879fSMatt Roper #define   EN_32B_ACCESS				REG_BIT(30)
5420d53879fSMatt Roper 
54343dea469SDnyaneshwar Bhadane #define MTL_GSCPSMI_BASEADDR_LSB		_MMIO(0x880c)
54443dea469SDnyaneshwar Bhadane #define MTL_GSCPSMI_BASEADDR_MSB		_MMIO(0x8810)
54543dea469SDnyaneshwar Bhadane 
5460d53879fSMatt Roper #define HSW_IDICR				_MMIO(0x9008)
5470d53879fSMatt Roper #define   IDIHASHMSK(x)				(((x) & 0x3f) << 16)
5480d6419e9SMatt Roper 
5490d6419e9SMatt Roper #define GEN6_MBCUNIT_SNPCR			_MMIO(0x900c) /* for LLC config */
5500d6419e9SMatt Roper #define   GEN6_MBC_SNPCR_SHIFT			21
5510d6419e9SMatt Roper #define   GEN6_MBC_SNPCR_MASK			(3 << 21)
5520d6419e9SMatt Roper #define   GEN6_MBC_SNPCR_MAX			(0 << 21)
5530d6419e9SMatt Roper #define   GEN6_MBC_SNPCR_MED			(1 << 21)
5540d6419e9SMatt Roper #define   GEN6_MBC_SNPCR_LOW			(2 << 21)
5550d6419e9SMatt Roper #define   GEN6_MBC_SNPCR_MIN			(3 << 21) /* only 1/16th of the cache is shared */
5560d6419e9SMatt Roper 
5570d6419e9SMatt Roper #define VLV_G3DCTL				_MMIO(0x9024)
5580d6419e9SMatt Roper #define VLV_GSCKGCTL				_MMIO(0x9028)
5590d6419e9SMatt Roper 
5600d53879fSMatt Roper /* WaCatErrorRejectionIssue */
5610d53879fSMatt Roper #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG		_MMIO(0x9030)
5620d53879fSMatt Roper #define   GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB	(1 << 11)
5630d53879fSMatt Roper 
5640d6419e9SMatt Roper #define FBC_LLC_READ_CTRL			_MMIO(0x9044)
5650d6419e9SMatt Roper #define   FBC_LLC_FULLY_OPEN			REG_BIT(30)
5660d6419e9SMatt Roper 
567bd3de319SMatt Roper #define GEN6_MBCTL				_MMIO(0x907c)
5680d6419e9SMatt Roper #define   GEN6_MBCTL_ENABLE_BOOT_FETCH		(1 << 4)
5690d6419e9SMatt Roper #define   GEN6_MBCTL_CTX_FETCH_NEEDED		(1 << 3)
5700d6419e9SMatt Roper #define   GEN6_MBCTL_BME_UPDATE_ENABLE		(1 << 2)
5710d6419e9SMatt Roper #define   GEN6_MBCTL_MAE_UPDATE_ENABLE		(1 << 1)
5720d6419e9SMatt Roper #define   GEN6_MBCTL_BOOT_FETCH_MECH		(1 << 0)
5730d6419e9SMatt Roper 
5740d53879fSMatt Roper /* Fuse readout registers for GT */
575f32898c9SMatt Roper #define XEHP_FUSE4				_MMIO(0x9114)
576f32898c9SMatt Roper #define   GT_L3_EXC_MASK			REG_GENMASK(6, 4)
5770d53879fSMatt Roper #define	GEN10_MIRROR_FUSE3			_MMIO(0x9118)
5780d53879fSMatt Roper #define   GEN10_L3BANK_PAIR_COUNT		4
5790d53879fSMatt Roper #define   GEN10_L3BANK_MASK			0x0F
5800d53879fSMatt Roper /* on Xe_HP the same fuses indicates mslices instead of L3 banks */
5810d53879fSMatt Roper #define   GEN12_MAX_MSLICES			4
5820d53879fSMatt Roper #define   GEN12_MEML3_EN_MASK			0x0F
5830d53879fSMatt Roper 
5840d53879fSMatt Roper #define HSW_PAVP_FUSE1				_MMIO(0x911c)
5850d53879fSMatt Roper #define   XEHP_SFC_ENABLE_MASK			REG_GENMASK(27, 24)
5860d53879fSMatt Roper #define   HSW_F1_EU_DIS_MASK			REG_GENMASK(17, 16)
5870d53879fSMatt Roper #define   HSW_F1_EU_DIS_10EUS			0
5880d53879fSMatt Roper #define   HSW_F1_EU_DIS_8EUS			1
5890d53879fSMatt Roper #define   HSW_F1_EU_DIS_6EUS			2
5900d53879fSMatt Roper 
5910d53879fSMatt Roper #define GEN8_FUSE2				_MMIO(0x9120)
5920d53879fSMatt Roper #define   GEN8_F2_SS_DIS_SHIFT			21
5930d53879fSMatt Roper #define   GEN8_F2_SS_DIS_MASK			(0x7 << GEN8_F2_SS_DIS_SHIFT)
5940d53879fSMatt Roper #define   GEN8_F2_S_ENA_SHIFT			25
5950d53879fSMatt Roper #define   GEN8_F2_S_ENA_MASK			(0x7 << GEN8_F2_S_ENA_SHIFT)
5960d53879fSMatt Roper #define   GEN9_F2_SS_DIS_SHIFT			20
5970d53879fSMatt Roper #define   GEN9_F2_SS_DIS_MASK			(0xf << GEN9_F2_SS_DIS_SHIFT)
5980d53879fSMatt Roper #define   GEN10_F2_S_ENA_SHIFT			22
5990d53879fSMatt Roper #define   GEN10_F2_S_ENA_MASK			(0x3f << GEN10_F2_S_ENA_SHIFT)
6000d53879fSMatt Roper #define   GEN10_F2_SS_DIS_SHIFT			18
6010d53879fSMatt Roper #define   GEN10_F2_SS_DIS_MASK			(0xf << GEN10_F2_SS_DIS_SHIFT)
6020d53879fSMatt Roper 
6030d53879fSMatt Roper #define GEN8_EU_DISABLE0			_MMIO(0x9134)
6040d53879fSMatt Roper #define GEN9_EU_DISABLE(slice)			_MMIO(0x9134 + (slice) * 0x4)
6050d53879fSMatt Roper #define GEN11_EU_DISABLE			_MMIO(0x9134)
6060d53879fSMatt Roper #define   GEN8_EU_DIS0_S0_MASK			0xffffff
6070d53879fSMatt Roper #define   GEN8_EU_DIS0_S1_SHIFT			24
6080d53879fSMatt Roper #define   GEN8_EU_DIS0_S1_MASK			(0xff << GEN8_EU_DIS0_S1_SHIFT)
6090d53879fSMatt Roper #define   GEN11_EU_DIS_MASK			0xFF
6100d53879fSMatt Roper #define XEHP_EU_ENABLE				_MMIO(0x9134)
6110d53879fSMatt Roper #define   XEHP_EU_ENA_MASK			0xFF
6120d53879fSMatt Roper 
6130d53879fSMatt Roper #define GEN8_EU_DISABLE1			_MMIO(0x9138)
6140d53879fSMatt Roper #define   GEN8_EU_DIS1_S1_MASK			0xffff
6150d53879fSMatt Roper #define   GEN8_EU_DIS1_S2_SHIFT			16
6160d53879fSMatt Roper #define   GEN8_EU_DIS1_S2_MASK			(0xffff << GEN8_EU_DIS1_S2_SHIFT)
6170d53879fSMatt Roper 
6180d53879fSMatt Roper #define GEN11_GT_SLICE_ENABLE			_MMIO(0x9138)
6190d53879fSMatt Roper #define   GEN11_GT_S_ENA_MASK			0xFF
6200d53879fSMatt Roper 
6210d53879fSMatt Roper #define GEN8_EU_DISABLE2			_MMIO(0x913c)
6220d53879fSMatt Roper #define   GEN8_EU_DIS2_S2_MASK			0xff
6230d53879fSMatt Roper 
6240d53879fSMatt Roper #define GEN11_GT_SUBSLICE_DISABLE		_MMIO(0x913c)
6250d53879fSMatt Roper #define GEN12_GT_GEOMETRY_DSS_ENABLE		_MMIO(0x913c)
6260d53879fSMatt Roper 
6270d53879fSMatt Roper #define GEN10_EU_DISABLE3			_MMIO(0x9140)
6280d53879fSMatt Roper #define   GEN10_EU_DIS_SS_MASK			0xff
6290d53879fSMatt Roper #define GEN11_GT_VEBOX_VDBOX_DISABLE		_MMIO(0x9140)
6300d53879fSMatt Roper #define   GEN11_GT_VDBOX_DISABLE_MASK		0xff
6310d53879fSMatt Roper #define   GEN11_GT_VEBOX_DISABLE_SHIFT		16
6320d53879fSMatt Roper #define   GEN11_GT_VEBOX_DISABLE_MASK		(0x0f << GEN11_GT_VEBOX_DISABLE_SHIFT)
6330d53879fSMatt Roper 
6340d53879fSMatt Roper #define GEN12_GT_COMPUTE_DSS_ENABLE		_MMIO(0x9144)
6355ac342efSMatt Roper #define XEHPC_GT_COMPUTE_DSS_ENABLE_EXT		_MMIO(0x9148)
6360d53879fSMatt Roper 
6370d53879fSMatt Roper #define GEN6_UCGCTL1				_MMIO(0x9400)
6380d53879fSMatt Roper #define   GEN6_GAMUNIT_CLOCK_GATE_DISABLE	(1 << 22)
6390d53879fSMatt Roper #define   GEN6_EU_TCUNIT_CLOCK_GATE_DISABLE	(1 << 16)
6400d53879fSMatt Roper #define   GEN6_BLBUNIT_CLOCK_GATE_DISABLE	(1 << 5)
6410d53879fSMatt Roper #define   GEN6_CSUNIT_CLOCK_GATE_DISABLE		(1 << 7)
6420d53879fSMatt Roper 
6430d53879fSMatt Roper #define GEN6_UCGCTL2				_MMIO(0x9404)
6440d53879fSMatt Roper #define   GEN6_VFUNIT_CLOCK_GATE_DISABLE	(1 << 31)
6450d53879fSMatt Roper #define   GEN7_VDSUNIT_CLOCK_GATE_DISABLE	(1 << 30)
6460d53879fSMatt Roper #define   GEN7_TDLUNIT_CLOCK_GATE_DISABLE	(1 << 22)
6470d53879fSMatt Roper #define   GEN6_RCZUNIT_CLOCK_GATE_DISABLE	(1 << 13)
6480d53879fSMatt Roper #define   GEN6_RCPBUNIT_CLOCK_GATE_DISABLE	(1 << 12)
6490d53879fSMatt Roper #define   GEN6_RCCUNIT_CLOCK_GATE_DISABLE	(1 << 11)
6500d53879fSMatt Roper 
6510d53879fSMatt Roper #define GEN6_UCGCTL3				_MMIO(0x9408)
6520d53879fSMatt Roper #define   GEN6_OACSUNIT_CLOCK_GATE_DISABLE	(1 << 20)
6530d53879fSMatt Roper 
6540d53879fSMatt Roper #define GEN7_UCGCTL4				_MMIO(0x940c)
6550d53879fSMatt Roper #define   GEN7_L3BANK2X_CLOCK_GATE_DISABLE	(1 << 25)
6560d53879fSMatt Roper #define   GEN8_EU_GAUNIT_CLOCK_GATE_DISABLE	(1 << 14)
6570d53879fSMatt Roper 
6580d53879fSMatt Roper #define GEN6_RCGCTL1				_MMIO(0x9410)
6590d53879fSMatt Roper #define GEN6_RCGCTL2				_MMIO(0x9414)
6600d53879fSMatt Roper 
6610d6419e9SMatt Roper #define GEN6_GDRST				_MMIO(0x941c)
6620d6419e9SMatt Roper #define   GEN6_GRDOM_FULL			(1 << 0)
6630d6419e9SMatt Roper #define   GEN6_GRDOM_RENDER			(1 << 1)
6640d6419e9SMatt Roper #define   GEN6_GRDOM_MEDIA			(1 << 2)
6650d6419e9SMatt Roper #define   GEN6_GRDOM_BLT			(1 << 3)
6660d6419e9SMatt Roper #define   GEN6_GRDOM_VECS			(1 << 4)
6670d6419e9SMatt Roper #define   GEN9_GRDOM_GUC			(1 << 5)
6680d6419e9SMatt Roper #define   GEN8_GRDOM_MEDIA2			(1 << 7)
6690d6419e9SMatt Roper /* GEN11 changed all bit defs except for FULL & RENDER */
6700d6419e9SMatt Roper #define   GEN11_GRDOM_FULL			GEN6_GRDOM_FULL
6710d6419e9SMatt Roper #define   GEN11_GRDOM_RENDER			GEN6_GRDOM_RENDER
6728caaf7adSMatt Roper #define   XEHPC_GRDOM_BLT8			REG_BIT(31)
6738caaf7adSMatt Roper #define   XEHPC_GRDOM_BLT7			REG_BIT(30)
6748caaf7adSMatt Roper #define   XEHPC_GRDOM_BLT6			REG_BIT(29)
6758caaf7adSMatt Roper #define   XEHPC_GRDOM_BLT5			REG_BIT(28)
6768caaf7adSMatt Roper #define   XEHPC_GRDOM_BLT4			REG_BIT(27)
6778caaf7adSMatt Roper #define   XEHPC_GRDOM_BLT3			REG_BIT(26)
6788caaf7adSMatt Roper #define   XEHPC_GRDOM_BLT2			REG_BIT(25)
6798caaf7adSMatt Roper #define   XEHPC_GRDOM_BLT1			REG_BIT(24)
680ef8281abSDaniele Ceraolo Spurio #define   GEN12_GRDOM_GSC			REG_BIT(21)
6818caaf7adSMatt Roper #define   GEN11_GRDOM_SFC3			REG_BIT(20)
6828caaf7adSMatt Roper #define   GEN11_GRDOM_SFC2			REG_BIT(19)
6838caaf7adSMatt Roper #define   GEN11_GRDOM_SFC1			REG_BIT(18)
6848caaf7adSMatt Roper #define   GEN11_GRDOM_SFC0			REG_BIT(17)
6858caaf7adSMatt Roper #define   GEN11_GRDOM_VECS4			REG_BIT(16)
6868caaf7adSMatt Roper #define   GEN11_GRDOM_VECS3			REG_BIT(15)
6878caaf7adSMatt Roper #define   GEN11_GRDOM_VECS2			REG_BIT(14)
6888caaf7adSMatt Roper #define   GEN11_GRDOM_VECS			REG_BIT(13)
6898caaf7adSMatt Roper #define   GEN11_GRDOM_MEDIA8			REG_BIT(12)
6908caaf7adSMatt Roper #define   GEN11_GRDOM_MEDIA7			REG_BIT(11)
6918caaf7adSMatt Roper #define   GEN11_GRDOM_MEDIA6			REG_BIT(10)
6928caaf7adSMatt Roper #define   GEN11_GRDOM_MEDIA5			REG_BIT(9)
6938caaf7adSMatt Roper #define   GEN11_GRDOM_MEDIA4			REG_BIT(8)
6948caaf7adSMatt Roper #define   GEN11_GRDOM_MEDIA3			REG_BIT(7)
6958caaf7adSMatt Roper #define   GEN11_GRDOM_MEDIA2			REG_BIT(6)
6968caaf7adSMatt Roper #define   GEN11_GRDOM_MEDIA			REG_BIT(5)
6978caaf7adSMatt Roper #define   GEN11_GRDOM_GUC			REG_BIT(3)
6988caaf7adSMatt Roper #define   GEN11_GRDOM_BLT			REG_BIT(2)
6990d6419e9SMatt Roper #define   GEN11_VCS_SFC_RESET_BIT(instance)	(GEN11_GRDOM_SFC0 << ((instance) >> 1))
7000d6419e9SMatt Roper #define   GEN11_VECS_SFC_RESET_BIT(instance)	(GEN11_GRDOM_SFC0 << (instance))
7010d6419e9SMatt Roper 
7020d53879fSMatt Roper #define GEN6_RSTCTL				_MMIO(0x9420)
7030d6419e9SMatt Roper 
7040d53879fSMatt Roper #define GEN7_MISCCPCTL				_MMIO(0x9424)
7056a8b2e49SLucas De Marchi #define   GEN7_DOP_CLOCK_GATE_ENABLE		REG_BIT(0)
706c6e38067SAnshuman Gupta #define   GEN12_DOP_CLOCK_GATE_RENDER_ENABLE	REG_BIT(1)
7070d53879fSMatt Roper #define   GEN8_DOP_CLOCK_GATE_CFCLK_ENABLE	(1 << 2)
7080d53879fSMatt Roper #define   GEN8_DOP_CLOCK_GATE_GUC_ENABLE	(1 << 4)
7090d53879fSMatt Roper #define   GEN8_DOP_CLOCK_GATE_MEDIA_ENABLE	(1 << 6)
7100d6419e9SMatt Roper 
7110d53879fSMatt Roper #define GEN8_UCGCTL6				_MMIO(0x9430)
7120d53879fSMatt Roper #define   GEN8_GAPSUNIT_CLOCK_GATE_DISABLE	(1 << 24)
7130d53879fSMatt Roper #define   GEN8_SDEUNIT_CLOCK_GATE_DISABLE	(1 << 14)
7140d53879fSMatt Roper #define   GEN8_HDCUNIT_CLOCK_GATE_DISABLE_HDCREQ	(1 << 28)
7150d6419e9SMatt Roper 
7160d53879fSMatt Roper #define UNSLCGCTL9430				_MMIO(0x9430)
7170d53879fSMatt Roper #define   MSQDUNIT_CLKGATE_DIS			REG_BIT(3)
7180d6419e9SMatt Roper 
7190d53879fSMatt Roper #define UNSLICE_UNIT_LEVEL_CLKGATE		_MMIO(0x9434)
7200d53879fSMatt Roper #define   VFUNIT_CLKGATE_DIS			REG_BIT(20)
7210d53879fSMatt Roper #define   CG3DDISCFEG_CLKGATE_DIS		REG_BIT(17) /* DG2 */
7220d53879fSMatt Roper #define   GAMEDIA_CLKGATE_DIS			REG_BIT(11)
7230d53879fSMatt Roper #define   HSUNIT_CLKGATE_DIS			REG_BIT(8)
7240d53879fSMatt Roper #define   VSUNIT_CLKGATE_DIS			REG_BIT(3)
7250d6419e9SMatt Roper 
72677fa9efcSMatt Roper #define GEN11_SLICE_UNIT_LEVEL_CLKGATE		_MMIO(0x94d4)
727a9e69428SMatt Roper #define XEHP_SLICE_UNIT_LEVEL_CLKGATE		MCR_REG(0x94d4)
7280d53879fSMatt Roper #define   SARBUNIT_CLKGATE_DIS			(1 << 5)
7290d53879fSMatt Roper #define   RCCUNIT_CLKGATE_DIS			(1 << 7)
7300d53879fSMatt Roper #define   MSCUNIT_CLKGATE_DIS			(1 << 10)
7310d53879fSMatt Roper #define   NODEDSS_CLKGATE_DIS			REG_BIT(12)
7320d53879fSMatt Roper #define   L3_CLKGATE_DIS			REG_BIT(16)
7330d53879fSMatt Roper #define   L3_CR2X_CLKGATE_DIS			REG_BIT(17)
7340d6419e9SMatt Roper 
7350d53879fSMatt Roper #define UNSLICE_UNIT_LEVEL_CLKGATE2		_MMIO(0x94e4)
7360d53879fSMatt Roper #define   VSUNIT_CLKGATE_DIS_TGL		REG_BIT(19)
7370d53879fSMatt Roper #define   PSDUNIT_CLKGATE_DIS			REG_BIT(5)
7380d6419e9SMatt Roper 
739a9e69428SMatt Roper #define GEN11_SUBSLICE_UNIT_LEVEL_CLKGATE	MCR_REG(0x9524)
7400d53879fSMatt Roper #define   DSS_ROUTER_CLKGATE_DIS		REG_BIT(28)
7410d53879fSMatt Roper #define   GWUNIT_CLKGATE_DIS			REG_BIT(16)
7420d6419e9SMatt Roper 
743a9e69428SMatt Roper #define SUBSLICE_UNIT_LEVEL_CLKGATE2		MCR_REG(0x9528)
7440d53879fSMatt Roper #define   CPSSUNIT_CLKGATE_DIS			REG_BIT(9)
7450d6419e9SMatt Roper 
746a9e69428SMatt Roper #define SSMCGCTL9530				MCR_REG(0x9530)
7470d53879fSMatt Roper #define   RTFUNIT_CLKGATE_DIS			REG_BIT(18)
7480d6419e9SMatt Roper 
749a9e69428SMatt Roper #define GEN10_DFR_RATIO_EN_AND_CHICKEN		MCR_REG(0x9550)
7500d53879fSMatt Roper #define   DFR_DISABLE				(1 << 9)
7510d6419e9SMatt Roper 
7520d53879fSMatt Roper #define MICRO_BP0_0				_MMIO(0x9800)
7530d53879fSMatt Roper #define MICRO_BP0_2				_MMIO(0x9804)
7540d53879fSMatt Roper #define MICRO_BP0_1				_MMIO(0x9808)
7550d53879fSMatt Roper #define MICRO_BP1_0				_MMIO(0x980c)
7560d53879fSMatt Roper #define MICRO_BP1_2				_MMIO(0x9810)
7570d53879fSMatt Roper #define MICRO_BP1_1				_MMIO(0x9814)
7580d53879fSMatt Roper #define MICRO_BP2_0				_MMIO(0x9818)
7590d53879fSMatt Roper #define MICRO_BP2_2				_MMIO(0x981c)
7600d53879fSMatt Roper #define MICRO_BP2_1				_MMIO(0x9820)
7610d53879fSMatt Roper #define MICRO_BP3_0				_MMIO(0x9824)
7620d53879fSMatt Roper #define MICRO_BP3_2				_MMIO(0x9828)
7630d53879fSMatt Roper #define MICRO_BP3_1				_MMIO(0x982c)
7640d53879fSMatt Roper #define MICRO_BP_TRIGGER			_MMIO(0x9830)
7650d53879fSMatt Roper #define MICRO_BP3_COUNT_STATUS01		_MMIO(0x9834)
7660d53879fSMatt Roper #define MICRO_BP3_COUNT_STATUS23		_MMIO(0x9838)
7670d53879fSMatt Roper #define MICRO_BP_FIRED_ARMED			_MMIO(0x983c)
7680d6419e9SMatt Roper 
7690d53879fSMatt Roper #define GEN6_GFXPAUSE				_MMIO(0xa000)
7700d53879fSMatt Roper #define GEN6_RPNSWREQ				_MMIO(0xa008)
7710d53879fSMatt Roper #define   GEN6_TURBO_DISABLE			(1 << 31)
7720d53879fSMatt Roper #define   GEN6_FREQUENCY(x)			((x) << 25)
7730d53879fSMatt Roper #define   HSW_FREQUENCY(x)			((x) << 24)
7740d53879fSMatt Roper #define   GEN9_FREQUENCY(x)			((x) << 23)
7750d53879fSMatt Roper #define   GEN6_OFFSET(x)			((x) << 19)
7760d53879fSMatt Roper #define   GEN6_AGGRESSIVE_TURBO			(0 << 15)
7770d53879fSMatt Roper #define   GEN9_SW_REQ_UNSLICE_RATIO_SHIFT	23
7780d53879fSMatt Roper #define   GEN9_IGNORE_SLICE_RATIO		(0 << 0)
77926be7cd8SAshutosh Dixit #define   GEN12_MEDIA_FREQ_RATIO		REG_BIT(13)
7800d6419e9SMatt Roper 
7810d53879fSMatt Roper #define GEN6_RC_VIDEO_FREQ			_MMIO(0xa00c)
7820d53879fSMatt Roper #define   GEN6_RC_CTL_RC6pp_ENABLE		(1 << 16)
7830d53879fSMatt Roper #define   GEN6_RC_CTL_RC6p_ENABLE		(1 << 17)
7840d53879fSMatt Roper #define   GEN6_RC_CTL_RC6_ENABLE		(1 << 18)
7850d53879fSMatt Roper #define   GEN6_RC_CTL_RC1e_ENABLE		(1 << 20)
7860d53879fSMatt Roper #define   GEN6_RC_CTL_RC7_ENABLE		(1 << 22)
7870d53879fSMatt Roper #define   VLV_RC_CTL_CTX_RST_PARALLEL		(1 << 24)
7880d53879fSMatt Roper #define   GEN7_RC_CTL_TO_MODE			(1 << 28)
7890d53879fSMatt Roper #define   GEN6_RC_CTL_EI_MODE(x)		((x) << 27)
7900d53879fSMatt Roper #define   GEN6_RC_CTL_HW_ENABLE			(1 << 31)
7910d53879fSMatt Roper #define GEN6_RP_DOWN_TIMEOUT			_MMIO(0xa010)
7920d53879fSMatt Roper #define GEN6_RP_INTERRUPT_LIMITS		_MMIO(0xa014)
7930d53879fSMatt Roper #define GEN6_RPSTAT1				_MMIO(0xa01c)
7942c0a284cSAshutosh Dixit #define   GEN6_CAGF_MASK			REG_GENMASK(14, 8)
7952c0a284cSAshutosh Dixit #define   HSW_CAGF_MASK				REG_GENMASK(13, 7)
7962c0a284cSAshutosh Dixit #define   GEN9_CAGF_MASK			REG_GENMASK(31, 23)
7970d53879fSMatt Roper #define GEN6_RP_CONTROL				_MMIO(0xa024)
7980d53879fSMatt Roper #define   GEN6_RP_MEDIA_TURBO			(1 << 11)
7990d53879fSMatt Roper #define   GEN6_RP_MEDIA_MODE_MASK		(3 << 9)
8000d53879fSMatt Roper #define   GEN6_RP_MEDIA_HW_TURBO_MODE		(3 << 9)
8010d53879fSMatt Roper #define   GEN6_RP_MEDIA_HW_NORMAL_MODE		(2 << 9)
8020d53879fSMatt Roper #define   GEN6_RP_MEDIA_HW_MODE			(1 << 9)
8030d53879fSMatt Roper #define   GEN6_RP_MEDIA_SW_MODE			(0 << 9)
8040d53879fSMatt Roper #define   GEN6_RP_MEDIA_IS_GFX			(1 << 8)
8050d53879fSMatt Roper #define   GEN6_RP_ENABLE			(1 << 7)
8060d53879fSMatt Roper #define   GEN6_RP_UP_IDLE_MIN			(0x1 << 3)
8070d53879fSMatt Roper #define   GEN6_RP_UP_BUSY_AVG			(0x2 << 3)
8080d53879fSMatt Roper #define   GEN6_RP_UP_BUSY_CONT			(0x4 << 3)
8090d53879fSMatt Roper #define   GEN6_RP_DOWN_IDLE_AVG			(0x2 << 0)
8100d53879fSMatt Roper #define   GEN6_RP_DOWN_IDLE_CONT		(0x1 << 0)
8110d53879fSMatt Roper #define   GEN6_RPSWCTL_SHIFT			9
8120d53879fSMatt Roper #define   GEN9_RPSWCTL_ENABLE			(0x2 << GEN6_RPSWCTL_SHIFT)
8130d53879fSMatt Roper #define   GEN9_RPSWCTL_DISABLE			(0x0 << GEN6_RPSWCTL_SHIFT)
8140d53879fSMatt Roper #define GEN6_RP_UP_THRESHOLD			_MMIO(0xa02c)
8150d53879fSMatt Roper #define GEN6_RP_DOWN_THRESHOLD			_MMIO(0xa030)
8160d53879fSMatt Roper #define GEN6_RP_CUR_UP_EI			_MMIO(0xa050)
8170d53879fSMatt Roper #define   GEN6_RP_EI_MASK			0xffffff
8180d53879fSMatt Roper #define   GEN6_CURICONT_MASK			GEN6_RP_EI_MASK
8190d53879fSMatt Roper #define GEN6_RP_CUR_UP				_MMIO(0xa054)
8200d53879fSMatt Roper #define   GEN6_CURBSYTAVG_MASK			GEN6_RP_EI_MASK
8210d53879fSMatt Roper #define GEN6_RP_PREV_UP				_MMIO(0xa058)
8220d53879fSMatt Roper #define GEN6_RP_CUR_DOWN_EI			_MMIO(0xa05c)
8230d53879fSMatt Roper #define   GEN6_CURIAVG_MASK			GEN6_RP_EI_MASK
8240d53879fSMatt Roper #define GEN6_RP_CUR_DOWN			_MMIO(0xa060)
8250d53879fSMatt Roper #define GEN6_RP_PREV_DOWN			_MMIO(0xa064)
8260d53879fSMatt Roper #define GEN6_RP_UP_EI				_MMIO(0xa068)
8270d53879fSMatt Roper #define GEN6_RP_DOWN_EI				_MMIO(0xa06c)
8280d53879fSMatt Roper #define GEN6_RP_IDLE_HYSTERSIS			_MMIO(0xa070)
8290d53879fSMatt Roper #define GEN6_RPDEUHWTC				_MMIO(0xa080)
8300d53879fSMatt Roper #define GEN6_RPDEUC				_MMIO(0xa084)
8310d53879fSMatt Roper #define GEN6_RPDEUCSW				_MMIO(0xa088)
8320d53879fSMatt Roper #define GEN6_RC_CONTROL				_MMIO(0xa090)
8330d53879fSMatt Roper #define GEN6_RC_STATE				_MMIO(0xa094)
8340d53879fSMatt Roper #define   RC_SW_TARGET_STATE_SHIFT		16
8350d53879fSMatt Roper #define   RC_SW_TARGET_STATE_MASK		(7 << RC_SW_TARGET_STATE_SHIFT)
8360d53879fSMatt Roper #define GEN6_RC1_WAKE_RATE_LIMIT		_MMIO(0xa098)
8370d53879fSMatt Roper #define GEN6_RC6_WAKE_RATE_LIMIT		_MMIO(0xa09c)
8380d53879fSMatt Roper #define GEN6_RC6pp_WAKE_RATE_LIMIT		_MMIO(0xa0a0)
8390d53879fSMatt Roper #define GEN10_MEDIA_WAKE_RATE_LIMIT		_MMIO(0xa0a0)
8400d53879fSMatt Roper #define GEN6_RC_EVALUATION_INTERVAL		_MMIO(0xa0a8)
8410d53879fSMatt Roper #define GEN6_RC_IDLE_HYSTERSIS			_MMIO(0xa0ac)
8420d53879fSMatt Roper #define GEN6_RC_SLEEP				_MMIO(0xa0b0)
8430d53879fSMatt Roper #define GEN6_RCUBMABDTMR			_MMIO(0xa0b0)
8440d53879fSMatt Roper #define GEN6_RC1e_THRESHOLD			_MMIO(0xa0b4)
8450d53879fSMatt Roper #define GEN6_RC6_THRESHOLD			_MMIO(0xa0b8)
8460d53879fSMatt Roper #define GEN6_RC6p_THRESHOLD			_MMIO(0xa0bc)
8470d53879fSMatt Roper #define VLV_RCEDATA				_MMIO(0xa0bc)
8480d53879fSMatt Roper #define GEN6_RC6pp_THRESHOLD			_MMIO(0xa0c0)
8490d53879fSMatt Roper #define GEN9_MEDIA_PG_IDLE_HYSTERESIS		_MMIO(0xa0c4)
8500d53879fSMatt Roper #define GEN9_RENDER_PG_IDLE_HYSTERESIS		_MMIO(0xa0c8)
8510d6419e9SMatt Roper 
8520d53879fSMatt Roper #define GEN6_PMINTRMSK				_MMIO(0xa168)
8530d53879fSMatt Roper #define   GEN8_PMINTR_DISABLE_REDIRECT_TO_GUC	(1 << 31)
8540d53879fSMatt Roper #define   ARAT_EXPIRED_INTRMSK			(1 << 9)
8550d6419e9SMatt Roper 
8560d53879fSMatt Roper #define GEN8_MISC_CTRL0				_MMIO(0xa180)
8570d6419e9SMatt Roper 
8580d53879fSMatt Roper #define ECOBUS					_MMIO(0xa180)
8590d53879fSMatt Roper #define    FORCEWAKE_MT_ENABLE			(1 << 5)
8600d53879fSMatt Roper 
8610d53879fSMatt Roper #define FORCEWAKE_MT				_MMIO(0xa188) /* multi-threaded */
8620d53879fSMatt Roper #define FORCEWAKE_GT_GEN9			_MMIO(0xa188)
8630d53879fSMatt Roper #define FORCEWAKE				_MMIO(0xa18c)
8640d53879fSMatt Roper 
8650d53879fSMatt Roper #define VLV_SPAREG2H				_MMIO(0xa194)
8660d53879fSMatt Roper 
8670d53879fSMatt Roper #define GEN9_PG_ENABLE				_MMIO(0xa210)
8680d53879fSMatt Roper #define   GEN9_RENDER_PG_ENABLE			REG_BIT(0)
8690d53879fSMatt Roper #define   GEN9_MEDIA_PG_ENABLE			REG_BIT(1)
8700d53879fSMatt Roper #define   GEN11_MEDIA_SAMPLER_PG_ENABLE		REG_BIT(2)
8710d53879fSMatt Roper #define   VDN_HCP_POWERGATE_ENABLE(n)		REG_BIT(3 + 2 * (n))
8720d53879fSMatt Roper #define   VDN_MFX_POWERGATE_ENABLE(n)		REG_BIT(4 + 2 * (n))
8730d53879fSMatt Roper 
8740d53879fSMatt Roper #define GEN8_PUSHBUS_CONTROL			_MMIO(0xa248)
8750d53879fSMatt Roper #define GEN8_PUSHBUS_ENABLE			_MMIO(0xa250)
8760d53879fSMatt Roper #define GEN8_PUSHBUS_SHIFT			_MMIO(0xa25c)
8770d6419e9SMatt Roper 
8780d6419e9SMatt Roper /* GPM unit config (Gen9+) */
879bd3de319SMatt Roper #define CTC_MODE				_MMIO(0xa26c)
8800d6419e9SMatt Roper #define   CTC_SOURCE_PARAMETER_MASK		1
8810d6419e9SMatt Roper #define   CTC_SOURCE_CRYSTAL_CLOCK		0
8820d6419e9SMatt Roper #define   CTC_SOURCE_DIVIDE_LOGIC		1
8830d6419e9SMatt Roper #define   CTC_SHIFT_PARAMETER_SHIFT		1
8840d6419e9SMatt Roper #define   CTC_SHIFT_PARAMETER_MASK		(0x3 << CTC_SHIFT_PARAMETER_SHIFT)
8850d6419e9SMatt Roper 
886dac38381SUmesh Nerlige Ramappa /* GPM MSG_IDLE */
887dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_CS		_MMIO(0x8000)
888dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_VCS0		_MMIO(0x8004)
889dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_VCS1		_MMIO(0x8008)
890dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_BCS		_MMIO(0x800C)
891dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_VECS0		_MMIO(0x8010)
892dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_VCS2		_MMIO(0x80C0)
893dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_VCS3		_MMIO(0x80C4)
894dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_VCS4		_MMIO(0x80C8)
895dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_VCS5		_MMIO(0x80CC)
896dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_VCS6		_MMIO(0x80D0)
897dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_VCS7		_MMIO(0x80D4)
898dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_VECS1		_MMIO(0x80D8)
899dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_VECS2		_MMIO(0x80DC)
900dac38381SUmesh Nerlige Ramappa #define MSG_IDLE_VECS3		_MMIO(0x80E0)
901dac38381SUmesh Nerlige Ramappa #define  MSG_IDLE_FW_MASK	REG_GENMASK(13, 9)
902dac38381SUmesh Nerlige Ramappa #define  MSG_IDLE_FW_SHIFT	9
903dac38381SUmesh Nerlige Ramappa 
90467b5655bSVinay Belgaumkar #define	RC_PSMI_CTRL_GSCCS	_MMIO(0x11a050)
90567b5655bSVinay Belgaumkar #define	  IDLE_MSG_DISABLE	REG_BIT(0)
90667b5655bSVinay Belgaumkar #define	PWRCTX_MAXCNT_GSCCS	_MMIO(0x11a054)
90767b5655bSVinay Belgaumkar 
9080d53879fSMatt Roper #define FORCEWAKE_MEDIA_GEN9			_MMIO(0xa270)
9090d53879fSMatt Roper #define FORCEWAKE_RENDER_GEN9			_MMIO(0xa278)
9100d6419e9SMatt Roper 
9110d53879fSMatt Roper #define VLV_PWRDWNUPCTL				_MMIO(0xa294)
9120d6419e9SMatt Roper 
9130d53879fSMatt Roper #define GEN9_PWRGT_DOMAIN_STATUS		_MMIO(0xa2a0)
9140d53879fSMatt Roper #define   GEN9_PWRGT_MEDIA_STATUS_MASK		(1 << 0)
9150d53879fSMatt Roper #define   GEN9_PWRGT_RENDER_STATUS_MASK		(1 << 1)
9160d6419e9SMatt Roper 
9170d53879fSMatt Roper #define MISC_STATUS0				_MMIO(0xa500)
9180d53879fSMatt Roper #define MISC_STATUS1				_MMIO(0xa504)
9190d6419e9SMatt Roper 
9200d53879fSMatt Roper #define FORCEWAKE_MEDIA_VDBOX_GEN11(n)		_MMIO(0xa540 + (n) * 4)
9210d53879fSMatt Roper #define FORCEWAKE_MEDIA_VEBOX_GEN11(n)		_MMIO(0xa560 + (n) * 4)
9220d6419e9SMatt Roper 
92314f2f9bfSMatt Roper #define FORCEWAKE_REQ_GSC			_MMIO(0xa618)
92414f2f9bfSMatt Roper 
9250d53879fSMatt Roper #define CHV_POWER_SS0_SIG1			_MMIO(0xa720)
9260d53879fSMatt Roper #define CHV_POWER_SS0_SIG2			_MMIO(0xa724)
9270d53879fSMatt Roper #define CHV_POWER_SS1_SIG1			_MMIO(0xa728)
9280d53879fSMatt Roper #define   CHV_SS_PG_ENABLE			(1 << 1)
9290d53879fSMatt Roper #define   CHV_EU08_PG_ENABLE			(1 << 9)
9300d53879fSMatt Roper #define   CHV_EU19_PG_ENABLE			(1 << 17)
9310d53879fSMatt Roper #define   CHV_EU210_PG_ENABLE			(1 << 25)
9320d53879fSMatt Roper #define CHV_POWER_SS1_SIG2			_MMIO(0xa72c)
9330d53879fSMatt Roper #define   CHV_EU311_PG_ENABLE			(1 << 1)
9340d6419e9SMatt Roper 
9350d53879fSMatt Roper #define GEN7_SARCHKMD				_MMIO(0xb000)
9360d53879fSMatt Roper #define   GEN7_DISABLE_DEMAND_PREFETCH		(1 << 31)
9370d53879fSMatt Roper #define   GEN7_DISABLE_SAMPLER_PREFETCH		(1 << 30)
9380d6419e9SMatt Roper 
9390d53879fSMatt Roper #define GEN8_GARBCNTL				_MMIO(0xb004)
940c46c5fb7SMatt Roper #define   GEN11_ARBITRATION_PRIO_ORDER_MASK	REG_GENMASK(27, 22)
941c46c5fb7SMatt Roper #define   GEN12_BUS_HASH_CTL_BIT_EXC		REG_BIT(7)
942c46c5fb7SMatt Roper #define   GEN9_GAPS_TSV_CREDIT_DISABLE		REG_BIT(7)
943c46c5fb7SMatt Roper #define   GEN11_HASH_CTRL_EXCL_MASK		REG_GENMASK(6, 0)
944c46c5fb7SMatt Roper #define   GEN11_HASH_CTRL_EXCL_BIT0		REG_FIELD_PREP(GEN11_HASH_CTRL_EXCL_MASK, 0x1)
9450d53879fSMatt Roper 
9460d53879fSMatt Roper #define GEN9_SCRATCH_LNCF1			_MMIO(0xb008)
9470d53879fSMatt Roper #define   GEN9_LNCF_NONIA_COHERENT_ATOMICS_ENABLE	REG_BIT(0)
9480d53879fSMatt Roper 
9490d53879fSMatt Roper #define GEN7_L3SQCREG1				_MMIO(0xb010)
9500d53879fSMatt Roper #define   VLV_B0_WA_L3SQCREG1_VALUE		0x00D30000
9510d53879fSMatt Roper 
9520d53879fSMatt Roper #define GEN7_L3CNTLREG1				_MMIO(0xb01c)
9530d53879fSMatt Roper #define   GEN7_WA_FOR_GEN7_L3_CONTROL		0x3C47FF8C
9540d53879fSMatt Roper #define   GEN7_L3AGDIS				(1 << 19)
9553b05c960SGustavo Sousa 
9560d53879fSMatt Roper #define GEN7_L3CNTLREG2				_MMIO(0xb020)
9570d53879fSMatt Roper 
9580d53879fSMatt Roper /* MOCS (Memory Object Control State) registers */
9590d53879fSMatt Roper #define GEN9_LNCFCMOCS(i)			_MMIO(0xb020 + (i) * 4)	/* L3 Cache Control */
960a9e69428SMatt Roper #define XEHP_LNCFCMOCS(i)			MCR_REG(0xb020 + (i) * 4)
96177fa9efcSMatt Roper #define LNCFCMOCS_REG_COUNT			32
9620d53879fSMatt Roper 
9630d53879fSMatt Roper #define GEN7_L3CNTLREG3				_MMIO(0xb024)
9640d53879fSMatt Roper 
9650d53879fSMatt Roper #define GEN7_L3_CHICKEN_MODE_REGISTER		_MMIO(0xb030)
9660d53879fSMatt Roper #define   GEN7_WA_L3_CHICKEN_MODE		0x20000000
9670d53879fSMatt Roper 
9680d53879fSMatt Roper #define GEN7_L3SQCREG4				_MMIO(0xb034)
9690d53879fSMatt Roper #define   L3SQ_URB_READ_CAM_MATCH_DISABLE	(1 << 27)
9700d53879fSMatt Roper 
9710d53879fSMatt Roper #define HSW_SCRATCH1				_MMIO(0xb038)
9720d53879fSMatt Roper #define   HSW_SCRATCH1_L3_DATA_ATOMICS_DISABLE	(1 << 27)
9730d53879fSMatt Roper 
9740d53879fSMatt Roper #define GEN7_L3LOG(slice, i)			_MMIO(0xb070 + (slice) * 0x200 + (i) * 4)
9750d53879fSMatt Roper #define   GEN7_L3LOG_SIZE			0x80
9760d53879fSMatt Roper 
977a9e69428SMatt Roper #define XEHP_L3NODEARBCFG			MCR_REG(0xb0b4)
9780d53879fSMatt Roper #define   XEHP_LNESPARE				REG_BIT(19)
9790d53879fSMatt Roper 
980a9e69428SMatt Roper #define GEN8_L3SQCREG1				MCR_REG(0xb100)
9810d53879fSMatt Roper /*
9820d53879fSMatt Roper  * Note that on CHV the following has an off-by-one error wrt. to BSpec.
9830d53879fSMatt Roper  * Using the formula in BSpec leads to a hang, while the formula here works
9840d53879fSMatt Roper  * fine and matches the formulas for all other platforms. A BSpec change
9850d53879fSMatt Roper  * request has been filed to clarify this.
9860d53879fSMatt Roper  */
9870d53879fSMatt Roper #define   L3_GENERAL_PRIO_CREDITS(x)		(((x) >> 1) << 19)
9880d53879fSMatt Roper #define   L3_HIGH_PRIO_CREDITS(x)		(((x) >> 1) << 14)
9890d53879fSMatt Roper #define   L3_PRIO_CREDITS_MASK			((0x1f << 19) | (0x1f << 14))
9900d53879fSMatt Roper 
991a9e69428SMatt Roper #define GEN8_L3SQCREG4				MCR_REG(0xb118)
9920d53879fSMatt Roper #define   GEN11_LQSC_CLEAN_EVICT_DISABLE	(1 << 6)
9930d53879fSMatt Roper #define   GEN8_LQSC_RO_PERF_DIS			(1 << 27)
9940d53879fSMatt Roper #define   GEN8_LQSC_FLUSH_COHERENT_LINES	(1 << 21)
9950d53879fSMatt Roper #define   GEN8_LQSQ_NONIA_COHERENT_ATOMICS_ENABLE	REG_BIT(22)
9960d53879fSMatt Roper 
997a9e69428SMatt Roper #define GEN9_SCRATCH1				MCR_REG(0xb11c)
9980d53879fSMatt Roper #define   EVICTION_PERF_FIX_ENABLE		REG_BIT(8)
9990d53879fSMatt Roper 
1000a9e69428SMatt Roper #define BDW_SCRATCH1				MCR_REG(0xb11c)
10010d53879fSMatt Roper #define   GEN9_LBS_SLA_RETRY_TIMER_DECREMENT_ENABLE	(1 << 2)
10020d53879fSMatt Roper 
1003a9e69428SMatt Roper #define GEN11_SCRATCH2				MCR_REG(0xb140)
10040d53879fSMatt Roper #define   GEN11_COHERENT_PARTIAL_WRITE_MERGE_ENABLE	(1 << 19)
10050d53879fSMatt Roper 
1006a9e69428SMatt Roper #define XEHP_L3SQCREG5				MCR_REG(0xb158)
10070d53879fSMatt Roper #define   L3_PWM_TIMER_INIT_VAL_MASK		REG_GENMASK(9, 0)
10080d53879fSMatt Roper 
1009a9e69428SMatt Roper #define XEHP_L3SCQREG7				MCR_REG(0xb188)
10100d53879fSMatt Roper #define   BLEND_FILL_CACHING_OPT_DIS		REG_BIT(3)
10110d53879fSMatt Roper 
10120d53879fSMatt Roper #define GEN11_GLBLINVL				_MMIO(0xb404)
10130d53879fSMatt Roper #define   GEN11_BANK_HASH_ADDR_EXCL_MASK	(0x7f << 5)
10140d53879fSMatt Roper #define   GEN11_BANK_HASH_ADDR_EXCL_BIT0	(1 << 5)
10150d53879fSMatt Roper 
10160d53879fSMatt Roper #define GEN11_LSN_UNSLCVC			_MMIO(0xb43c)
10170d53879fSMatt Roper #define   GEN11_LSN_UNSLCVC_GAFS_HALF_CL2_MAXALLOC	(1 << 9)
10180d53879fSMatt Roper #define   GEN11_LSN_UNSLCVC_GAFS_HALF_SF_MAXALLOC	(1 << 7)
10190d53879fSMatt Roper 
1020368d179aSJohn Harrison #define GUCPMTIMESTAMP				_MMIO(0xc3e8)
1021368d179aSJohn Harrison 
10220d53879fSMatt Roper #define __GEN9_RCS0_MOCS0			0xc800
10230d53879fSMatt Roper #define GEN9_GFX_MOCS(i)			_MMIO(__GEN9_RCS0_MOCS0 + (i) * 4)
10240d53879fSMatt Roper #define __GEN9_VCS0_MOCS0			0xc900
10250d53879fSMatt Roper #define GEN9_MFX0_MOCS(i)			_MMIO(__GEN9_VCS0_MOCS0 + (i) * 4)
10260d53879fSMatt Roper #define __GEN9_VCS1_MOCS0			0xca00
10270d53879fSMatt Roper #define GEN9_MFX1_MOCS(i)			_MMIO(__GEN9_VCS1_MOCS0 + (i) * 4)
10280d53879fSMatt Roper #define __GEN9_VECS0_MOCS0			0xcb00
10290d53879fSMatt Roper #define GEN9_VEBOX_MOCS(i)			_MMIO(__GEN9_VECS0_MOCS0 + (i) * 4)
10300d53879fSMatt Roper #define __GEN9_BCS0_MOCS0			0xcc00
10310d53879fSMatt Roper #define GEN9_BLT_MOCS(i)			_MMIO(__GEN9_BCS0_MOCS0 + (i) * 4)
10320d53879fSMatt Roper 
10330d53879fSMatt Roper #define GEN12_FAULT_TLB_DATA0			_MMIO(0xceb8)
1034a9e69428SMatt Roper #define XEHP_FAULT_TLB_DATA0			MCR_REG(0xceb8)
10350d53879fSMatt Roper #define GEN12_FAULT_TLB_DATA1			_MMIO(0xcebc)
1036a9e69428SMatt Roper #define XEHP_FAULT_TLB_DATA1			MCR_REG(0xcebc)
10370d53879fSMatt Roper #define   FAULT_VA_HIGH_BITS			(0xf << 0)
10380d53879fSMatt Roper #define   FAULT_GTT_SEL				(1 << 4)
10390d53879fSMatt Roper 
10400d6419e9SMatt Roper #define GEN12_RING_FAULT_REG			_MMIO(0xcec4)
1041a9e69428SMatt Roper #define XEHP_RING_FAULT_REG			MCR_REG(0xcec4)
104237d62359SNirmoy Das #define XELPMP_RING_FAULT_REG			_MMIO(0xcec4)
10430d6419e9SMatt Roper #define   GEN8_RING_FAULT_ENGINE_ID(x)		(((x) >> 12) & 0x7)
10440d6419e9SMatt Roper #define   RING_FAULT_GTTSEL_MASK		(1 << 11)
10450d6419e9SMatt Roper #define   RING_FAULT_SRCID(x)			(((x) >> 3) & 0xff)
10460d6419e9SMatt Roper #define   RING_FAULT_FAULT_TYPE(x)		(((x) >> 1) & 0x3)
10470d6419e9SMatt Roper #define   RING_FAULT_VALID			(1 << 0)
10480d6419e9SMatt Roper 
104922ba60f6SMatt Roper #define GEN12_GFX_TLB_INV_CR			_MMIO(0xced8)
1050a9e69428SMatt Roper #define XEHP_GFX_TLB_INV_CR			MCR_REG(0xced8)
105122ba60f6SMatt Roper #define GEN12_VD_TLB_INV_CR			_MMIO(0xcedc)
1052a9e69428SMatt Roper #define XEHP_VD_TLB_INV_CR			MCR_REG(0xcedc)
105322ba60f6SMatt Roper #define GEN12_VE_TLB_INV_CR			_MMIO(0xcee0)
1054a9e69428SMatt Roper #define XEHP_VE_TLB_INV_CR			MCR_REG(0xcee0)
105522ba60f6SMatt Roper #define GEN12_BLT_TLB_INV_CR			_MMIO(0xcee4)
1056a9e69428SMatt Roper #define XEHP_BLT_TLB_INV_CR			MCR_REG(0xcee4)
105797e17a09SMatt Roper #define GEN12_COMPCTX_TLB_INV_CR		_MMIO(0xcf04)
1058a9e69428SMatt Roper #define XEHP_COMPCTX_TLB_INV_CR			MCR_REG(0xcf04)
10591c388da5SMatt Roper #define XELPMP_GSC_TLB_INV_CR			_MMIO(0xcf04)   /* media GT only */
106022ba60f6SMatt Roper 
1061a9e69428SMatt Roper #define RENDER_MOD_CTRL				MCR_REG(0xcf2c)
1062a9e69428SMatt Roper #define COMP_MOD_CTRL				MCR_REG(0xcf30)
1063eda94a6eSMatt Roper #define XELPMP_GSC_MOD_CTRL			_MMIO(0xcf30)	/* media GT only */
1064eda94a6eSMatt Roper #define XEHP_VDBX_MOD_CTRL			MCR_REG(0xcf34)
1065eda94a6eSMatt Roper #define XELPMP_VDBX_MOD_CTRL			_MMIO(0xcf34)
1066eda94a6eSMatt Roper #define XEHP_VEBX_MOD_CTRL			MCR_REG(0xcf38)
1067eda94a6eSMatt Roper #define XELPMP_VEBX_MOD_CTRL			_MMIO(0xcf38)
10680d53879fSMatt Roper #define   FORCE_MISS_FTLB			REG_BIT(3)
10690d6419e9SMatt Roper 
10707649a5d1SMatt Roper #define XEHP_GAMSTLB_CTRL			MCR_REG(0xcf4c)
10710d53879fSMatt Roper #define   CONTROL_BLOCK_CLKGATE_DIS		REG_BIT(12)
10720d53879fSMatt Roper #define   EGRESS_BLOCK_CLKGATE_DIS		REG_BIT(11)
10730d53879fSMatt Roper #define   TAG_BLOCK_CLKGATE_DIS			REG_BIT(7)
10740d6419e9SMatt Roper 
10757649a5d1SMatt Roper #define XEHP_GAMCNTRL_CTRL			MCR_REG(0xcf54)
10760d53879fSMatt Roper #define   INVALIDATION_BROADCAST_MODE_DIS	REG_BIT(12)
10770d53879fSMatt Roper #define   GLOBAL_INVALIDATION_MODE		REG_BIT(2)
10780d6419e9SMatt Roper 
10790d53879fSMatt Roper #define GEN12_GAM_DONE				_MMIO(0xcf68)
10800d6419e9SMatt Roper 
10810d53879fSMatt Roper #define GEN7_HALF_SLICE_CHICKEN1		_MMIO(0xe100) /* IVB GT1 + VLV */
1082a9e69428SMatt Roper #define GEN8_HALF_SLICE_CHICKEN1		MCR_REG(0xe100)
10830d53879fSMatt Roper #define   GEN7_MAX_PS_THREAD_DEP		(8 << 12)
10840d53879fSMatt Roper #define   GEN7_SINGLE_SUBSCAN_DISPATCH_ENABLE	(1 << 10)
10850d53879fSMatt Roper #define   GEN7_SBE_SS_CACHE_DISPATCH_PORT_SHARING_DISABLE	(1 << 4)
10860d53879fSMatt Roper #define   GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE	(1 << 3)
10870d6419e9SMatt Roper 
10880d53879fSMatt Roper #define GEN7_SAMPLER_INSTDONE			_MMIO(0xe160)
1089a9e69428SMatt Roper #define GEN8_SAMPLER_INSTDONE			MCR_REG(0xe160)
10900d53879fSMatt Roper #define GEN7_ROW_INSTDONE			_MMIO(0xe164)
1091a9e69428SMatt Roper #define GEN8_ROW_INSTDONE			MCR_REG(0xe164)
10920d6419e9SMatt Roper 
1093a9e69428SMatt Roper #define HALF_SLICE_CHICKEN2			MCR_REG(0xe180)
10940d53879fSMatt Roper #define   GEN8_ST_PO_DISABLE			(1 << 13)
10950d6419e9SMatt Roper 
1096dfa13f1bSMatt Roper #define HSW_HALF_SLICE_CHICKEN3			_MMIO(0xe184)
1097a9e69428SMatt Roper #define GEN8_HALF_SLICE_CHICKEN3		MCR_REG(0xe184)
10980d53879fSMatt Roper #define   HSW_SAMPLE_C_PERFORMANCE		(1 << 9)
10990d53879fSMatt Roper #define   GEN8_CENTROID_PIXEL_OPT_DIS		(1 << 8)
11000d53879fSMatt Roper #define   GEN9_DISABLE_OCL_OOB_SUPPRESS_LOGIC	(1 << 5)
11010d53879fSMatt Roper #define   GEN8_SAMPLER_POWER_BYPASS_DIS		(1 << 1)
11020d6419e9SMatt Roper 
1103a9e69428SMatt Roper #define GEN9_HALF_SLICE_CHICKEN5		MCR_REG(0xe188)
11040d53879fSMatt Roper #define   GEN9_DG_MIRROR_FIX_ENABLE		(1 << 5)
11050d53879fSMatt Roper #define   GEN9_CCS_TLB_PREFETCH_ENABLE		(1 << 3)
11060d6419e9SMatt Roper 
1107a9e69428SMatt Roper #define GEN10_SAMPLER_MODE			MCR_REG(0xe18c)
11080d53879fSMatt Roper #define   ENABLE_SMALLPL			REG_BIT(15)
1109ae5a3d2cSHarish Chegondi #define   SC_DISABLE_POWER_OPTIMIZATION_EBB	REG_BIT(9)
11100d53879fSMatt Roper #define   GEN11_SAMPLER_ENABLE_HEADLESS_MSG	REG_BIT(5)
11115fba65efSRadhakrishna Sripada #define   MTL_DISABLE_SAMPLER_SC_OOO		REG_BIT(3)
111281900e3aSLionel Landwerlin #define   GEN11_INDIRECT_STATE_BASE_ADDR_OVERRIDE	REG_BIT(0)
11130d6419e9SMatt Roper 
1114a9e69428SMatt Roper #define GEN9_HALF_SLICE_CHICKEN7		MCR_REG(0xe194)
11150d53879fSMatt Roper #define   DG2_DISABLE_ROUND_ENABLE_ALLOW_FOR_SSLA	REG_BIT(15)
11160d53879fSMatt Roper #define   GEN9_SAMPLER_HASH_COMPRESSED_READ_ADDR	REG_BIT(8)
11170d53879fSMatt Roper #define   GEN9_ENABLE_YV12_BUGFIX		REG_BIT(4)
11180d53879fSMatt Roper #define   GEN9_ENABLE_GPGPU_PREEMPTION		REG_BIT(2)
11190d6419e9SMatt Roper 
1120a9e69428SMatt Roper #define GEN10_CACHE_MODE_SS			MCR_REG(0xe420)
1121411d44d7SSwathi Dhanavanthri #define   ENABLE_EU_COUNT_FOR_TDL_FLUSH		REG_BIT(10)
1122ce581ae1SStuart Summers #define   DISABLE_ECC				REG_BIT(5)
11230d6419e9SMatt Roper #define   FLOAT_BLEND_OPTIMIZATION_ENABLE	REG_BIT(4)
11249079363eSRadhakrishna Sripada /*
11259079363eSRadhakrishna Sripada  * We have both ENABLE and DISABLE defines below using the same bit because the
11269079363eSRadhakrishna Sripada  * meaning depends on the target platform. There are no platform prefix for them
11279079363eSRadhakrishna Sripada  * because different steppings of DG2 pick one or the other semantics.
11289079363eSRadhakrishna Sripada  */
1129ce581ae1SStuart Summers #define   ENABLE_PREFETCH_INTO_IC		REG_BIT(3)
11309079363eSRadhakrishna Sripada #define   DISABLE_PREFETCH_INTO_IC		REG_BIT(3)
11310d6419e9SMatt Roper 
113258bc2453SMatt Roper #define EU_PERF_CNTL0				PERF_REG(0xe458)
113358bc2453SMatt Roper #define EU_PERF_CNTL4				PERF_REG(0xe45c)
11340d6419e9SMatt Roper 
1135a9e69428SMatt Roper #define GEN9_ROW_CHICKEN4			MCR_REG(0xe48c)
113630424ebaSRodrigo Vivi #define   XEHP_DIS_BBL_SYSPIPE			REG_BIT(11)
11370d53879fSMatt Roper #define   GEN12_DISABLE_TDL_PUSH		REG_BIT(9)
11380d53879fSMatt Roper #define   GEN11_DIS_PICK_2ND_EU			REG_BIT(7)
11390d53879fSMatt Roper #define   GEN12_DISABLE_HDR_PAST_PAYLOAD_HOLD_FIX	REG_BIT(4)
114073c7a8a8SMatt Roper #define   THREAD_EX_ARB_MODE			REG_GENMASK(3, 2)
114173c7a8a8SMatt Roper #define   THREAD_EX_ARB_MODE_RR_AFTER_DEP	REG_FIELD_PREP(THREAD_EX_ARB_MODE, 0x2)
11420d6419e9SMatt Roper 
11430d53879fSMatt Roper #define HSW_ROW_CHICKEN3			_MMIO(0xe49c)
11444b51210fSHaridhar Kalvala #define GEN9_ROW_CHICKEN3			MCR_REG(0xe49c)
11450d53879fSMatt Roper #define   HSW_ROW_CHICKEN3_L3_GLOBAL_ATOMICS_DISABLE	(1 << 6)
11464b51210fSHaridhar Kalvala #define   MTL_DISABLE_FIX_FOR_EOT_FLUSH		REG_BIT(9)
11470d6419e9SMatt Roper 
1148a9e69428SMatt Roper #define GEN8_ROW_CHICKEN			MCR_REG(0xe4f0)
11490d53879fSMatt Roper #define   FLOW_CONTROL_ENABLE			REG_BIT(15)
11500d53879fSMatt Roper #define   UGM_BACKUP_MODE			REG_BIT(13)
11510d53879fSMatt Roper #define   MDQ_ARBITRATION_MODE			REG_BIT(12)
11520d53879fSMatt Roper #define   PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE	REG_BIT(8)
11530d53879fSMatt Roper #define   STALL_DOP_GATING_DISABLE		REG_BIT(5)
11540d53879fSMatt Roper #define   THROTTLE_12_5				REG_GENMASK(4, 2)
11550d53879fSMatt Roper #define   DISABLE_EARLY_EOT			REG_BIT(1)
11560d6419e9SMatt Roper 
11570d53879fSMatt Roper #define GEN7_ROW_CHICKEN2			_MMIO(0xe4f4)
1158dfa13f1bSMatt Roper 
1159a9e69428SMatt Roper #define GEN8_ROW_CHICKEN2			MCR_REG(0xe4f4)
11600d53879fSMatt Roper #define   GEN12_DISABLE_READ_SUPPRESSION	REG_BIT(15)
11610d53879fSMatt Roper #define   GEN12_DISABLE_EARLY_READ		REG_BIT(14)
11620d53879fSMatt Roper #define   GEN12_ENABLE_LARGE_GRF_MODE		REG_BIT(12)
11630d53879fSMatt Roper #define   GEN12_PUSH_CONST_DEREF_HOLD_DIS	REG_BIT(8)
1164b4985cceSRadhakrishna Sripada #define   XELPG_DISABLE_TDL_SVHS_GATING		REG_BIT(1)
1165ed6b25aaSUmesh Nerlige Ramappa #define   GEN12_DISABLE_DOP_GATING              REG_BIT(0)
11660d6419e9SMatt Roper 
1167a9e69428SMatt Roper #define RT_CTRL					MCR_REG(0xe530)
11680d53879fSMatt Roper #define   DIS_NULL_QUERY			REG_BIT(10)
11696dc85721SMatt Roper #define   STACKID_CTRL				REG_GENMASK(6, 5)
11706dc85721SMatt Roper #define   STACKID_CTRL_512			REG_FIELD_PREP(STACKID_CTRL, 0x2)
11710d6419e9SMatt Roper 
117258bc2453SMatt Roper #define EU_PERF_CNTL1				PERF_REG(0xe558)
117358bc2453SMatt Roper #define EU_PERF_CNTL5				PERF_REG(0xe55c)
11740d6419e9SMatt Roper 
1175a9e69428SMatt Roper #define XEHP_HDC_CHICKEN0			MCR_REG(0xe5f0)
11760d53879fSMatt Roper #define   LSC_L1_FLUSH_CTL_3D_DATAPORT_FLUSH_EVENTS_MASK	REG_GENMASK(13, 11)
11774632e320SShekhar Chauhan #define   DIS_ATOMIC_CHAINING_TYPED_WRITES	REG_BIT(3)
11784632e320SShekhar Chauhan 
1179a9e69428SMatt Roper #define ICL_HDC_MODE				MCR_REG(0xe5f4)
11800d6419e9SMatt Roper 
118158bc2453SMatt Roper #define EU_PERF_CNTL2				PERF_REG(0xe658)
118258bc2453SMatt Roper #define EU_PERF_CNTL6				PERF_REG(0xe65c)
118358bc2453SMatt Roper #define EU_PERF_CNTL3				PERF_REG(0xe758)
11840d6419e9SMatt Roper 
1185a9e69428SMatt Roper #define LSC_CHICKEN_BIT_0			MCR_REG(0xe7c8)
11863f654e14SJosé Roberto de Souza #define   DISABLE_D8_D16_COASLESCE		REG_BIT(30)
11870d53879fSMatt Roper #define   FORCE_1_SUB_MESSAGE_PER_FRAGMENT	REG_BIT(15)
1188a9e69428SMatt Roper #define LSC_CHICKEN_BIT_0_UDW			MCR_REG(0xe7c8 + 4)
1189ae0e5e6eSShekhar Chauhan #define   UGM_FRAGMENT_THRESHOLD_TO_3		REG_BIT(58 - 32)
11900d53879fSMatt Roper #define   DIS_CHAIN_2XSIMD8			REG_BIT(55 - 32)
11910d53879fSMatt Roper #define   FORCE_SLM_FENCE_SCOPE_TO_TILE		REG_BIT(42 - 32)
11920d53879fSMatt Roper #define   FORCE_UGM_FENCE_SCOPE_TO_TILE		REG_BIT(41 - 32)
11930d53879fSMatt Roper #define   MAXREQS_PER_BANK			REG_GENMASK(39 - 32, 37 - 32)
11940d53879fSMatt Roper #define   DISABLE_128B_EVICTION_COMMAND_UDW	REG_BIT(36 - 32)
11950d6419e9SMatt Roper 
1196a9e69428SMatt Roper #define SARB_CHICKEN1				MCR_REG(0xe90c)
11970d53879fSMatt Roper #define   COMP_CKN_IN				REG_GENMASK(30, 29)
11980d6419e9SMatt Roper 
11990d53879fSMatt Roper #define GEN7_ROW_CHICKEN2_GT2			_MMIO(0xf4f4)
12000d53879fSMatt Roper #define   DOP_CLOCK_GATING_DISABLE		(1 << 0)
12010d53879fSMatt Roper #define   PUSH_CONSTANT_DEREF_DISABLE		(1 << 8)
12020d53879fSMatt Roper #define   GEN11_TDL_CLOCK_GATING_FIX_DISABLE	(1 << 1)
12030d6419e9SMatt Roper 
12040d53879fSMatt Roper #define __GEN11_VCS2_MOCS0			0x10000
12050d53879fSMatt Roper #define GEN11_MFX2_MOCS(i)			_MMIO(__GEN11_VCS2_MOCS0 + (i) * 4)
12060d6419e9SMatt Roper 
12070d6419e9SMatt Roper #define CRSTANDVID				_MMIO(0x11100)
12080d6419e9SMatt Roper #define PXVFREQ(fstart)				_MMIO(0x11110 + (fstart) * 4)  /* P[0-15]VIDFREQ (0x1114c) (Ironlake) */
12090d6419e9SMatt Roper #define   PXVFREQ_PX_MASK			0x7f000000
12100d6419e9SMatt Roper #define   PXVFREQ_PX_SHIFT			24
12110d6419e9SMatt Roper #define VIDFREQ_BASE				_MMIO(0x11110)
12120d6419e9SMatt Roper #define VIDFREQ1				_MMIO(0x11110) /* VIDFREQ1-4 (0x1111c) (Cantiga) */
12130d6419e9SMatt Roper #define VIDFREQ2				_MMIO(0x11114)
12140d6419e9SMatt Roper #define VIDFREQ3				_MMIO(0x11118)
12150d6419e9SMatt Roper #define VIDFREQ4				_MMIO(0x1111c)
12160d6419e9SMatt Roper #define   VIDFREQ_P0_MASK			0x1f000000
12170d6419e9SMatt Roper #define   VIDFREQ_P0_SHIFT			24
12180d6419e9SMatt Roper #define   VIDFREQ_P0_CSCLK_MASK			0x00f00000
12190d6419e9SMatt Roper #define   VIDFREQ_P0_CSCLK_SHIFT		20
12200d6419e9SMatt Roper #define   VIDFREQ_P0_CRCLK_MASK			0x000f0000
12210d6419e9SMatt Roper #define   VIDFREQ_P0_CRCLK_SHIFT		16
12220d6419e9SMatt Roper #define   VIDFREQ_P1_MASK			0x00001f00
12230d6419e9SMatt Roper #define   VIDFREQ_P1_SHIFT			8
12240d6419e9SMatt Roper #define   VIDFREQ_P1_CSCLK_MASK			0x000000f0
12250d6419e9SMatt Roper #define   VIDFREQ_P1_CSCLK_SHIFT		4
12260d6419e9SMatt Roper #define   VIDFREQ_P1_CRCLK_MASK			0x0000000f
12270d6419e9SMatt Roper #define INTTOEXT_BASE				_MMIO(0x11120) /* INTTOEXT1-8 (0x1113c) */
12280d6419e9SMatt Roper #define   INTTOEXT_MAP3_SHIFT			24
12290d6419e9SMatt Roper #define   INTTOEXT_MAP3_MASK			(0x1f << INTTOEXT_MAP3_SHIFT)
12300d6419e9SMatt Roper #define   INTTOEXT_MAP2_SHIFT			16
12310d6419e9SMatt Roper #define   INTTOEXT_MAP2_MASK			(0x1f << INTTOEXT_MAP2_SHIFT)
12320d6419e9SMatt Roper #define   INTTOEXT_MAP1_SHIFT			8
12330d6419e9SMatt Roper #define   INTTOEXT_MAP1_MASK			(0x1f << INTTOEXT_MAP1_SHIFT)
12340d6419e9SMatt Roper #define   INTTOEXT_MAP0_SHIFT			0
12350d6419e9SMatt Roper #define   INTTOEXT_MAP0_MASK			(0x1f << INTTOEXT_MAP0_SHIFT)
12360d6419e9SMatt Roper #define MEMSWCTL				_MMIO(0x11170) /* Ironlake only */
12370d6419e9SMatt Roper #define   MEMCTL_CMD_MASK			0xe000
12380d6419e9SMatt Roper #define   MEMCTL_CMD_SHIFT			13
12390d6419e9SMatt Roper #define   MEMCTL_CMD_RCLK_OFF			0
12400d6419e9SMatt Roper #define   MEMCTL_CMD_RCLK_ON			1
12410d6419e9SMatt Roper #define   MEMCTL_CMD_CHFREQ			2
12420d6419e9SMatt Roper #define   MEMCTL_CMD_CHVID			3
12430d6419e9SMatt Roper #define   MEMCTL_CMD_VMMOFF			4
12440d6419e9SMatt Roper #define   MEMCTL_CMD_VMMON			5
12450d6419e9SMatt Roper #define   MEMCTL_CMD_STS			(1 << 12) /* write 1 triggers command, clears
12460d6419e9SMatt Roper 							     when command complete */
12470d6419e9SMatt Roper #define   MEMCTL_FREQ_MASK			0x0f00 /* jitter, from 0-15 */
12480d6419e9SMatt Roper #define   MEMCTL_FREQ_SHIFT			8
12490d6419e9SMatt Roper #define   MEMCTL_SFCAVM				(1 << 7)
12500d6419e9SMatt Roper #define   MEMCTL_TGT_VID_MASK			0x007f
12510d6419e9SMatt Roper #define MEMIHYST				_MMIO(0x1117c)
12520d6419e9SMatt Roper #define MEMINTREN				_MMIO(0x11180) /* 16 bits */
12530d6419e9SMatt Roper #define   MEMINT_RSEXIT_EN			(1 << 8)
12540d6419e9SMatt Roper #define   MEMINT_CX_SUPR_EN			(1 << 7)
12550d6419e9SMatt Roper #define   MEMINT_CONT_BUSY_EN			(1 << 6)
12560d6419e9SMatt Roper #define   MEMINT_AVG_BUSY_EN			(1 << 5)
12570d6419e9SMatt Roper #define   MEMINT_EVAL_CHG_EN			(1 << 4)
12580d6419e9SMatt Roper #define   MEMINT_MON_IDLE_EN			(1 << 3)
12590d6419e9SMatt Roper #define   MEMINT_UP_EVAL_EN			(1 << 2)
12600d6419e9SMatt Roper #define   MEMINT_DOWN_EVAL_EN			(1 << 1)
12610d6419e9SMatt Roper #define   MEMINT_SW_CMD_EN			(1 << 0)
12620d6419e9SMatt Roper #define MEMINTRSTR				_MMIO(0x11182) /* 16 bits */
12630d6419e9SMatt Roper #define   MEM_RSEXIT_MASK			0xc000
12640d6419e9SMatt Roper #define   MEM_RSEXIT_SHIFT			14
12650d6419e9SMatt Roper #define   MEM_CONT_BUSY_MASK			0x3000
12660d6419e9SMatt Roper #define   MEM_CONT_BUSY_SHIFT			12
12670d6419e9SMatt Roper #define   MEM_AVG_BUSY_MASK			0x0c00
12680d6419e9SMatt Roper #define   MEM_AVG_BUSY_SHIFT			10
12690d6419e9SMatt Roper #define   MEM_EVAL_CHG_MASK			0x0300
12700d6419e9SMatt Roper #define   MEM_EVAL_BUSY_SHIFT			8
12710d6419e9SMatt Roper #define   MEM_MON_IDLE_MASK			0x00c0
12720d6419e9SMatt Roper #define   MEM_MON_IDLE_SHIFT			6
12730d6419e9SMatt Roper #define   MEM_UP_EVAL_MASK			0x0030
12740d6419e9SMatt Roper #define   MEM_UP_EVAL_SHIFT			4
12750d6419e9SMatt Roper #define   MEM_DOWN_EVAL_MASK			0x000c
12760d6419e9SMatt Roper #define   MEM_DOWN_EVAL_SHIFT			2
12770d6419e9SMatt Roper #define   MEM_SW_CMD_MASK			0x0003
12780d6419e9SMatt Roper #define   MEM_INT_STEER_GFX			0
12790d6419e9SMatt Roper #define   MEM_INT_STEER_CMR			1
12800d6419e9SMatt Roper #define   MEM_INT_STEER_SMI			2
12810d6419e9SMatt Roper #define   MEM_INT_STEER_SCI			3
12820d6419e9SMatt Roper #define MEMINTRSTS				_MMIO(0x11184)
12830d6419e9SMatt Roper #define   MEMINT_RSEXIT				(1 << 7)
12840d6419e9SMatt Roper #define   MEMINT_CONT_BUSY			(1 << 6)
12850d6419e9SMatt Roper #define   MEMINT_AVG_BUSY			(1 << 5)
12860d6419e9SMatt Roper #define   MEMINT_EVAL_CHG			(1 << 4)
12870d6419e9SMatt Roper #define   MEMINT_MON_IDLE			(1 << 3)
12880d6419e9SMatt Roper #define   MEMINT_UP_EVAL			(1 << 2)
12890d6419e9SMatt Roper #define   MEMINT_DOWN_EVAL			(1 << 1)
12900d6419e9SMatt Roper #define   MEMINT_SW_CMD				(1 << 0)
12910d6419e9SMatt Roper #define MEMMODECTL				_MMIO(0x11190)
12920d6419e9SMatt Roper #define   MEMMODE_BOOST_EN			(1 << 31)
12930d6419e9SMatt Roper #define   MEMMODE_BOOST_FREQ_MASK		0x0f000000 /* jitter for boost, 0-15 */
12940d6419e9SMatt Roper #define   MEMMODE_BOOST_FREQ_SHIFT		24
12950d6419e9SMatt Roper #define   MEMMODE_IDLE_MODE_MASK		0x00030000
12960d6419e9SMatt Roper #define   MEMMODE_IDLE_MODE_SHIFT		16
12970d6419e9SMatt Roper #define   MEMMODE_IDLE_MODE_EVAL		0
12980d6419e9SMatt Roper #define   MEMMODE_IDLE_MODE_CONT		1
12990d6419e9SMatt Roper #define   MEMMODE_HWIDLE_EN			(1 << 15)
13000d6419e9SMatt Roper #define   MEMMODE_SWMODE_EN			(1 << 14)
13010d6419e9SMatt Roper #define   MEMMODE_RCLK_GATE			(1 << 13)
13020d6419e9SMatt Roper #define   MEMMODE_HW_UPDATE			(1 << 12)
13030d6419e9SMatt Roper #define   MEMMODE_FSTART_MASK			0x00000f00 /* starting jitter, 0-15 */
13040d6419e9SMatt Roper #define   MEMMODE_FSTART_SHIFT			8
13050d6419e9SMatt Roper #define   MEMMODE_FMAX_MASK			0x000000f0 /* max jitter, 0-15 */
13060d6419e9SMatt Roper #define   MEMMODE_FMAX_SHIFT			4
13070d6419e9SMatt Roper #define   MEMMODE_FMIN_MASK			0x0000000f /* min jitter, 0-15 */
13080d6419e9SMatt Roper #define RCBMAXAVG				_MMIO(0x1119c)
13090d6419e9SMatt Roper #define MEMSWCTL2				_MMIO(0x1119e) /* Cantiga only */
13100d6419e9SMatt Roper #define   SWMEMCMD_RENDER_OFF			(0 << 13)
13110d6419e9SMatt Roper #define   SWMEMCMD_RENDER_ON			(1 << 13)
13120d6419e9SMatt Roper #define   SWMEMCMD_SWFREQ			(2 << 13)
13130d6419e9SMatt Roper #define   SWMEMCMD_TARVID			(3 << 13)
13140d6419e9SMatt Roper #define   SWMEMCMD_VRM_OFF			(4 << 13)
13150d6419e9SMatt Roper #define   SWMEMCMD_VRM_ON			(5 << 13)
13160d6419e9SMatt Roper #define   CMDSTS				(1 << 12)
13170d6419e9SMatt Roper #define   SFCAVM				(1 << 11)
13180d6419e9SMatt Roper #define   SWFREQ_MASK				0x0380 /* P0-7 */
13190d6419e9SMatt Roper #define   SWFREQ_SHIFT				7
13200d6419e9SMatt Roper #define   TARVID_MASK				0x001f
13210d6419e9SMatt Roper #define MEMSTAT_CTG				_MMIO(0x111a0)
13220d6419e9SMatt Roper #define RCBMINAVG				_MMIO(0x111a0)
13230d6419e9SMatt Roper #define RCUPEI					_MMIO(0x111b0)
13240d6419e9SMatt Roper #define RCDNEI					_MMIO(0x111b4)
13250d6419e9SMatt Roper #define RSTDBYCTL				_MMIO(0x111b8)
13260d6419e9SMatt Roper #define   RS1EN					(1 << 31)
13270d6419e9SMatt Roper #define   RS2EN					(1 << 30)
13280d6419e9SMatt Roper #define   RS3EN					(1 << 29)
13290d6419e9SMatt Roper #define   D3RS3EN				(1 << 28) /* Display D3 imlies RS3 */
13300d6419e9SMatt Roper #define   SWPROMORSX				(1 << 27) /* RSx promotion timers ignored */
13310d6419e9SMatt Roper #define   RCWAKERW				(1 << 26) /* Resetwarn from PCH causes wakeup */
13320d6419e9SMatt Roper #define   DPRSLPVREN				(1 << 25) /* Fast voltage ramp enable */
13330d6419e9SMatt Roper #define   GFXTGHYST				(1 << 24) /* Hysteresis to allow trunk gating */
13340d6419e9SMatt Roper #define   RCX_SW_EXIT				(1 << 23) /* Leave RSx and prevent re-entry */
13350d6419e9SMatt Roper #define   RSX_STATUS_MASK			(7 << 20)
13360d6419e9SMatt Roper #define   RSX_STATUS_ON				(0 << 20)
13370d6419e9SMatt Roper #define   RSX_STATUS_RC1			(1 << 20)
13380d6419e9SMatt Roper #define   RSX_STATUS_RC1E			(2 << 20)
13390d6419e9SMatt Roper #define   RSX_STATUS_RS1			(3 << 20)
13400d6419e9SMatt Roper #define   RSX_STATUS_RS2			(4 << 20) /* aka rc6 */
13410d6419e9SMatt Roper #define   RSX_STATUS_RSVD			(5 << 20) /* deep rc6 unsupported on ilk */
13420d6419e9SMatt Roper #define   RSX_STATUS_RS3			(6 << 20) /* rs3 unsupported on ilk */
13430d6419e9SMatt Roper #define   RSX_STATUS_RSVD2			(7 << 20)
13440d6419e9SMatt Roper #define   UWRCRSXE				(1 << 19) /* wake counter limit prevents rsx */
13450d6419e9SMatt Roper #define   RSCRP					(1 << 18) /* rs requests control on rs1/2 reqs */
13460d6419e9SMatt Roper #define   JRSC					(1 << 17) /* rsx coupled to cpu c-state */
13470d6419e9SMatt Roper #define   RS2INC0				(1 << 16) /* allow rs2 in cpu c0 */
13480d6419e9SMatt Roper #define   RS1CONTSAV_MASK			(3 << 14)
13490d6419e9SMatt Roper #define   RS1CONTSAV_NO_RS1			(0 << 14) /* rs1 doesn't save/restore context */
13500d6419e9SMatt Roper #define   RS1CONTSAV_RSVD			(1 << 14)
13510d6419e9SMatt Roper #define   RS1CONTSAV_SAVE_RS1			(2 << 14) /* rs1 saves context */
13520d6419e9SMatt Roper #define   RS1CONTSAV_FULL_RS1			(3 << 14) /* rs1 saves and restores context */
13530d6419e9SMatt Roper #define   NORMSLEXLAT_MASK			(3 << 12)
13540d6419e9SMatt Roper #define   SLOW_RS123				(0 << 12)
13550d6419e9SMatt Roper #define   SLOW_RS23				(1 << 12)
13560d6419e9SMatt Roper #define   SLOW_RS3				(2 << 12)
13570d6419e9SMatt Roper #define   NORMAL_RS123				(3 << 12)
13580d6419e9SMatt Roper #define   RCMODE_TIMEOUT			(1 << 11) /* 0 is eval interval method */
13590d6419e9SMatt Roper #define   IMPROMOEN				(1 << 10) /* promo is immediate or delayed until next idle interval (only for timeout method above) */
13600d6419e9SMatt Roper #define   RCENTSYNC				(1 << 9) /* rs coupled to cpu c-state (3/6/7) */
13610d6419e9SMatt Roper #define   STATELOCK				(1 << 7) /* locked to rs_cstate if 0 */
13620d6419e9SMatt Roper #define   RS_CSTATE_MASK			(3 << 4)
13630d6419e9SMatt Roper #define   RS_CSTATE_C367_RS1			(0 << 4)
13640d6419e9SMatt Roper #define   RS_CSTATE_C36_RS1_C7_RS2		(1 << 4)
13650d6419e9SMatt Roper #define   RS_CSTATE_RSVD			(2 << 4)
13660d6419e9SMatt Roper #define   RS_CSTATE_C367_RS2			(3 << 4)
13670d6419e9SMatt Roper #define   REDSAVES				(1 << 3) /* no context save if was idle during rs0 */
13680d6419e9SMatt Roper #define   REDRESTORES				(1 << 2) /* no restore if was idle during rs0 */
13690d6419e9SMatt Roper #define VIDCTL					_MMIO(0x111c0)
13700d6419e9SMatt Roper #define VIDSTS					_MMIO(0x111c8)
13710d6419e9SMatt Roper #define VIDSTART				_MMIO(0x111cc) /* 8 bits */
13720d6419e9SMatt Roper #define MEMSTAT_ILK				_MMIO(0x111f8)
13730d6419e9SMatt Roper #define   MEMSTAT_VID_MASK			0x7f00
13740d6419e9SMatt Roper #define   MEMSTAT_VID_SHIFT			8
13752c0a284cSAshutosh Dixit #define   MEMSTAT_PSTATE_MASK			REG_GENMASK(7, 3)
13760d6419e9SMatt Roper #define   MEMSTAT_MON_ACTV			(1 << 2)
13770d6419e9SMatt Roper #define   MEMSTAT_SRC_CTL_MASK			0x0003
13780d6419e9SMatt Roper #define   MEMSTAT_SRC_CTL_CORE			0
13790d6419e9SMatt Roper #define   MEMSTAT_SRC_CTL_TRB			1
13800d6419e9SMatt Roper #define   MEMSTAT_SRC_CTL_THM			2
13810d6419e9SMatt Roper #define   MEMSTAT_SRC_CTL_STDBY			3
13820d6419e9SMatt Roper #define PMMISC					_MMIO(0x11214)
13830d6419e9SMatt Roper #define   MCPPCE_EN				(1 << 0) /* enable PM_MSG from PCH->MPC */
13840d6419e9SMatt Roper #define SDEW					_MMIO(0x1124c)
13850d6419e9SMatt Roper #define CSIEW0					_MMIO(0x11250)
13860d6419e9SMatt Roper #define CSIEW1					_MMIO(0x11254)
13870d6419e9SMatt Roper #define CSIEW2					_MMIO(0x11258)
13880d6419e9SMatt Roper #define PEW(i)					_MMIO(0x1125c + (i) * 4) /* 5 registers */
13890d6419e9SMatt Roper #define DEW(i)					_MMIO(0x11270 + (i) * 4) /* 3 registers */
13900d6419e9SMatt Roper #define MCHAFE					_MMIO(0x112c0)
13910d6419e9SMatt Roper #define CSIEC					_MMIO(0x112e0)
13920d6419e9SMatt Roper #define DMIEC					_MMIO(0x112e4)
13930d6419e9SMatt Roper #define DDREC					_MMIO(0x112e8)
13940d6419e9SMatt Roper #define PEG0EC					_MMIO(0x112ec)
13950d6419e9SMatt Roper #define PEG1EC					_MMIO(0x112f0)
13960d6419e9SMatt Roper #define GFXEC					_MMIO(0x112f4)
13970d53879fSMatt Roper #define INTTOEXT_BASE_ILK			_MMIO(0x11300)
13980d6419e9SMatt Roper #define RPPREVBSYTUPAVG				_MMIO(0x113b8)
13990d53879fSMatt Roper #define RCPREVBSYTUPAVG				_MMIO(0x113b8)
14000d53879fSMatt Roper #define RCPREVBSYTDNAVG				_MMIO(0x113bc)
14010d6419e9SMatt Roper #define RPPREVBSYTDNAVG				_MMIO(0x113bc)
14020d6419e9SMatt Roper #define ECR					_MMIO(0x11600)
14030d6419e9SMatt Roper #define   ECR_GPFE				(1 << 31)
14040d6419e9SMatt Roper #define   ECR_IMONE				(1 << 30)
14050d6419e9SMatt Roper #define   ECR_CAP_MASK				0x0000001f /* Event range, 0-31 */
14060d6419e9SMatt Roper #define OGW0					_MMIO(0x11608)
14070d6419e9SMatt Roper #define OGW1					_MMIO(0x1160c)
14080d6419e9SMatt Roper #define EG0					_MMIO(0x11610)
14090d6419e9SMatt Roper #define EG1					_MMIO(0x11614)
14100d6419e9SMatt Roper #define EG2					_MMIO(0x11618)
14110d6419e9SMatt Roper #define EG3					_MMIO(0x1161c)
14120d6419e9SMatt Roper #define EG4					_MMIO(0x11620)
14130d6419e9SMatt Roper #define EG5					_MMIO(0x11624)
14140d6419e9SMatt Roper #define EG6					_MMIO(0x11628)
14150d6419e9SMatt Roper #define EG7					_MMIO(0x1162c)
14160d6419e9SMatt Roper #define PXW(i)					_MMIO(0x11664 + (i) * 4) /* 4 registers */
14170d6419e9SMatt Roper #define PXWL(i)					_MMIO(0x11680 + (i) * 8) /* 8 registers */
14180d6419e9SMatt Roper #define LCFUSE02				_MMIO(0x116c0)
14190d6419e9SMatt Roper #define   LCFUSE_HIV_MASK			0x000000ff
14200d6419e9SMatt Roper 
14210d53879fSMatt Roper #define GAC_ECO_BITS				_MMIO(0x14090)
14220d53879fSMatt Roper #define   ECOBITS_SNB_BIT			(1 << 13)
14230d53879fSMatt Roper #define   ECOBITS_PPGTT_CACHE64B		(3 << 8)
14240d53879fSMatt Roper #define   ECOBITS_PPGTT_CACHE4B			(0 << 8)
14250d53879fSMatt Roper 
142687cb6d80SMatt Roper #define GEN12_RCU_MODE				_MMIO(0x14800)
1427bc9a1ec0SAndi Shyti #define   XEHP_RCU_MODE_FIXED_SLICE_CCS_MODE	REG_BIT(1)
142887cb6d80SMatt Roper #define   GEN12_RCU_MODE_CCS_ENABLE		REG_BIT(0)
142987cb6d80SMatt Roper 
14306db31251SAndi Shyti #define XEHP_CCS_MODE				_MMIO(0x14804)
14316db31251SAndi Shyti #define   XEHP_CCS_MODE_CSLICE_MASK		REG_GENMASK(2, 0) /* CCS0-3 + rsvd */
14326db31251SAndi Shyti #define   XEHP_CCS_MODE_CSLICE_WIDTH		ilog2(XEHP_CCS_MODE_CSLICE_MASK + 1)
14336db31251SAndi Shyti #define   XEHP_CCS_MODE_CSLICE(cslice, ccs)	(ccs << (cslice * XEHP_CCS_MODE_CSLICE_WIDTH))
14346db31251SAndi Shyti 
14356e4e9fbdSJani Nikula #define CHV_FUSE_GT				_MMIO(VLV_GUNIT_BASE + 0x2168)
14360d53879fSMatt Roper #define   CHV_FGT_DISABLE_SS0			(1 << 10)
14370d53879fSMatt Roper #define   CHV_FGT_DISABLE_SS1			(1 << 11)
14380d53879fSMatt Roper #define   CHV_FGT_EU_DIS_SS0_R0_SHIFT		16
14390d53879fSMatt Roper #define   CHV_FGT_EU_DIS_SS0_R0_MASK		(0xf << CHV_FGT_EU_DIS_SS0_R0_SHIFT)
14400d53879fSMatt Roper #define   CHV_FGT_EU_DIS_SS0_R1_SHIFT		20
14410d53879fSMatt Roper #define   CHV_FGT_EU_DIS_SS0_R1_MASK		(0xf << CHV_FGT_EU_DIS_SS0_R1_SHIFT)
14420d53879fSMatt Roper #define   CHV_FGT_EU_DIS_SS1_R0_SHIFT		24
14430d53879fSMatt Roper #define   CHV_FGT_EU_DIS_SS1_R0_MASK		(0xf << CHV_FGT_EU_DIS_SS1_R0_SHIFT)
14440d53879fSMatt Roper #define   CHV_FGT_EU_DIS_SS1_R1_SHIFT		28
14450d53879fSMatt Roper #define   CHV_FGT_EU_DIS_SS1_R1_MASK		(0xf << CHV_FGT_EU_DIS_SS1_R1_SHIFT)
14460d53879fSMatt Roper 
14470d53879fSMatt Roper #define BCS_SWCTRL				_MMIO(0x22200)
14480d53879fSMatt Roper #define   BCS_SRC_Y				REG_BIT(0)
14490d53879fSMatt Roper #define   BCS_DST_Y				REG_BIT(1)
14500d53879fSMatt Roper 
14510d53879fSMatt Roper #define GAB_CTL					_MMIO(0x24000)
14520d53879fSMatt Roper #define   GAB_CTL_CONT_AFTER_PAGEFAULT		(1 << 8)
14530d53879fSMatt Roper 
14540d53879fSMatt Roper #define GEN6_PMISR				_MMIO(0x44020)
14550d53879fSMatt Roper #define GEN6_PMIMR				_MMIO(0x44024) /* rps_lock */
14560d53879fSMatt Roper #define GEN6_PMIIR				_MMIO(0x44028)
14570d53879fSMatt Roper #define GEN6_PMIER				_MMIO(0x4402c)
14580d53879fSMatt Roper #define   GEN6_PM_MBOX_EVENT			(1 << 25)
14590d53879fSMatt Roper #define   GEN6_PM_THERMAL_EVENT			(1 << 24)
14600d53879fSMatt Roper /*
14610d53879fSMatt Roper  * For Gen11 these are in the upper word of the GPM_WGBOXPERF
14620d53879fSMatt Roper  * registers. Shifting is handled on accessing the imr and ier.
14630d53879fSMatt Roper  */
14640d53879fSMatt Roper #define   GEN6_PM_RP_DOWN_TIMEOUT		(1 << 6)
14650d53879fSMatt Roper #define   GEN6_PM_RP_UP_THRESHOLD		(1 << 5)
14660d53879fSMatt Roper #define   GEN6_PM_RP_DOWN_THRESHOLD		(1 << 4)
14670d53879fSMatt Roper #define   GEN6_PM_RP_UP_EI_EXPIRED		(1 << 2)
14680d53879fSMatt Roper #define   GEN6_PM_RP_DOWN_EI_EXPIRED		(1 << 1)
14690d53879fSMatt Roper #define   GEN6_PM_RPS_EVENTS			(GEN6_PM_RP_UP_EI_EXPIRED   | \
14700d53879fSMatt Roper 						 GEN6_PM_RP_UP_THRESHOLD    | \
14710d53879fSMatt Roper 						 GEN6_PM_RP_DOWN_EI_EXPIRED | \
14720d53879fSMatt Roper 						 GEN6_PM_RP_DOWN_THRESHOLD  | \
14730d53879fSMatt Roper 						 GEN6_PM_RP_DOWN_TIMEOUT)
14740d53879fSMatt Roper 
14750d53879fSMatt Roper #define GEN7_GT_SCRATCH(i)			_MMIO(0x4f100 + (i) * 4)
14760d53879fSMatt Roper #define   GEN7_GT_SCRATCH_REG_NUM		8
14770d53879fSMatt Roper 
14780d53879fSMatt Roper #define GFX_FLSH_CNTL_GEN6			_MMIO(0x101008)
14790d53879fSMatt Roper #define   GFX_FLSH_CNTL_EN			(1 << 0)
14800d53879fSMatt Roper 
14810d53879fSMatt Roper #define GTFIFODBG				_MMIO(0x120000)
14820d53879fSMatt Roper #define   GT_FIFO_SBDEDICATE_FREE_ENTRY_CHV	(0x1f << 20)
14830d53879fSMatt Roper #define   GT_FIFO_FREE_ENTRIES_CHV		(0x7f << 13)
14840d53879fSMatt Roper #define   GT_FIFO_SBDROPERR			(1 << 6)
14850d53879fSMatt Roper #define   GT_FIFO_BLOBDROPERR			(1 << 5)
14860d53879fSMatt Roper #define   GT_FIFO_SB_READ_ABORTERR		(1 << 4)
14870d53879fSMatt Roper #define   GT_FIFO_DROPERR			(1 << 3)
14880d53879fSMatt Roper #define   GT_FIFO_OVFERR			(1 << 2)
14890d53879fSMatt Roper #define   GT_FIFO_IAWRERR			(1 << 1)
14900d53879fSMatt Roper #define   GT_FIFO_IARDERR			(1 << 0)
14910d53879fSMatt Roper 
14920d53879fSMatt Roper #define GTFIFOCTL				_MMIO(0x120008)
14930d53879fSMatt Roper #define   GT_FIFO_FREE_ENTRIES_MASK		0x7f
14940d53879fSMatt Roper #define   GT_FIFO_NUM_RESERVED_ENTRIES		20
14950d53879fSMatt Roper #define   GT_FIFO_CTL_BLOCK_ALL_POLICY_STALL	(1 << 12)
14960d53879fSMatt Roper #define   GT_FIFO_CTL_RC6_POLICY_STALL		(1 << 11)
14970d53879fSMatt Roper 
14980d53879fSMatt Roper #define FORCEWAKE_MT_ACK			_MMIO(0x130040)
14990d53879fSMatt Roper #define FORCEWAKE_ACK_HSW			_MMIO(0x130044)
15000d53879fSMatt Roper #define FORCEWAKE_ACK_GT_GEN9			_MMIO(0x130044)
15010d53879fSMatt Roper #define   FORCEWAKE_KERNEL			BIT(0)
15020d53879fSMatt Roper #define   FORCEWAKE_USER			BIT(1)
15030d53879fSMatt Roper #define   FORCEWAKE_KERNEL_FALLBACK		BIT(15)
15040d53879fSMatt Roper #define FORCEWAKE_ACK				_MMIO(0x130090)
15050d53879fSMatt Roper #define VLV_GTLC_WAKE_CTRL			_MMIO(0x130090)
15060d53879fSMatt Roper #define   VLV_GTLC_RENDER_CTX_EXISTS		(1 << 25)
15070d53879fSMatt Roper #define   VLV_GTLC_MEDIA_CTX_EXISTS		(1 << 24)
15080d53879fSMatt Roper #define   VLV_GTLC_ALLOWWAKEREQ			(1 << 0)
15090d53879fSMatt Roper #define VLV_GTLC_PW_STATUS			_MMIO(0x130094)
15100d53879fSMatt Roper #define   VLV_GTLC_ALLOWWAKEACK			(1 << 0)
15110d53879fSMatt Roper #define   VLV_GTLC_ALLOWWAKEERR			(1 << 1)
15120d53879fSMatt Roper #define   VLV_GTLC_PW_MEDIA_STATUS_MASK		(1 << 5)
15130d53879fSMatt Roper #define   VLV_GTLC_PW_RENDER_STATUS_MASK	(1 << 7)
15140d53879fSMatt Roper #define VLV_GTLC_SURVIVABILITY_REG		_MMIO(0x130098)
15150d53879fSMatt Roper #define   VLV_GFX_CLK_STATUS_BIT		(1 << 3)
15160d53879fSMatt Roper #define   VLV_GFX_CLK_FORCE_ON_BIT		(1 << 2)
15170d53879fSMatt Roper #define FORCEWAKE_VLV				_MMIO(0x1300b0)
15180d53879fSMatt Roper #define FORCEWAKE_ACK_VLV			_MMIO(0x1300b4)
15190d53879fSMatt Roper #define FORCEWAKE_MEDIA_VLV			_MMIO(0x1300b8)
15200d53879fSMatt Roper #define FORCEWAKE_ACK_MEDIA_VLV			_MMIO(0x1300bc)
15210d53879fSMatt Roper 
15224bb9ca7eSBadal Nilawar #define MTL_MEDIA_MC6				_MMIO(0x138048)
15234bb9ca7eSBadal Nilawar 
152441bb543fSMatt Roper #define MTL_GT_ACTIVITY_FACTOR			_MMIO(0x138010)
152541bb543fSMatt Roper #define   MTL_GT_L3_EXC_MASK			REG_GENMASK(5, 3)
152641bb543fSMatt Roper 
15270d6419e9SMatt Roper #define GEN6_GT_THREAD_STATUS_REG		_MMIO(0x13805c)
15280d6419e9SMatt Roper #define   GEN6_GT_THREAD_STATUS_CORE_MASK	0x7
15290d6419e9SMatt Roper 
15300d53879fSMatt Roper #define GEN6_GT_CORE_STATUS			_MMIO(0x138060)
15310d53879fSMatt Roper #define   GEN6_CORE_CPD_STATE_MASK		(7 << 4)
15320d53879fSMatt Roper #define   GEN6_RCn_MASK				7
15330d53879fSMatt Roper #define   GEN6_RC0				0
15340d53879fSMatt Roper #define   GEN6_RC3				2
15350d53879fSMatt Roper #define   GEN6_RC6				3
15360d53879fSMatt Roper #define   GEN6_RC7				4
15370d53879fSMatt Roper 
15380d53879fSMatt Roper #define GEN8_GT_SLICE_INFO			_MMIO(0x138064)
15390d53879fSMatt Roper #define   GEN8_LSLICESTAT_MASK			0x7
15400d53879fSMatt Roper 
15410d53879fSMatt Roper #define GEN6_GT_GFX_RC6_LOCKED			_MMIO(0x138104)
15420d53879fSMatt Roper #define VLV_COUNTER_CONTROL			_MMIO(0x138104)
15430d53879fSMatt Roper #define   VLV_COUNT_RANGE_HIGH			(1 << 15)
15440d53879fSMatt Roper #define   VLV_MEDIA_RC0_COUNT_EN		(1 << 5)
15450d53879fSMatt Roper #define   VLV_RENDER_RC0_COUNT_EN		(1 << 4)
15460d53879fSMatt Roper #define   VLV_MEDIA_RC6_COUNT_EN		(1 << 1)
15470d53879fSMatt Roper #define   VLV_RENDER_RC6_COUNT_EN		(1 << 0)
15480d53879fSMatt Roper #define GEN6_GT_GFX_RC6				_MMIO(0x138108)
15490d53879fSMatt Roper #define VLV_GT_MEDIA_RC6			_MMIO(0x13810c)
15500d53879fSMatt Roper 
15510d53879fSMatt Roper #define GEN6_GT_GFX_RC6p			_MMIO(0x13810c)
15520d53879fSMatt Roper #define GEN6_GT_GFX_RC6pp			_MMIO(0x138110)
15530d53879fSMatt Roper #define VLV_RENDER_C0_COUNT			_MMIO(0x138118)
15540d53879fSMatt Roper #define VLV_MEDIA_C0_COUNT			_MMIO(0x13811c)
15550d53879fSMatt Roper 
1556*727eb1e3SRaag Jadav #define PCU_PWM_FAN_SPEED			_MMIO(0x138140)
1557*727eb1e3SRaag Jadav 
1558f8572bb6SRiana Tauro #define GEN12_RPSTAT1				_MMIO(0x1381b4)
1559f8572bb6SRiana Tauro #define   GEN12_VOLTAGE_MASK			REG_GENMASK(10, 0)
156001b8c2e6SDon Hiatt #define   GEN12_CAGF_MASK			REG_GENMASK(19, 11)
1561f8572bb6SRiana Tauro 
15620d53879fSMatt Roper #define GEN11_GT_INTR_DW(x)			_MMIO(0x190018 + ((x) * 4))
15630d53879fSMatt Roper #define   GEN11_CSME				(31)
156431cc65b4SDaniele Ceraolo Spurio #define   GEN12_HECI_2				(30)
15650d53879fSMatt Roper #define   GEN11_GUNIT				(28)
15660d53879fSMatt Roper #define   GEN11_GUC				(25)
1567a187f13dSDaniele Ceraolo Spurio #define   MTL_MGUC				(24)
15680d53879fSMatt Roper #define   GEN11_WDPERF				(20)
15690d53879fSMatt Roper #define   GEN11_KCR				(19)
15700d53879fSMatt Roper #define   GEN11_GTPM				(16)
15710d53879fSMatt Roper #define   GEN11_BCS				(15)
157269f8afdbSMatt Roper #define   XEHPC_BCS1				(14)
157369f8afdbSMatt Roper #define   XEHPC_BCS2				(13)
157469f8afdbSMatt Roper #define   XEHPC_BCS3				(12)
157569f8afdbSMatt Roper #define   XEHPC_BCS4				(11)
157669f8afdbSMatt Roper #define   XEHPC_BCS5				(10)
157769f8afdbSMatt Roper #define   XEHPC_BCS6				(9)
157869f8afdbSMatt Roper #define   XEHPC_BCS7				(8)
157969f8afdbSMatt Roper #define   XEHPC_BCS8				(23)
1580944823c9SMatt Roper #define   GEN12_CCS3				(7)
1581944823c9SMatt Roper #define   GEN12_CCS2				(6)
1582944823c9SMatt Roper #define   GEN12_CCS1				(5)
1583944823c9SMatt Roper #define   GEN12_CCS0				(4)
15840d53879fSMatt Roper #define   GEN11_RCS0				(0)
15850d53879fSMatt Roper #define   GEN11_VECS(x)				(31 - (x))
15860d53879fSMatt Roper #define   GEN11_VCS(x)				(x)
15870d53879fSMatt Roper 
15880d53879fSMatt Roper #define GEN11_RENDER_COPY_INTR_ENABLE		_MMIO(0x190030)
15890d53879fSMatt Roper #define GEN11_VCS_VECS_INTR_ENABLE		_MMIO(0x190034)
15900d53879fSMatt Roper #define GEN11_GUC_SG_INTR_ENABLE		_MMIO(0x190038)
15910d53879fSMatt Roper #define   ENGINE1_MASK				REG_GENMASK(31, 16)
15920d53879fSMatt Roper #define   ENGINE0_MASK				REG_GENMASK(15, 0)
15930d53879fSMatt Roper #define GEN11_GPM_WGBOXPERF_INTR_ENABLE		_MMIO(0x19003c)
15940d53879fSMatt Roper #define GEN11_CRYPTO_RSVD_INTR_ENABLE		_MMIO(0x190040)
15950d53879fSMatt Roper #define GEN11_GUNIT_CSME_INTR_ENABLE		_MMIO(0x190044)
1596505c4857SMatt Roper #define GEN12_CCS_RSVD_INTR_ENABLE		_MMIO(0x190048)
15970d53879fSMatt Roper 
15980d53879fSMatt Roper #define GEN11_INTR_IDENTITY_REG(x)		_MMIO(0x190060 + ((x) * 4))
15990d53879fSMatt Roper #define   GEN11_INTR_DATA_VALID			(1 << 31)
16000d53879fSMatt Roper #define   GEN11_INTR_ENGINE_CLASS(x)		(((x) & GENMASK(18, 16)) >> 16)
16010d53879fSMatt Roper #define   GEN11_INTR_ENGINE_INSTANCE(x)		(((x) & GENMASK(25, 20)) >> 20)
16020d53879fSMatt Roper #define   GEN11_INTR_ENGINE_INTR(x)		((x) & 0xffff)
16030d53879fSMatt Roper /* irq instances for OTHER_CLASS */
16040d53879fSMatt Roper #define   OTHER_GUC_INSTANCE			0
16050d53879fSMatt Roper #define   OTHER_GTPM_INSTANCE			1
160631cc65b4SDaniele Ceraolo Spurio #define   OTHER_GSC_HECI_2_INSTANCE		3
16070d53879fSMatt Roper #define   OTHER_KCR_INSTANCE			4
16081e3dc1d8STomas Winkler #define   OTHER_GSC_INSTANCE			6
160951aec8bfSMatt Roper #define   OTHER_MEDIA_GUC_INSTANCE		16
161051aec8bfSMatt Roper #define   OTHER_MEDIA_GTPM_INSTANCE		17
16110d53879fSMatt Roper 
16120d53879fSMatt Roper #define GEN11_IIR_REG_SELECTOR(x)		_MMIO(0x190070 + ((x) * 4))
16130d53879fSMatt Roper 
16140d53879fSMatt Roper #define GEN11_RCS0_RSVD_INTR_MASK		_MMIO(0x190090)
16150d53879fSMatt Roper #define GEN11_BCS_RSVD_INTR_MASK		_MMIO(0x1900a0)
16160d53879fSMatt Roper #define GEN11_VCS0_VCS1_INTR_MASK		_MMIO(0x1900a8)
16170d53879fSMatt Roper #define GEN11_VCS2_VCS3_INTR_MASK		_MMIO(0x1900ac)
16180d53879fSMatt Roper #define GEN12_VCS4_VCS5_INTR_MASK		_MMIO(0x1900b0)
16190d53879fSMatt Roper #define GEN12_VCS6_VCS7_INTR_MASK		_MMIO(0x1900b4)
16200d53879fSMatt Roper #define GEN11_VECS0_VECS1_INTR_MASK		_MMIO(0x1900d0)
16210d53879fSMatt Roper #define GEN12_VECS2_VECS3_INTR_MASK		_MMIO(0x1900d4)
162231cc65b4SDaniele Ceraolo Spurio #define GEN12_HECI2_RSVD_INTR_MASK		_MMIO(0x1900e4)
16230d53879fSMatt Roper #define GEN11_GUC_SG_INTR_MASK			_MMIO(0x1900e8)
1624a187f13dSDaniele Ceraolo Spurio #define MTL_GUC_MGUC_INTR_MASK			_MMIO(0x1900e8) /* MTL+ */
16250d53879fSMatt Roper #define GEN11_GPM_WGBOXPERF_INTR_MASK		_MMIO(0x1900ec)
16260d53879fSMatt Roper #define GEN11_CRYPTO_RSVD_INTR_MASK		_MMIO(0x1900f0)
16270d53879fSMatt Roper #define GEN11_GUNIT_CSME_INTR_MASK		_MMIO(0x1900f4)
1628505c4857SMatt Roper #define GEN12_CCS0_CCS1_INTR_MASK		_MMIO(0x190100)
1629505c4857SMatt Roper #define GEN12_CCS2_CCS3_INTR_MASK		_MMIO(0x190104)
1630500d7135SMatt Roper #define XEHPC_BCS1_BCS2_INTR_MASK		_MMIO(0x190110)
1631500d7135SMatt Roper #define XEHPC_BCS3_BCS4_INTR_MASK		_MMIO(0x190114)
1632500d7135SMatt Roper #define XEHPC_BCS5_BCS6_INTR_MASK		_MMIO(0x190118)
1633500d7135SMatt Roper #define XEHPC_BCS7_BCS8_INTR_MASK		_MMIO(0x19011c)
16340d53879fSMatt Roper 
16350d53879fSMatt Roper #define GEN12_SFC_DONE(n)			_MMIO(0x1cc000 + (n) * 0x1000)
16360d6419e9SMatt Roper 
1637f0e2f00cSMatt Roper /*
1638f0e2f00cSMatt Roper  * Standalone Media's non-engine GT registers are located at their regular GT
1639f0e2f00cSMatt Roper  * offsets plus 0x380000.  This extra offset is stored inside the intel_uncore
1640f0e2f00cSMatt Roper  * structure so that the existing code can be used for both GTs without
1641f0e2f00cSMatt Roper  * modification.
1642f0e2f00cSMatt Roper  */
1643f0e2f00cSMatt Roper #define MTL_MEDIA_GSI_BASE			0x380000
1644f0e2f00cSMatt Roper 
16450d6419e9SMatt Roper #endif /* __INTEL_GT_REGS__ */
1646