1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * Copyright © 2023 Intel Corporation 4 */ 5 6 #ifndef _XE_GT_REGS_H_ 7 #define _XE_GT_REGS_H_ 8 9 #include "regs/xe_reg_defs.h" 10 11 /* 12 * The GSI register range [0x0 - 0x40000) is replicated at a higher offset 13 * for the media GT. xe_mmio and xe_gt_mcr functions will automatically 14 * translate offsets by MEDIA_GT_GSI_OFFSET when operating on the media GT. 15 */ 16 #define MEDIA_GT_GSI_OFFSET 0x380000 17 #define MEDIA_GT_GSI_LENGTH 0x40000 18 19 /* MTL workpoint reg to get core C state and actual freq of 3D, SAMedia */ 20 #define MTL_MIRROR_TARGET_WP1 XE_REG(0xc60) 21 #define MTL_CAGF_MASK REG_GENMASK(8, 0) 22 #define MTL_CC_MASK REG_GENMASK(12, 9) 23 24 /* RPM unit config (Gen8+) */ 25 #define RPM_CONFIG0 XE_REG(0xd00) 26 #define RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_MASK REG_GENMASK(5, 3) 27 #define RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_24_MHZ 0 28 #define RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_19_2_MHZ 1 29 #define RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_38_4_MHZ 2 30 #define RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_25_MHZ 3 31 #define RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK REG_GENMASK(2, 1) 32 33 #define FORCEWAKE_ACK_MEDIA_VDBOX(n) XE_REG(0xd50 + (n) * 4) 34 #define FORCEWAKE_ACK_MEDIA_VEBOX(n) XE_REG(0xd70 + (n) * 4) 35 #define FORCEWAKE_ACK_RENDER XE_REG(0xd84) 36 37 #define GMD_ID XE_REG(0xd8c) 38 #define GMD_ID_ARCH_MASK REG_GENMASK(31, 22) 39 #define GMD_ID_RELEASE_MASK REG_GENMASK(21, 14) 40 #define GMD_ID_REVID REG_GENMASK(5, 0) 41 42 #define FORCEWAKE_ACK_GSC XE_REG(0xdf8) 43 #define FORCEWAKE_ACK_GT_MTL XE_REG(0xdfc) 44 45 #define MCFG_MCR_SELECTOR XE_REG(0xfd0) 46 #define MTL_MCR_SELECTOR XE_REG(0xfd4) 47 #define SF_MCR_SELECTOR XE_REG(0xfd8) 48 #define MCR_SELECTOR XE_REG(0xfdc) 49 #define GAM_MCR_SELECTOR XE_REG(0xfe0) 50 #define MCR_MULTICAST REG_BIT(31) 51 #define MCR_SLICE_MASK REG_GENMASK(30, 27) 52 #define MCR_SLICE(slice) REG_FIELD_PREP(MCR_SLICE_MASK, slice) 53 #define MCR_SUBSLICE_MASK REG_GENMASK(26, 24) 54 #define MCR_SUBSLICE(subslice) REG_FIELD_PREP(MCR_SUBSLICE_MASK, subslice) 55 #define MTL_MCR_GROUPID REG_GENMASK(11, 8) 56 #define MTL_MCR_INSTANCEID REG_GENMASK(3, 0) 57 58 #define PS_INVOCATION_COUNT XE_REG(0x2348) 59 60 #define XELP_GLOBAL_MOCS(i) XE_REG(0x4000 + (i) * 4) 61 #define XEHP_GLOBAL_MOCS(i) XE_REG_MCR(0x4000 + (i) * 4) 62 #define LE_SSE_MASK REG_GENMASK(18, 17) 63 #define LE_SSE(value) REG_FIELD_PREP(LE_SSE_MASK, value) 64 #define LE_COS_MASK REG_GENMASK(16, 15) 65 #define LE_COS(value) REG_FIELD_PREP(LE_COS_MASK) 66 #define LE_SCF_MASK REG_BIT(14) 67 #define LE_SCF(value) REG_FIELD_PREP(LE_SCF_MASK, value) 68 #define LE_PFM_MASK REG_GENMASK(13, 11) 69 #define LE_PFM(value) REG_FIELD_PREP(LE_PFM_MASK, value) 70 #define LE_SCC_MASK REG_GENMASK(10, 8) 71 #define LE_SCC(value) REG_FIELD_PREP(LE_SCC_MASK, value) 72 #define LE_RSC_MASK REG_BIT(7) 73 #define LE_RSC(value) REG_FIELD_PREP(LE_RSC_MASK, value) 74 #define LE_AOM_MASK REG_BIT(6) 75 #define LE_AOM(value) REG_FIELD_PREP(LE_AOM_MASK, value) 76 #define LE_LRUM_MASK REG_GENMASK(5, 4) 77 #define LE_LRUM(value) REG_FIELD_PREP(LE_LRUM_MASK, value) 78 #define LE_TGT_CACHE_MASK REG_GENMASK(3, 2) 79 #define LE_TGT_CACHE(value) REG_FIELD_PREP(LE_TGT_CACHE_MASK, value) 80 #define LE_CACHEABILITY_MASK REG_GENMASK(1, 0) 81 #define LE_CACHEABILITY(value) REG_FIELD_PREP(LE_CACHEABILITY_MASK, value) 82 83 #define CCS_AUX_INV XE_REG(0x4208) 84 85 #define VD0_AUX_INV XE_REG(0x4218) 86 #define VE0_AUX_INV XE_REG(0x4238) 87 88 #define VE1_AUX_INV XE_REG(0x42b8) 89 #define AUX_INV REG_BIT(0) 90 91 #define XEHP_TILE_ADDR_RANGE(_idx) XE_REG_MCR(0x4900 + (_idx) * 4) 92 #define XEHP_FLAT_CCS_BASE_ADDR XE_REG_MCR(0x4910) 93 #define XEHP_FLAT_CCS_PTR REG_GENMASK(31, 8) 94 95 #define WM_CHICKEN3 XE_REG_MCR(0x5588, XE_REG_OPTION_MASKED) 96 #define HIZ_PLANE_COMPRESSION_DIS REG_BIT(10) 97 98 #define CHICKEN_RASTER_1 XE_REG_MCR(0x6204, XE_REG_OPTION_MASKED) 99 #define DIS_SF_ROUND_NEAREST_EVEN REG_BIT(8) 100 101 #define CHICKEN_RASTER_2 XE_REG_MCR(0x6208, XE_REG_OPTION_MASKED) 102 #define TBIMR_FAST_CLIP REG_BIT(5) 103 104 #define FF_MODE XE_REG_MCR(0x6210) 105 #define DIS_TE_AUTOSTRIP REG_BIT(31) 106 #define DIS_MESH_PARTIAL_AUTOSTRIP REG_BIT(16) 107 #define DIS_MESH_AUTOSTRIP REG_BIT(15) 108 109 #define VFLSKPD XE_REG_MCR(0x62a8, XE_REG_OPTION_MASKED) 110 #define DIS_PARTIAL_AUTOSTRIP REG_BIT(9) 111 #define DIS_AUTOSTRIP REG_BIT(6) 112 #define DIS_OVER_FETCH_CACHE REG_BIT(1) 113 #define DIS_MULT_MISS_RD_SQUASH REG_BIT(0) 114 115 #define FF_MODE2 XE_REG(0x6604) 116 #define XEHP_FF_MODE2 XE_REG_MCR(0x6604) 117 #define FF_MODE2_GS_TIMER_MASK REG_GENMASK(31, 24) 118 #define FF_MODE2_GS_TIMER_224 REG_FIELD_PREP(FF_MODE2_GS_TIMER_MASK, 224) 119 #define FF_MODE2_TDS_TIMER_MASK REG_GENMASK(23, 16) 120 #define FF_MODE2_TDS_TIMER_128 REG_FIELD_PREP(FF_MODE2_TDS_TIMER_MASK, 4) 121 122 #define XEHPG_INSTDONE_GEOM_SVGUNIT XE_REG_MCR(0x666c) 123 124 #define CACHE_MODE_1 XE_REG(0x7004, XE_REG_OPTION_MASKED) 125 #define MSAA_OPTIMIZATION_REDUC_DISABLE REG_BIT(11) 126 127 #define COMMON_SLICE_CHICKEN1 XE_REG(0x7010, XE_REG_OPTION_MASKED) 128 #define DISABLE_BOTTOM_CLIP_RECTANGLE_TEST REG_BIT(14) 129 130 #define HIZ_CHICKEN XE_REG(0x7018, XE_REG_OPTION_MASKED) 131 #define DG1_HZ_READ_SUPPRESSION_OPTIMIZATION_DISABLE REG_BIT(14) 132 #define HZ_DEPTH_TEST_LE_GE_OPT_DISABLE REG_BIT(13) 133 134 #define XEHP_PSS_MODE2 XE_REG_MCR(0x703c, XE_REG_OPTION_MASKED) 135 #define SCOREBOARD_STALL_FLUSH_CONTROL REG_BIT(5) 136 137 #define XEHP_PSS_CHICKEN XE_REG_MCR(0x7044, XE_REG_OPTION_MASKED) 138 #define FLSH_IGNORES_PSD REG_BIT(10) 139 #define FD_END_COLLECT REG_BIT(5) 140 141 #define SC_INSTDONE XE_REG(0x7100) 142 #define SC_INSTDONE_EXTRA XE_REG(0x7104) 143 #define SC_INSTDONE_EXTRA2 XE_REG(0x7108) 144 145 #define XEHPG_SC_INSTDONE XE_REG_MCR(0x7100) 146 #define XEHPG_SC_INSTDONE_EXTRA XE_REG_MCR(0x7104) 147 #define XEHPG_SC_INSTDONE_EXTRA2 XE_REG_MCR(0x7108) 148 149 #define COMMON_SLICE_CHICKEN4 XE_REG(0x7300, XE_REG_OPTION_MASKED) 150 #define DISABLE_TDC_LOAD_BALANCING_CALC REG_BIT(6) 151 152 #define COMMON_SLICE_CHICKEN3 XE_REG(0x7304, XE_REG_OPTION_MASKED) 153 #define XEHP_COMMON_SLICE_CHICKEN3 XE_REG_MCR(0x7304, XE_REG_OPTION_MASKED) 154 #define DG1_FLOAT_POINT_BLEND_OPT_STRICT_MODE_EN REG_BIT(12) 155 #define XEHP_DUAL_SIMD8_SEQ_MERGE_DISABLE REG_BIT(12) 156 #define BLEND_EMB_FIX_DISABLE_IN_RCC REG_BIT(11) 157 #define DISABLE_CPS_AWARE_COLOR_PIPE REG_BIT(9) 158 159 #define XEHP_SLICE_COMMON_ECO_CHICKEN1 XE_REG_MCR(0x731c, XE_REG_OPTION_MASKED) 160 #define MSC_MSAA_REODER_BUF_BYPASS_DISABLE REG_BIT(14) 161 162 #define VF_PREEMPTION XE_REG(0x83a4, XE_REG_OPTION_MASKED) 163 #define PREEMPTION_VERTEX_COUNT REG_GENMASK(15, 0) 164 165 #define VF_SCRATCHPAD XE_REG(0x83a8, XE_REG_OPTION_MASKED) 166 #define XE2_VFG_TED_CREDIT_INTERFACE_DISABLE REG_BIT(13) 167 168 #define VFG_PREEMPTION_CHICKEN XE_REG(0x83b4, XE_REG_OPTION_MASKED) 169 #define POLYGON_TRIFAN_LINELOOP_DISABLE REG_BIT(4) 170 171 #define SQCNT1 XE_REG_MCR(0x8718) 172 #define XELPMP_SQCNT1 XE_REG(0x8718) 173 #define SQCNT1_PMON_ENABLE REG_BIT(30) 174 #define SQCNT1_OABPC REG_BIT(29) 175 #define ENFORCE_RAR REG_BIT(23) 176 177 #define XEHP_SQCM XE_REG_MCR(0x8724) 178 #define EN_32B_ACCESS REG_BIT(30) 179 180 #define XE2_FLAT_CCS_BASE_RANGE_LOWER XE_REG_MCR(0x8800) 181 #define XE2_FLAT_CCS_ENABLE REG_BIT(0) 182 #define XE2_FLAT_CCS_BASE_LOWER_ADDR_MASK REG_GENMASK(31, 6) 183 184 #define XE2_FLAT_CCS_BASE_RANGE_UPPER XE_REG_MCR(0x8804) 185 #define XE2_FLAT_CCS_BASE_UPPER_ADDR_MASK REG_GENMASK(7, 0) 186 187 #define GSCPSMI_BASE XE_REG(0x880c) 188 189 #define CCCHKNREG1 XE_REG_MCR(0x8828) 190 #define ENCOMPPERFFIX REG_BIT(18) 191 192 /* Fuse readout registers for GT */ 193 #define XEHP_FUSE4 XE_REG(0x9114) 194 #define CFEG_WMTP_DISABLE REG_BIT(20) 195 #define CCS_EN_MASK REG_GENMASK(19, 16) 196 #define GT_L3_EXC_MASK REG_GENMASK(6, 4) 197 198 #define MIRROR_FUSE3 XE_REG(0x9118) 199 #define XE2_NODE_ENABLE_MASK REG_GENMASK(31, 16) 200 #define L3BANK_PAIR_COUNT 4 201 #define XEHPC_GT_L3_MODE_MASK REG_GENMASK(7, 4) 202 #define XE2_GT_L3_MODE_MASK REG_GENMASK(7, 4) 203 #define L3BANK_MASK REG_GENMASK(3, 0) 204 #define XELP_GT_L3_MODE_MASK REG_GENMASK(7, 0) 205 /* on Xe_HP the same fuses indicates mslices instead of L3 banks */ 206 #define MAX_MSLICES 4 207 #define MEML3_EN_MASK REG_GENMASK(3, 0) 208 209 #define MIRROR_FUSE1 XE_REG(0x911c) 210 211 #define XELP_EU_ENABLE XE_REG(0x9134) /* "_DISABLE" on Xe_LP */ 212 #define XELP_EU_MASK REG_GENMASK(7, 0) 213 #define XELP_GT_SLICE_ENABLE XE_REG(0x9138) 214 #define XELP_GT_GEOMETRY_DSS_ENABLE XE_REG(0x913c) 215 216 #define GT_VEBOX_VDBOX_DISABLE XE_REG(0x9140) 217 #define GT_VEBOX_DISABLE_MASK REG_GENMASK(19, 16) 218 #define GT_VDBOX_DISABLE_MASK REG_GENMASK(7, 0) 219 220 #define XEHP_GT_COMPUTE_DSS_ENABLE XE_REG(0x9144) 221 #define XEHPC_GT_COMPUTE_DSS_ENABLE_EXT XE_REG(0x9148) 222 #define XE2_GT_COMPUTE_DSS_2 XE_REG(0x914c) 223 #define XE2_GT_GEOMETRY_DSS_1 XE_REG(0x9150) 224 #define XE2_GT_GEOMETRY_DSS_2 XE_REG(0x9154) 225 226 #define GDRST XE_REG(0x941c) 227 #define GRDOM_GUC REG_BIT(3) 228 #define GRDOM_FULL REG_BIT(0) 229 230 #define MISCCPCTL XE_REG(0x9424) 231 #define DOP_CLOCK_GATE_RENDER_ENABLE REG_BIT(1) 232 233 #define UNSLCGCTL9430 XE_REG(0x9430) 234 #define MSQDUNIT_CLKGATE_DIS REG_BIT(3) 235 236 #define UNSLICE_UNIT_LEVEL_CLKGATE XE_REG(0x9434) 237 #define VFUNIT_CLKGATE_DIS REG_BIT(20) 238 #define TSGUNIT_CLKGATE_DIS REG_BIT(17) /* XEHPSDV */ 239 #define CG3DDISCFEG_CLKGATE_DIS REG_BIT(17) /* DG2 */ 240 #define GAMEDIA_CLKGATE_DIS REG_BIT(11) 241 #define HSUNIT_CLKGATE_DIS REG_BIT(8) 242 #define VSUNIT_CLKGATE_DIS REG_BIT(3) 243 244 #define UNSLCGCTL9440 XE_REG(0x9440) 245 #define GAMTLBOACS_CLKGATE_DIS REG_BIT(28) 246 #define GAMTLBVDBOX5_CLKGATE_DIS REG_BIT(27) 247 #define GAMTLBVDBOX6_CLKGATE_DIS REG_BIT(26) 248 #define GAMTLBVDBOX3_CLKGATE_DIS REG_BIT(24) 249 #define GAMTLBVDBOX4_CLKGATE_DIS REG_BIT(23) 250 #define GAMTLBVDBOX7_CLKGATE_DIS REG_BIT(22) 251 #define GAMTLBVDBOX2_CLKGATE_DIS REG_BIT(21) 252 #define GAMTLBVDBOX0_CLKGATE_DIS REG_BIT(17) 253 #define GAMTLBKCR_CLKGATE_DIS REG_BIT(16) 254 #define GAMTLBGUC_CLKGATE_DIS REG_BIT(15) 255 #define GAMTLBBLT_CLKGATE_DIS REG_BIT(14) 256 #define GAMTLBVDBOX1_CLKGATE_DIS REG_BIT(6) 257 258 #define UNSLCGCTL9444 XE_REG(0x9444) 259 #define GAMTLBGFXA0_CLKGATE_DIS REG_BIT(30) 260 #define GAMTLBGFXA1_CLKGATE_DIS REG_BIT(29) 261 #define GAMTLBCOMPA0_CLKGATE_DIS REG_BIT(28) 262 #define GAMTLBCOMPA1_CLKGATE_DIS REG_BIT(27) 263 #define GAMTLBCOMPB0_CLKGATE_DIS REG_BIT(26) 264 #define GAMTLBCOMPB1_CLKGATE_DIS REG_BIT(25) 265 #define GAMTLBCOMPC0_CLKGATE_DIS REG_BIT(24) 266 #define GAMTLBCOMPC1_CLKGATE_DIS REG_BIT(23) 267 #define GAMTLBCOMPD0_CLKGATE_DIS REG_BIT(22) 268 #define GAMTLBCOMPD1_CLKGATE_DIS REG_BIT(21) 269 #define GAMTLBMERT_CLKGATE_DIS REG_BIT(20) 270 #define GAMTLBVEBOX3_CLKGATE_DIS REG_BIT(19) 271 #define GAMTLBVEBOX2_CLKGATE_DIS REG_BIT(18) 272 #define GAMTLBVEBOX1_CLKGATE_DIS REG_BIT(17) 273 #define GAMTLBVEBOX0_CLKGATE_DIS REG_BIT(16) 274 #define LTCDD_CLKGATE_DIS REG_BIT(10) 275 276 #define XEHP_SLICE_UNIT_LEVEL_CLKGATE XE_REG_MCR(0x94d4) 277 #define L3_CR2X_CLKGATE_DIS REG_BIT(17) 278 #define L3_CLKGATE_DIS REG_BIT(16) 279 #define NODEDSS_CLKGATE_DIS REG_BIT(12) 280 #define MSCUNIT_CLKGATE_DIS REG_BIT(10) 281 #define RCCUNIT_CLKGATE_DIS REG_BIT(7) 282 #define SARBUNIT_CLKGATE_DIS REG_BIT(5) 283 #define SBEUNIT_CLKGATE_DIS REG_BIT(4) 284 285 #define UNSLICE_UNIT_LEVEL_CLKGATE2 XE_REG(0x94e4) 286 #define VSUNIT_CLKGATE2_DIS REG_BIT(19) 287 288 #define SUBSLICE_UNIT_LEVEL_CLKGATE XE_REG_MCR(0x9524) 289 #define DSS_ROUTER_CLKGATE_DIS REG_BIT(28) 290 #define GWUNIT_CLKGATE_DIS REG_BIT(16) 291 292 #define SUBSLICE_UNIT_LEVEL_CLKGATE2 XE_REG_MCR(0x9528) 293 #define CPSSUNIT_CLKGATE_DIS REG_BIT(9) 294 295 #define SSMCGCTL9530 XE_REG_MCR(0x9530) 296 #define RTFUNIT_CLKGATE_DIS REG_BIT(18) 297 298 #define DFR_RATIO_EN_AND_CHICKEN XE_REG_MCR(0x9550) 299 #define DFR_DISABLE REG_BIT(9) 300 301 #define RPNSWREQ XE_REG(0xa008) 302 #define REQ_RATIO_MASK REG_GENMASK(31, 23) 303 304 #define RP_CONTROL XE_REG(0xa024) 305 #define RPSWCTL_MASK REG_GENMASK(10, 9) 306 #define RPSWCTL_ENABLE REG_FIELD_PREP(RPSWCTL_MASK, 2) 307 #define RPSWCTL_DISABLE REG_FIELD_PREP(RPSWCTL_MASK, 0) 308 #define RC_CONTROL XE_REG(0xa090) 309 #define RC_CTL_HW_ENABLE REG_BIT(31) 310 #define RC_CTL_TO_MODE REG_BIT(28) 311 #define RC_CTL_RC6_ENABLE REG_BIT(18) 312 #define RC_STATE XE_REG(0xa094) 313 #define RC_IDLE_HYSTERSIS XE_REG(0xa0ac) 314 #define MEDIA_POWERGATE_IDLE_HYSTERESIS XE_REG(0xa0c4) 315 #define RENDER_POWERGATE_IDLE_HYSTERESIS XE_REG(0xa0c8) 316 317 #define PMINTRMSK XE_REG(0xa168) 318 #define PMINTR_DISABLE_REDIRECT_TO_GUC REG_BIT(31) 319 #define ARAT_EXPIRED_INTRMSK REG_BIT(9) 320 321 #define FORCEWAKE_GT XE_REG(0xa188) 322 323 #define POWERGATE_ENABLE XE_REG(0xa210) 324 #define RENDER_POWERGATE_ENABLE REG_BIT(0) 325 #define MEDIA_POWERGATE_ENABLE REG_BIT(1) 326 #define VDN_HCP_POWERGATE_ENABLE(n) REG_BIT(3 + 2 * (n)) 327 #define VDN_MFXVDENC_POWERGATE_ENABLE(n) REG_BIT(4 + 2 * (n)) 328 329 #define CTC_MODE XE_REG(0xa26c) 330 #define CTC_SHIFT_PARAMETER_MASK REG_GENMASK(2, 1) 331 #define CTC_SOURCE_DIVIDE_LOGIC REG_BIT(0) 332 333 #define FORCEWAKE_RENDER XE_REG(0xa278) 334 #define FORCEWAKE_MEDIA_VDBOX(n) XE_REG(0xa540 + (n) * 4) 335 #define FORCEWAKE_MEDIA_VEBOX(n) XE_REG(0xa560 + (n) * 4) 336 #define FORCEWAKE_GSC XE_REG(0xa618) 337 338 #define XEHPC_LNCFMISCCFGREG0 XE_REG_MCR(0xb01c, XE_REG_OPTION_MASKED) 339 #define XEHPC_OVRLSCCC REG_BIT(0) 340 341 /* L3 Cache Control */ 342 #define LNCFCMOCS_REG_COUNT 32 343 #define XELP_LNCFCMOCS(i) XE_REG(0xb020 + (i) * 4) 344 #define XEHP_LNCFCMOCS(i) XE_REG_MCR(0xb020 + (i) * 4) 345 #define L3_UPPER_LKUP_MASK REG_BIT(23) 346 #define L3_UPPER_GLBGO_MASK REG_BIT(22) 347 #define L3_UPPER_IDX_CACHEABILITY_MASK REG_GENMASK(21, 20) 348 #define L3_UPPER_IDX_SCC_MASK REG_GENMASK(19, 17) 349 #define L3_UPPER_IDX_ESC_MASK REG_BIT(16) 350 #define L3_LKUP_MASK REG_BIT(7) 351 #define L3_LKUP(value) REG_FIELD_PREP(L3_LKUP_MASK, value) 352 #define L3_GLBGO_MASK REG_BIT(6) 353 #define L3_GLBGO(value) REG_FIELD_PREP(L3_GLBGO_MASK, value) 354 #define L3_CACHEABILITY_MASK REG_GENMASK(5, 4) 355 #define L3_CACHEABILITY(value) REG_FIELD_PREP(L3_CACHEABILITY_MASK, value) 356 #define L3_SCC_MASK REG_GENMASK(3, 1) 357 #define L3_SCC(value) REG_FIELD_PREP(L3_SCC_MASK, value) 358 #define L3_ESC_MASK REG_BIT(0) 359 #define L3_ESC(value) REG_FIELD_PREP(L3_ESC_MASK, value) 360 361 #define XEHP_L3NODEARBCFG XE_REG_MCR(0xb0b4) 362 #define XEHP_LNESPARE REG_BIT(19) 363 364 #define L3SQCREG3 XE_REG_MCR(0xb108) 365 #define COMPPWOVERFETCHEN REG_BIT(28) 366 367 #define XEHP_L3SQCREG5 XE_REG_MCR(0xb158) 368 #define L3_PWM_TIMER_INIT_VAL_MASK REG_GENMASK(9, 0) 369 370 #define XEHP_L3SCQREG7 XE_REG_MCR(0xb188) 371 #define BLEND_FILL_CACHING_OPT_DIS REG_BIT(3) 372 373 #define XEHPC_L3CLOS_MASK(i) XE_REG_MCR(0xb194 + (i) * 8) 374 375 #define XE2LPM_L3SQCREG5 XE_REG_MCR(0xb658) 376 377 #define XE2_TDF_CTRL XE_REG(0xb418) 378 #define TRANSIENT_FLUSH_REQUEST REG_BIT(0) 379 380 #define XEHP_MERT_MOD_CTRL XE_REG_MCR(0xcf28) 381 #define RENDER_MOD_CTRL XE_REG_MCR(0xcf2c) 382 #define COMP_MOD_CTRL XE_REG_MCR(0xcf30) 383 #define XEHP_VDBX_MOD_CTRL XE_REG_MCR(0xcf34) 384 #define XELPMP_VDBX_MOD_CTRL XE_REG(0xcf34) 385 #define XEHP_VEBX_MOD_CTRL XE_REG_MCR(0xcf38) 386 #define XELPMP_VEBX_MOD_CTRL XE_REG(0xcf38) 387 #define FORCE_MISS_FTLB REG_BIT(3) 388 389 #define XEHP_GAMSTLB_CTRL XE_REG_MCR(0xcf4c) 390 #define CONTROL_BLOCK_CLKGATE_DIS REG_BIT(12) 391 #define EGRESS_BLOCK_CLKGATE_DIS REG_BIT(11) 392 #define TAG_BLOCK_CLKGATE_DIS REG_BIT(7) 393 394 #define XEHP_GAMCNTRL_CTRL XE_REG_MCR(0xcf54) 395 #define INVALIDATION_BROADCAST_MODE_DIS REG_BIT(12) 396 #define GLOBAL_INVALIDATION_MODE REG_BIT(2) 397 398 #define HALF_SLICE_CHICKEN5 XE_REG_MCR(0xe188, XE_REG_OPTION_MASKED) 399 #define DISABLE_SAMPLE_G_PERFORMANCE REG_BIT(0) 400 401 #define SAMPLER_INSTDONE XE_REG_MCR(0xe160) 402 #define ROW_INSTDONE XE_REG_MCR(0xe164) 403 404 #define SAMPLER_MODE XE_REG_MCR(0xe18c, XE_REG_OPTION_MASKED) 405 #define ENABLE_SMALLPL REG_BIT(15) 406 #define SC_DISABLE_POWER_OPTIMIZATION_EBB REG_BIT(9) 407 #define SAMPLER_ENABLE_HEADLESS_MSG REG_BIT(5) 408 #define INDIRECT_STATE_BASE_ADDR_OVERRIDE REG_BIT(0) 409 410 #define HALF_SLICE_CHICKEN7 XE_REG_MCR(0xe194, XE_REG_OPTION_MASKED) 411 #define DG2_DISABLE_ROUND_ENABLE_ALLOW_FOR_SSLA REG_BIT(15) 412 #define CLEAR_OPTIMIZATION_DISABLE REG_BIT(6) 413 414 #define CACHE_MODE_SS XE_REG_MCR(0xe420, XE_REG_OPTION_MASKED) 415 #define DISABLE_ECC REG_BIT(5) 416 #define ENABLE_PREFETCH_INTO_IC REG_BIT(3) 417 418 #define ROW_CHICKEN4 XE_REG_MCR(0xe48c, XE_REG_OPTION_MASKED) 419 #define DISABLE_GRF_CLEAR REG_BIT(13) 420 #define XEHP_DIS_BBL_SYSPIPE REG_BIT(11) 421 #define DISABLE_TDL_PUSH REG_BIT(9) 422 #define DIS_PICK_2ND_EU REG_BIT(7) 423 #define DISABLE_HDR_PAST_PAYLOAD_HOLD_FIX REG_BIT(4) 424 #define THREAD_EX_ARB_MODE REG_GENMASK(3, 2) 425 #define THREAD_EX_ARB_MODE_RR_AFTER_DEP REG_FIELD_PREP(THREAD_EX_ARB_MODE, 0x2) 426 427 #define ROW_CHICKEN3 XE_REG_MCR(0xe49c, XE_REG_OPTION_MASKED) 428 #define XE2_EUPEND_CHK_FLUSH_DIS REG_BIT(14) 429 #define DIS_FIX_EOT1_FLUSH REG_BIT(9) 430 431 #define TDL_TSL_CHICKEN XE_REG_MCR(0xe4c4, XE_REG_OPTION_MASKED) 432 #define SLM_WMTP_RESTORE REG_BIT(11) 433 434 #define ROW_CHICKEN XE_REG_MCR(0xe4f0, XE_REG_OPTION_MASKED) 435 #define UGM_BACKUP_MODE REG_BIT(13) 436 #define MDQ_ARBITRATION_MODE REG_BIT(12) 437 #define STALL_DOP_GATING_DISABLE REG_BIT(5) 438 #define EARLY_EOT_DIS REG_BIT(1) 439 440 #define ROW_CHICKEN2 XE_REG_MCR(0xe4f4, XE_REG_OPTION_MASKED) 441 #define DISABLE_READ_SUPPRESSION REG_BIT(15) 442 #define DISABLE_EARLY_READ REG_BIT(14) 443 #define ENABLE_LARGE_GRF_MODE REG_BIT(12) 444 #define PUSH_CONST_DEREF_HOLD_DIS REG_BIT(8) 445 #define DISABLE_TDL_SVHS_GATING REG_BIT(1) 446 #define DISABLE_DOP_GATING REG_BIT(0) 447 448 #define RT_CTRL XE_REG_MCR(0xe530) 449 #define DIS_NULL_QUERY REG_BIT(10) 450 451 #define EU_SYSTOLIC_LIC_THROTTLE_CTL_WITH_LOCK XE_REG_MCR(0xe534) 452 #define EU_SYSTOLIC_LIC_THROTTLE_CTL_LOCK_BIT REG_BIT(31) 453 454 #define XEHP_HDC_CHICKEN0 XE_REG_MCR(0xe5f0, XE_REG_OPTION_MASKED) 455 #define LSC_L1_FLUSH_CTL_3D_DATAPORT_FLUSH_EVENTS_MASK REG_GENMASK(13, 11) 456 #define DIS_ATOMIC_CHAINING_TYPED_WRITES REG_BIT(3) 457 458 #define LSC_CHICKEN_BIT_0 XE_REG_MCR(0xe7c8) 459 #define DISABLE_D8_D16_COASLESCE REG_BIT(30) 460 #define WR_REQ_CHAINING_DIS REG_BIT(26) 461 #define TGM_WRITE_EOM_FORCE REG_BIT(17) 462 #define FORCE_1_SUB_MESSAGE_PER_FRAGMENT REG_BIT(15) 463 #define SEQUENTIAL_ACCESS_UPGRADE_DISABLE REG_BIT(13) 464 465 #define LSC_CHICKEN_BIT_0_UDW XE_REG_MCR(0xe7c8 + 4) 466 #define UGM_FRAGMENT_THRESHOLD_TO_3 REG_BIT(58 - 32) 467 #define DIS_CHAIN_2XSIMD8 REG_BIT(55 - 32) 468 #define XE2_ALLOC_DPA_STARVE_FIX_DIS REG_BIT(47 - 32) 469 #define ENABLE_SMP_LD_RENDER_SURFACE_CONTROL REG_BIT(44 - 32) 470 #define FORCE_SLM_FENCE_SCOPE_TO_TILE REG_BIT(42 - 32) 471 #define FORCE_UGM_FENCE_SCOPE_TO_TILE REG_BIT(41 - 32) 472 #define MAXREQS_PER_BANK REG_GENMASK(39 - 32, 37 - 32) 473 #define DISABLE_128B_EVICTION_COMMAND_UDW REG_BIT(36 - 32) 474 475 #define SARB_CHICKEN1 XE_REG_MCR(0xe90c) 476 #define COMP_CKN_IN REG_GENMASK(30, 29) 477 478 #define RCU_MODE XE_REG(0x14800, XE_REG_OPTION_MASKED) 479 #define RCU_MODE_FIXED_SLICE_CCS_MODE REG_BIT(1) 480 #define RCU_MODE_CCS_ENABLE REG_BIT(0) 481 482 /* 483 * Total of 4 cslices, where each cslice is in the form: 484 * [0-3] CCS ID 485 * [4-6] RSVD 486 * [7] Disabled 487 */ 488 #define CCS_MODE XE_REG(0x14804) 489 #define CCS_MODE_CSLICE_0_3_MASK REG_GENMASK(11, 0) /* 3 bits per cslice */ 490 #define CCS_MODE_CSLICE_MASK 0x7 /* CCS0-3 + rsvd */ 491 #define CCS_MODE_CSLICE_WIDTH ilog2(CCS_MODE_CSLICE_MASK + 1) 492 #define CCS_MODE_CSLICE(cslice, ccs) \ 493 ((ccs) << ((cslice) * CCS_MODE_CSLICE_WIDTH)) 494 495 #define FORCEWAKE_ACK_GT XE_REG(0x130044) 496 497 /* Applicable for all FORCEWAKE_DOMAIN and FORCEWAKE_ACK_DOMAIN regs */ 498 #define FORCEWAKE_KERNEL 0 499 #define FORCEWAKE_MT(bit) BIT(bit) 500 #define FORCEWAKE_MT_MASK(bit) BIT((bit) + 16) 501 502 #define MTL_MEDIA_PERF_LIMIT_REASONS XE_REG(0x138030) 503 #define MTL_MEDIA_MC6 XE_REG(0x138048) 504 505 #define GT_CORE_STATUS XE_REG(0x138060) 506 #define RCN_MASK REG_GENMASK(2, 0) 507 #define GT_C0 0 508 #define GT_C6 3 509 510 #define GT_GFX_RC6_LOCKED XE_REG(0x138104) 511 #define GT_GFX_RC6 XE_REG(0x138108) 512 513 #define GT0_PERF_LIMIT_REASONS XE_REG(0x1381a8) 514 #define GT0_PERF_LIMIT_REASONS_MASK 0xde3 515 #define PROCHOT_MASK REG_BIT(0) 516 #define THERMAL_LIMIT_MASK REG_BIT(1) 517 #define RATL_MASK REG_BIT(5) 518 #define VR_THERMALERT_MASK REG_BIT(6) 519 #define VR_TDC_MASK REG_BIT(7) 520 #define POWER_LIMIT_4_MASK REG_BIT(8) 521 #define POWER_LIMIT_1_MASK REG_BIT(10) 522 #define POWER_LIMIT_2_MASK REG_BIT(11) 523 524 #define GT_PERF_STATUS XE_REG(0x1381b4) 525 #define VOLTAGE_MASK REG_GENMASK(10, 0) 526 527 /* 528 * Note: Interrupt registers 1900xx are VF accessible only until version 12.50. 529 * On newer platforms, VFs are using memory-based interrupts instead. 530 * However, for simplicity we keep this XE_REG_OPTION_VF tag intact. 531 */ 532 533 #define GT_INTR_DW(x) XE_REG(0x190018 + ((x) * 4), XE_REG_OPTION_VF) 534 #define INTR_GSC REG_BIT(31) 535 #define INTR_GUC REG_BIT(25) 536 #define INTR_MGUC REG_BIT(24) 537 #define INTR_BCS8 REG_BIT(23) 538 #define INTR_BCS(x) REG_BIT(15 - (x)) 539 #define INTR_CCS(x) REG_BIT(4 + (x)) 540 #define INTR_RCS0 REG_BIT(0) 541 #define INTR_VECS(x) REG_BIT(31 - (x)) 542 #define INTR_VCS(x) REG_BIT(x) 543 544 #define RENDER_COPY_INTR_ENABLE XE_REG(0x190030, XE_REG_OPTION_VF) 545 #define VCS_VECS_INTR_ENABLE XE_REG(0x190034, XE_REG_OPTION_VF) 546 #define GUC_SG_INTR_ENABLE XE_REG(0x190038, XE_REG_OPTION_VF) 547 #define ENGINE1_MASK REG_GENMASK(31, 16) 548 #define ENGINE0_MASK REG_GENMASK(15, 0) 549 #define GPM_WGBOXPERF_INTR_ENABLE XE_REG(0x19003c, XE_REG_OPTION_VF) 550 #define GUNIT_GSC_INTR_ENABLE XE_REG(0x190044, XE_REG_OPTION_VF) 551 #define CCS_RSVD_INTR_ENABLE XE_REG(0x190048, XE_REG_OPTION_VF) 552 553 #define INTR_IDENTITY_REG(x) XE_REG(0x190060 + ((x) * 4), XE_REG_OPTION_VF) 554 #define INTR_DATA_VALID REG_BIT(31) 555 #define INTR_ENGINE_INSTANCE(x) REG_FIELD_GET(GENMASK(25, 20), x) 556 #define INTR_ENGINE_CLASS(x) REG_FIELD_GET(GENMASK(18, 16), x) 557 #define INTR_ENGINE_INTR(x) REG_FIELD_GET(GENMASK(15, 0), x) 558 #define OTHER_GUC_INSTANCE 0 559 #define OTHER_GSC_HECI2_INSTANCE 3 560 #define OTHER_GSC_INSTANCE 6 561 562 #define IIR_REG_SELECTOR(x) XE_REG(0x190070 + ((x) * 4), XE_REG_OPTION_VF) 563 #define RCS0_RSVD_INTR_MASK XE_REG(0x190090, XE_REG_OPTION_VF) 564 #define BCS_RSVD_INTR_MASK XE_REG(0x1900a0, XE_REG_OPTION_VF) 565 #define VCS0_VCS1_INTR_MASK XE_REG(0x1900a8, XE_REG_OPTION_VF) 566 #define VCS2_VCS3_INTR_MASK XE_REG(0x1900ac, XE_REG_OPTION_VF) 567 #define VECS0_VECS1_INTR_MASK XE_REG(0x1900d0, XE_REG_OPTION_VF) 568 #define HECI2_RSVD_INTR_MASK XE_REG(0x1900e4) 569 #define GUC_SG_INTR_MASK XE_REG(0x1900e8, XE_REG_OPTION_VF) 570 #define GPM_WGBOXPERF_INTR_MASK XE_REG(0x1900ec, XE_REG_OPTION_VF) 571 #define GUNIT_GSC_INTR_MASK XE_REG(0x1900f4, XE_REG_OPTION_VF) 572 #define CCS0_CCS1_INTR_MASK XE_REG(0x190100) 573 #define CCS2_CCS3_INTR_MASK XE_REG(0x190104) 574 #define XEHPC_BCS1_BCS2_INTR_MASK XE_REG(0x190110) 575 #define XEHPC_BCS3_BCS4_INTR_MASK XE_REG(0x190114) 576 #define XEHPC_BCS5_BCS6_INTR_MASK XE_REG(0x190118) 577 #define XEHPC_BCS7_BCS8_INTR_MASK XE_REG(0x19011c) 578 #define GT_WAIT_SEMAPHORE_INTERRUPT REG_BIT(11) 579 #define GT_CONTEXT_SWITCH_INTERRUPT REG_BIT(8) 580 #define GSC_ER_COMPLETE REG_BIT(5) 581 #define GT_RENDER_PIPECTL_NOTIFY_INTERRUPT REG_BIT(4) 582 #define GT_CS_MASTER_ERROR_INTERRUPT REG_BIT(3) 583 #define GT_RENDER_USER_INTERRUPT REG_BIT(0) 584 585 #endif 586