Lines Matching +full:e +full:- +full:fuse

1 // SPDX-License-Identifier: MIT
24 * independent values of a register per hardware unit (e.g., per-subslice,
25 * per-L3bank, etc.). The specific types of replication that exist vary
26 * per-platform.
42 * ``init_steering_*()`` functions is to apply the platform-specific rules for
44 * non-terminated instance.
79 { 0x00E900, 0x00FFFF }, /* 0xEA00 - OxEFFF is unused */
91 * provide us with a non-terminated value. We'll stick them all in the same
95 { 0x004000, 0x004AFF }, /* HALF-BSLICE */
98 { 0x00B000, 0x00B0FF }, /* HALF-BSLICE */
100 { 0x00C800, 0x00CFFF }, /* HALF-BSLICE */
101 { 0x00D800, 0x00D8FF }, /* HALF-BSLICE */
103 { 0x00E900, 0x00E9FF }, /* HALF-BSLICE */
104 { 0x00EC00, 0x00EEFF }, /* HALF-BSLICE */
105 { 0x00F000, 0x00FFFF }, /* HALF-BSLICE */
106 { 0x024180, 0x0241FF }, /* HALF-BSLICE */
139 { 0x008140, 0x00815F }, /* GSLICE (0x8140-0x814F), DSS (0x8150-0x815F) */
141 { 0x0094D0, 0x00955F }, /* GSLICE (0x94D0-0x951F), DSS (0x9520-0x955F) */
145 { 0x00DE80, 0x00E8FF }, /* DSS (0xE000-0xE0FF reserved ) */
153 { 0x008140, 0x00817F }, /* COMPUTE (0x8140-0x814F & 0x8160-0x817F), DSS (0x8150-0x815F) */
154 { 0x0094D0, 0x00955F }, /* COMPUTE (0x94D0-0x951F), DSS (0x9520-0x955F) */
157 { 0x00DE80, 0x00E7FF }, /* DSS (0xDF00-0xE1FF reserved ) */
165 { 0x008140, 0x00815F }, /* SLICE (0x8140-0x814F), DSS (0x8150-0x815F) */
166 { 0x0094D0, 0x00955F }, /* SLICE (0x94D0-0x951F), DSS (0x9520-0x955F) */
170 { 0x00DE80, 0x00E8FF }, /* DSS (0xE000-0xE0FF reserved) */
193 { 0x008140, 0x00815F }, /* SLICE (0x8140-0x814F), DSS (0x8150-0x815F) */
194 { 0x0094D0, 0x00955F }, /* SLICE (0x94D0-0x951F), DSS (0x9520-0x955F) */
198 { 0x00DE80, 0x00E8FF }, /* DSS (0xE000-0xE0FF reserved) */
200 { 0x013000, 0x0133FF }, /* DSS (0x13000-0x131FF), SLICE (0x13200-0x133FF) */
252 gt->steering[L3BANK].group_target = __ffs(mslice_mask); in init_steering_l3bank()
253 gt->steering[L3BANK].instance_target = in init_steering_l3bank()
255 } else if (gt_to_xe(gt)->info.platform == XE_DG2) { in init_steering_l3bank()
265 gt->steering[L3BANK].group_target = (bank >> 2) & 0x7; in init_steering_l3bank()
266 gt->steering[L3BANK].instance_target = bank & 0x3; in init_steering_l3bank()
268 u32 fuse = REG_FIELD_GET(L3BANK_MASK, in init_steering_l3bank() local
271 gt->steering[L3BANK].group_target = 0; /* unused */ in init_steering_l3bank()
272 gt->steering[L3BANK].instance_target = __ffs(fuse); in init_steering_l3bank()
285 * so we can just use that to find a non-terminated mslice and ignore in init_steering_mslice()
288 gt->steering[MSLICE].group_target = __ffs(mask); in init_steering_mslice()
289 gt->steering[MSLICE].instance_target = 0; /* unused */ in init_steering_mslice()
293 * it up here. Either LNCF within a non-terminated mslice will work, in init_steering_mslice()
296 gt->steering[LNCF].group_target = __ffs(mask) << 1; in init_steering_mslice()
297 gt->steering[LNCF].instance_target = 0; /* unused */ in init_steering_mslice()
302 struct xe_guc *guc = &gt->uc.guc; in dss_per_group()
332 if (gt_to_xe(gt)->info.platform == XE_PVC) in dss_per_group()
341 * xe_gt_mcr_get_dss_steering - Get the group/instance steering for a DSS
351 *group = dss / gt->steering_dss_per_grp; in xe_gt_mcr_get_dss_steering()
352 *instance = dss % gt->steering_dss_per_grp; in xe_gt_mcr_get_dss_steering()
357 gt->steering_dss_per_grp = dss_per_group(gt); in init_steering_dss()
360 min(xe_dss_mask_group_ffs(gt->fuse_topo.g_dss_mask, 0, 0), in init_steering_dss()
361 xe_dss_mask_group_ffs(gt->fuse_topo.c_dss_mask, 0, 0)), in init_steering_dss()
362 &gt->steering[DSS].group_target, in init_steering_dss()
363 &gt->steering[DSS].instance_target); in init_steering_dss()
370 * is absent (i.e., no VCS0 or VECS0). in init_steering_oaddrm()
372 if (gt->info.engine_mask & (XE_HW_ENGINE_VCS0 | XE_HW_ENGINE_VECS0)) in init_steering_oaddrm()
373 gt->steering[OADDRM].group_target = 0; in init_steering_oaddrm()
375 gt->steering[OADDRM].group_target = 1; in init_steering_oaddrm()
377 gt->steering[OADDRM].instance_target = 0; /* unused */ in init_steering_oaddrm()
386 gt->steering[SQIDI_PSMI].group_target = select >> 1; in init_steering_sqidi_psmi()
387 gt->steering[SQIDI_PSMI].instance_target = select & 0x1; in init_steering_sqidi_psmi()
392 gt->steering[INSTANCE0].group_target = 0; /* unused */ in init_steering_inst0()
393 gt->steering[INSTANCE0].instance_target = 0; /* unused */ in init_steering_inst0()
411 * xe_gt_mcr_init_early - Early initialization of the MCR support
423 spin_lock_init(&gt->mcr_lock); in xe_gt_mcr_init_early()
427 * xe_gt_mcr_init - Normal initialization of the MCR support
439 if (gt->info.type == XE_GT_TYPE_MEDIA) { in xe_gt_mcr_init()
440 drm_WARN_ON(&xe->drm, MEDIA_VER(xe) < 13); in xe_gt_mcr_init()
443 gt->steering[OADDRM].ranges = xe2lpm_gpmxmt_steering_table; in xe_gt_mcr_init()
444 gt->steering[INSTANCE0].ranges = xe2lpm_instance0_steering_table; in xe_gt_mcr_init()
446 gt->steering[OADDRM].ranges = xelpmp_oaddrm_steering_table; in xe_gt_mcr_init()
450 gt->steering[DSS].ranges = xe2lpg_dss_steering_table; in xe_gt_mcr_init()
451 gt->steering[SQIDI_PSMI].ranges = xe2lpg_sqidi_psmi_steering_table; in xe_gt_mcr_init()
452 gt->steering[INSTANCE0].ranges = xe2lpg_instance0_steering_table; in xe_gt_mcr_init()
454 gt->steering[INSTANCE0].ranges = xelpg_instance0_steering_table; in xe_gt_mcr_init()
455 gt->steering[L3BANK].ranges = xelpg_l3bank_steering_table; in xe_gt_mcr_init()
456 gt->steering[DSS].ranges = xelpg_dss_steering_table; in xe_gt_mcr_init()
457 } else if (xe->info.platform == XE_PVC) { in xe_gt_mcr_init()
458 gt->steering[INSTANCE0].ranges = xehpc_instance0_steering_table; in xe_gt_mcr_init()
459 gt->steering[DSS].ranges = xehpc_dss_steering_table; in xe_gt_mcr_init()
460 } else if (xe->info.platform == XE_DG2) { in xe_gt_mcr_init()
461 gt->steering[L3BANK].ranges = xehp_l3bank_steering_table; in xe_gt_mcr_init()
462 gt->steering[MSLICE].ranges = xehp_mslice_steering_table; in xe_gt_mcr_init()
463 gt->steering[LNCF].ranges = xehp_lncf_steering_table; in xe_gt_mcr_init()
464 gt->steering[DSS].ranges = xehp_dss_steering_table; in xe_gt_mcr_init()
465 gt->steering[IMPLICIT_STEERING].ranges = dg2_implicit_steering_table; in xe_gt_mcr_init()
467 gt->steering[L3BANK].ranges = xelp_l3bank_steering_table; in xe_gt_mcr_init()
468 gt->steering[DSS].ranges = xelp_dss_steering_table; in xe_gt_mcr_init()
472 /* Select non-terminated steering target for each type */ in xe_gt_mcr_init()
474 if (gt->steering[i].ranges && xe_steering_types[i].init) in xe_gt_mcr_init()
479 * xe_gt_mcr_set_implicit_defaults - Initialize steer control registers
483 * changed on each access - it's sufficient to set them once on initialization.
493 if (xe->info.platform == XE_DG2) { in xe_gt_mcr_set_implicit_defaults()
509 * xe_gt_mcr_get_nonterminated_steering - find group/instance values that
510 * will steer a register to a non-terminated instance
532 if (!gt->steering[type].ranges) in xe_gt_mcr_get_nonterminated_steering()
535 for (int i = 0; gt->steering[type].ranges[i].end > 0; i++) { in xe_gt_mcr_get_nonterminated_steering()
536 if (xe_mmio_in_range(gt, &gt->steering[type].ranges[i], reg)) { in xe_gt_mcr_get_nonterminated_steering()
537 *group = gt->steering[type].group_target; in xe_gt_mcr_get_nonterminated_steering()
538 *instance = gt->steering[type].instance_target; in xe_gt_mcr_get_nonterminated_steering()
544 implicit_ranges = gt->steering[IMPLICIT_STEERING].ranges; in xe_gt_mcr_get_nonterminated_steering()
554 drm_WARN(&gt_to_xe(gt)->drm, true, in xe_gt_mcr_get_nonterminated_steering()
565 * to synchronize with external clients (e.g., firmware), so a semaphore
568 static void mcr_lock(struct xe_gt *gt) __acquires(&gt->mcr_lock) in mcr_lock()
573 spin_lock(&gt->mcr_lock); in mcr_lock()
577 * to synchronize with external agents (e.g., firmware) that now in mcr_lock()
585 drm_WARN_ON_ONCE(&xe->drm, ret == -ETIMEDOUT); in mcr_lock()
588 static void mcr_unlock(struct xe_gt *gt) __releases(&gt->mcr_lock) in mcr_unlock()
590 /* Release hardware semaphore - this is done by writing 1 to the register */ in mcr_unlock()
594 spin_unlock(&gt->mcr_lock); in mcr_unlock()
609 lockdep_assert_held(&gt->mcr_lock); in rw_with_mcr_steering()
629 * e.g. Wa_22013088509 on PVC. There's no real downside to this, so in rw_with_mcr_steering()
648 * don't matter since they'll be re-programmed on the next MCR in rw_with_mcr_steering()
658 * xe_gt_mcr_unicast_read_any - reads a non-terminated instance of an MCR register
662 * Reads a GT MCR register. The read will be steered to a non-terminated
663 * instance (i.e., one that isn't fused off or powered down by power gating).
667 * Returns the value from a non-terminated instance of @reg.
694 * xe_gt_mcr_unicast_read - read a specific instance of an MCR register
719 * xe_gt_mcr_unicast_write - write a specific instance of an MCR register
740 * xe_gt_mcr_multicast_write - write a value to all instances of an MCR register
767 if (gt->steering[i].ranges) { in xe_gt_mcr_steering_dump()
770 gt->steering[i].group_target, in xe_gt_mcr_steering_dump()
771 gt->steering[i].instance_target); in xe_gt_mcr_steering_dump()
772 for (int j = 0; gt->steering[i].ranges[j].end; j++) in xe_gt_mcr_steering_dump()
773 drm_printf(p, "\t0x%06x - 0x%06x\n", in xe_gt_mcr_steering_dump()
774 gt->steering[i].ranges[j].start, in xe_gt_mcr_steering_dump()
775 gt->steering[i].ranges[j].end); in xe_gt_mcr_steering_dump()