Lines Matching +full:chg +full:- +full:int

1 // SPDX-License-Identifier: MIT
45 void (*dump)(struct xe_mocs_info *mocs, unsigned int flags,
57 unsigned int table_size;
59 unsigned int num_mocs_regs;
67 /* Defines for the tables (GLOB_MOCS_0 - GLOB_MOCS_16) */
73 #define XELP_NUM_MOCS_ENTRIES 64 /* 63-64 are reserved, but configured. */
125 * LNCFCMOCS0 - LNCFCMOCS32 registers.
146 /* Base - L3 + LLC */
150 /* Base - Uncached */
154 /* Base - L3 */
158 /* Base - LLC */
162 /* Age 0 - LLC */
166 /* Age 0 - L3 + LLC */
170 /* Age: Don't Chg. - LLC */
174 /* Age: Don't Chg. - L3 + LLC */
178 /* No AOM - LLC */
182 /* No AOM - L3 + LLC */
186 /* No AOM; Age 0 - LLC */
190 /* No AOM; Age 0 - L3 + LLC */
194 /* No AOM; Age:DC - LLC */
198 /* No AOM; Age:DC - L3 + LLC */
202 /* Self-Snoop - L3 + LLC */
206 /* Skip Caching - L3 + LLC(12.5%) */
210 /* Skip Caching - L3 + LLC(25%) */
214 /* Skip Caching - L3 + LLC(50%) */
218 /* Skip Caching - L3 + LLC(75%) */
222 /* Skip Caching - L3 + LLC(87.5%) */
226 /* Implicitly enable L1 - HDC:L1 + L3 + LLC */
230 /* Implicitly enable L1 - HDC:L1 + L3 */
234 /* Implicitly enable L1 - HDC:L1 + LLC */
238 /* Implicitly enable L1 - HDC:L1 */
250 /* HW Reserved - SW program but never use */
254 /* HW Reserved - SW program but never use */
272 unsigned int i, j; in xelp_lncf_dump()
277 for (i = 0, j = 0; i < (info->num_mocs_regs + 1) / 2; i++, j++) { in xelp_lncf_dump()
281 reg_val = xe_mmio_read32(&gt->mmio, XELP_LNCFCMOCS(i)); in xelp_lncf_dump()
299 static void xelp_mocs_dump(struct xe_mocs_info *info, unsigned int flags, in xelp_mocs_dump()
302 unsigned int i; in xelp_mocs_dump()
309 for (i = 0; i < info->num_mocs_regs; i++) { in xelp_mocs_dump()
313 reg_val = xe_mmio_read32(&gt->mmio, XELP_GLOBAL_MOCS(i)); in xelp_mocs_dump()
341 /* WB - L3 */
343 /* WB - L3 50% */
345 /* WB - L3 25% */
347 /* WB - L3 12.5% */
363 /* UC - Coherent; GO:L3 */
365 /* UC - Coherent; GO:Memory */
367 /* UC - Non-Coherent; GO:Memory */
370 /* WB - LC */
374 static void xehp_lncf_dump(struct xe_mocs_info *info, unsigned int flags, in xehp_lncf_dump()
377 unsigned int i, j; in xehp_lncf_dump()
382 for (i = 0, j = 0; i < (info->num_mocs_regs + 1) / 2; i++, j++) { in xehp_lncf_dump()
386 reg_val = xe_mmio_read32(&gt->mmio, XELP_LNCFCMOCS(i)); in xehp_lncf_dump()
419 static void pvc_mocs_dump(struct xe_mocs_info *info, unsigned int flags, struct xe_gt *gt, in pvc_mocs_dump()
422 unsigned int i, j; in pvc_mocs_dump()
427 for (i = 0, j = 0; i < (info->num_mocs_regs + 1) / 2; i++, j++) { in pvc_mocs_dump()
431 reg_val = xe_mmio_read32(&gt->mmio, XELP_LNCFCMOCS(i)); in pvc_mocs_dump()
450 /* Error - Reserved for Non-Use */
454 /* Cached - L3 + L4 */
458 /* L4 - GO:L3 */
462 /* Uncached - GO:L3 */
466 /* L4 - GO:Mem */
470 /* Uncached - GO:Mem */
474 /* L4 - L3:NoLKUP; GO:L3 */
478 /* Uncached - L3:NoLKUP; GO:L3 */
482 /* L4 - L3:NoLKUP; GO:Mem */
486 /* Uncached - L3:NoLKUP; GO:Mem */
490 /* Display - L3; L4:WT */
494 /* CCS - Non-Displayable */
500 static void mtl_mocs_dump(struct xe_mocs_info *info, unsigned int flags, in mtl_mocs_dump()
503 unsigned int i; in mtl_mocs_dump()
509 for (i = 0; i < info->num_mocs_regs; i++) { in mtl_mocs_dump()
513 reg_val = xe_mmio_read32(&gt->mmio, XELP_GLOBAL_MOCS(i)); in mtl_mocs_dump()
543 static void xe2_mocs_dump(struct xe_mocs_info *info, unsigned int flags, in xe2_mocs_dump()
546 unsigned int i; in xe2_mocs_dump()
552 for (i = 0; i < info->num_mocs_regs; i++) { in xe2_mocs_dump()
556 reg_val = xe_mmio_read32(&gt->mmio, XELP_GLOBAL_MOCS(i)); in xe2_mocs_dump()
571 static unsigned int get_mocs_settings(struct xe_device *xe, in get_mocs_settings()
574 unsigned int flags = 0; in get_mocs_settings()
578 switch (xe->info.platform) { in get_mocs_settings()
582 info->ops = &xe2_mocs_ops; in get_mocs_settings()
583 info->table_size = ARRAY_SIZE(xe2_mocs_table); in get_mocs_settings()
584 info->table = xe2_mocs_table; in get_mocs_settings()
585 info->num_mocs_regs = XE2_NUM_MOCS_ENTRIES; in get_mocs_settings()
586 info->uc_index = 3; in get_mocs_settings()
587 info->wb_index = 4; in get_mocs_settings()
588 info->unused_entries_index = 4; in get_mocs_settings()
591 info->ops = &pvc_mocs_ops; in get_mocs_settings()
592 info->table_size = ARRAY_SIZE(pvc_mocs_desc); in get_mocs_settings()
593 info->table = pvc_mocs_desc; in get_mocs_settings()
594 info->num_mocs_regs = PVC_NUM_MOCS_ENTRIES; in get_mocs_settings()
595 info->uc_index = 1; in get_mocs_settings()
596 info->wb_index = 2; in get_mocs_settings()
597 info->unused_entries_index = 2; in get_mocs_settings()
600 info->ops = &mtl_mocs_ops; in get_mocs_settings()
601 info->table_size = ARRAY_SIZE(mtl_mocs_desc); in get_mocs_settings()
602 info->table = mtl_mocs_desc; in get_mocs_settings()
603 info->num_mocs_regs = MTL_NUM_MOCS_ENTRIES; in get_mocs_settings()
604 info->uc_index = 9; in get_mocs_settings()
605 info->unused_entries_index = 1; in get_mocs_settings()
608 info->ops = &xehp_mocs_ops; in get_mocs_settings()
609 info->table_size = ARRAY_SIZE(dg2_mocs_desc); in get_mocs_settings()
610 info->table = dg2_mocs_desc; in get_mocs_settings()
611 info->uc_index = 1; in get_mocs_settings()
616 info->num_mocs_regs = XELP_NUM_MOCS_ENTRIES - 1; in get_mocs_settings()
617 info->unused_entries_index = 3; in get_mocs_settings()
620 info->ops = &xelp_mocs_ops; in get_mocs_settings()
621 info->table_size = ARRAY_SIZE(dg1_mocs_desc); in get_mocs_settings()
622 info->table = dg1_mocs_desc; in get_mocs_settings()
623 info->uc_index = 1; in get_mocs_settings()
624 info->num_mocs_regs = XELP_NUM_MOCS_ENTRIES; in get_mocs_settings()
625 info->unused_entries_index = 5; in get_mocs_settings()
632 info->ops = &xelp_mocs_ops; in get_mocs_settings()
633 info->table_size = ARRAY_SIZE(gen12_mocs_desc); in get_mocs_settings()
634 info->table = gen12_mocs_desc; in get_mocs_settings()
635 info->num_mocs_regs = XELP_NUM_MOCS_ENTRIES; in get_mocs_settings()
636 info->uc_index = 3; in get_mocs_settings()
637 info->unused_entries_index = 2; in get_mocs_settings()
640 drm_err(&xe->drm, "Platform that should have a MOCS table does not.\n"); in get_mocs_settings()
652 xe_assert(xe, info->unused_entries_index != 0); in get_mocs_settings()
654 xe_assert(xe, info->ops && info->ops->dump); in get_mocs_settings()
655 xe_assert(xe, info->table_size <= info->num_mocs_regs); in get_mocs_settings()
670 unsigned int index) in get_entry_control()
672 if (index < info->table_size && info->table[index].used) in get_entry_control()
673 return info->table[index].control_value; in get_entry_control()
674 return info->table[info->unused_entries_index].control_value; in get_entry_control()
680 unsigned int i; in __init_mocs_table()
683 mocs_dbg(gt, "mocs entries: %d\n", info->num_mocs_regs); in __init_mocs_table()
685 for (i = 0; i < info->num_mocs_regs; i++) { in __init_mocs_table()
694 xe_mmio_write32(&gt->mmio, XELP_GLOBAL_MOCS(i), mocs); in __init_mocs_table()
704 unsigned int index) in get_entry_l3cc()
706 if (index < info->table_size && info->table[index].used) in get_entry_l3cc()
707 return info->table[index].l3cc_value; in get_entry_l3cc()
708 return info->table[info->unused_entries_index].l3cc_value; in get_entry_l3cc()
719 unsigned int i; in init_l3cc_table()
722 mocs_dbg(gt, "l3cc entries: %d\n", info->num_mocs_regs); in init_l3cc_table()
724 for (i = 0; i < (info->num_mocs_regs + 1) / 2; i++) { in init_l3cc_table()
734 xe_mmio_write32(&gt->mmio, XELP_LNCFCMOCS(i), l3cc); in init_l3cc_table()
743 gt->mocs.uc_index = table.uc_index; in xe_mocs_init_early()
744 gt->mocs.wb_index = table.wb_index; in xe_mocs_init_early()
750 unsigned int flags; in xe_mocs_init()
780 unsigned int fw_ref, flags; in xe_mocs_dump()
791 table.ops->dump(&table, flags, gt, p); in xe_mocs_dump()