|
109 | 109 | #define PCI_DEVICE_ID_INTEL_RPL_23_IMC 0xA728
|
110 | 110 | #define PCI_DEVICE_ID_INTEL_RPL_24_IMC 0xA729
|
111 | 111 | #define PCI_DEVICE_ID_INTEL_RPL_25_IMC 0xA72A
|
| 112 | +#define PCI_DEVICE_ID_INTEL_MTL_1_IMC 0x7d00 |
| 113 | +#define PCI_DEVICE_ID_INTEL_MTL_2_IMC 0x7d01 |
| 114 | +#define PCI_DEVICE_ID_INTEL_MTL_3_IMC 0x7d02 |
| 115 | +#define PCI_DEVICE_ID_INTEL_MTL_4_IMC 0x7d05 |
| 116 | +#define PCI_DEVICE_ID_INTEL_MTL_5_IMC 0x7d10 |
| 117 | +#define PCI_DEVICE_ID_INTEL_MTL_6_IMC 0x7d14 |
| 118 | +#define PCI_DEVICE_ID_INTEL_MTL_7_IMC 0x7d15 |
| 119 | +#define PCI_DEVICE_ID_INTEL_MTL_8_IMC 0x7d16 |
| 120 | +#define PCI_DEVICE_ID_INTEL_MTL_9_IMC 0x7d21 |
| 121 | +#define PCI_DEVICE_ID_INTEL_MTL_10_IMC 0x7d22 |
| 122 | +#define PCI_DEVICE_ID_INTEL_MTL_11_IMC 0x7d23 |
| 123 | +#define PCI_DEVICE_ID_INTEL_MTL_12_IMC 0x7d24 |
| 124 | +#define PCI_DEVICE_ID_INTEL_MTL_13_IMC 0x7d28 |
112 | 125 |
|
113 | 126 |
|
114 | 127 | #define IMC_UNCORE_DEV(a) \
|
|
205 | 218 | #define ADL_UNC_ARB_PERFEVTSEL0 0x2FD0
|
206 | 219 | #define ADL_UNC_ARB_MSR_OFFSET 0x8
|
207 | 220 |
|
| 221 | +/* MTL Cbo register */ |
| 222 | +#define MTL_UNC_CBO_0_PER_CTR0 0x2448 |
| 223 | +#define MTL_UNC_CBO_0_PERFEVTSEL0 0x2442 |
| 224 | + |
| 225 | +/* MTL HAC_ARB register */ |
| 226 | +#define MTL_UNC_HAC_ARB_CTR 0x2018 |
| 227 | +#define MTL_UNC_HAC_ARB_CTRL 0x2012 |
| 228 | + |
| 229 | +/* MTL ARB register */ |
| 230 | +#define MTL_UNC_ARB_CTR 0x2418 |
| 231 | +#define MTL_UNC_ARB_CTRL 0x2412 |
| 232 | + |
| 233 | +/* MTL cNCU register */ |
| 234 | +#define MTL_UNC_CNCU_FIXED_CTR 0x2408 |
| 235 | +#define MTL_UNC_CNCU_FIXED_CTRL 0x2402 |
| 236 | +#define MTL_UNC_CNCU_BOX_CTL 0x240e |
| 237 | + |
| 238 | +/* MTL sNCU register */ |
| 239 | +#define MTL_UNC_SNCU_FIXED_CTR 0x2008 |
| 240 | +#define MTL_UNC_SNCU_FIXED_CTRL 0x2002 |
| 241 | +#define MTL_UNC_SNCU_BOX_CTL 0x200e |
| 242 | + |
| 243 | +/* MTL HAC_CBO register */ |
| 244 | +#define MTL_UNC_HBO_CTR 0x2048 |
| 245 | +#define MTL_UNC_HBO_CTRL 0x2042 |
| 246 | + |
208 | 247 | DEFINE_UNCORE_FORMAT_ATTR(event, event, "config:0-7");
|
209 | 248 | DEFINE_UNCORE_FORMAT_ATTR(umask, umask, "config:8-15");
|
210 | 249 | DEFINE_UNCORE_FORMAT_ATTR(chmask, chmask, "config:8-11");
|
@@ -598,6 +637,115 @@ void adl_uncore_cpu_init(void)
|
598 | 637 | uncore_msr_uncores = adl_msr_uncores;
|
599 | 638 | }
|
600 | 639 |
|
| 640 | +static struct intel_uncore_type mtl_uncore_cbox = { |
| 641 | + .name = "cbox", |
| 642 | + .num_counters = 2, |
| 643 | + .perf_ctr_bits = 48, |
| 644 | + .perf_ctr = MTL_UNC_CBO_0_PER_CTR0, |
| 645 | + .event_ctl = MTL_UNC_CBO_0_PERFEVTSEL0, |
| 646 | + .event_mask = ADL_UNC_RAW_EVENT_MASK, |
| 647 | + .msr_offset = SNB_UNC_CBO_MSR_OFFSET, |
| 648 | + .ops = &icl_uncore_msr_ops, |
| 649 | + .format_group = &adl_uncore_format_group, |
| 650 | +}; |
| 651 | + |
| 652 | +static struct intel_uncore_type mtl_uncore_hac_arb = { |
| 653 | + .name = "hac_arb", |
| 654 | + .num_counters = 2, |
| 655 | + .num_boxes = 2, |
| 656 | + .perf_ctr_bits = 48, |
| 657 | + .perf_ctr = MTL_UNC_HAC_ARB_CTR, |
| 658 | + .event_ctl = MTL_UNC_HAC_ARB_CTRL, |
| 659 | + .event_mask = ADL_UNC_RAW_EVENT_MASK, |
| 660 | + .msr_offset = SNB_UNC_CBO_MSR_OFFSET, |
| 661 | + .ops = &icl_uncore_msr_ops, |
| 662 | + .format_group = &adl_uncore_format_group, |
| 663 | +}; |
| 664 | + |
| 665 | +static struct intel_uncore_type mtl_uncore_arb = { |
| 666 | + .name = "arb", |
| 667 | + .num_counters = 2, |
| 668 | + .num_boxes = 2, |
| 669 | + .perf_ctr_bits = 48, |
| 670 | + .perf_ctr = MTL_UNC_ARB_CTR, |
| 671 | + .event_ctl = MTL_UNC_ARB_CTRL, |
| 672 | + .event_mask = ADL_UNC_RAW_EVENT_MASK, |
| 673 | + .msr_offset = SNB_UNC_CBO_MSR_OFFSET, |
| 674 | + .ops = &icl_uncore_msr_ops, |
| 675 | + .format_group = &adl_uncore_format_group, |
| 676 | +}; |
| 677 | + |
| 678 | +static struct intel_uncore_type mtl_uncore_hac_cbox = { |
| 679 | + .name = "hac_cbox", |
| 680 | + .num_counters = 2, |
| 681 | + .num_boxes = 2, |
| 682 | + .perf_ctr_bits = 48, |
| 683 | + .perf_ctr = MTL_UNC_HBO_CTR, |
| 684 | + .event_ctl = MTL_UNC_HBO_CTRL, |
| 685 | + .event_mask = ADL_UNC_RAW_EVENT_MASK, |
| 686 | + .msr_offset = SNB_UNC_CBO_MSR_OFFSET, |
| 687 | + .ops = &icl_uncore_msr_ops, |
| 688 | + .format_group = &adl_uncore_format_group, |
| 689 | +}; |
| 690 | + |
| 691 | +static void mtl_uncore_msr_init_box(struct intel_uncore_box *box) |
| 692 | +{ |
| 693 | + wrmsrl(uncore_msr_box_ctl(box), SNB_UNC_GLOBAL_CTL_EN); |
| 694 | +} |
| 695 | + |
| 696 | +static struct intel_uncore_ops mtl_uncore_msr_ops = { |
| 697 | + .init_box = mtl_uncore_msr_init_box, |
| 698 | + .disable_event = snb_uncore_msr_disable_event, |
| 699 | + .enable_event = snb_uncore_msr_enable_event, |
| 700 | + .read_counter = uncore_msr_read_counter, |
| 701 | +}; |
| 702 | + |
| 703 | +static struct intel_uncore_type mtl_uncore_cncu = { |
| 704 | + .name = "cncu", |
| 705 | + .num_counters = 1, |
| 706 | + .num_boxes = 1, |
| 707 | + .box_ctl = MTL_UNC_CNCU_BOX_CTL, |
| 708 | + .fixed_ctr_bits = 48, |
| 709 | + .fixed_ctr = MTL_UNC_CNCU_FIXED_CTR, |
| 710 | + .fixed_ctl = MTL_UNC_CNCU_FIXED_CTRL, |
| 711 | + .single_fixed = 1, |
| 712 | + .event_mask = SNB_UNC_CTL_EV_SEL_MASK, |
| 713 | + .format_group = &icl_uncore_clock_format_group, |
| 714 | + .ops = &mtl_uncore_msr_ops, |
| 715 | + .event_descs = icl_uncore_events, |
| 716 | +}; |
| 717 | + |
| 718 | +static struct intel_uncore_type mtl_uncore_sncu = { |
| 719 | + .name = "sncu", |
| 720 | + .num_counters = 1, |
| 721 | + .num_boxes = 1, |
| 722 | + .box_ctl = MTL_UNC_SNCU_BOX_CTL, |
| 723 | + .fixed_ctr_bits = 48, |
| 724 | + .fixed_ctr = MTL_UNC_SNCU_FIXED_CTR, |
| 725 | + .fixed_ctl = MTL_UNC_SNCU_FIXED_CTRL, |
| 726 | + .single_fixed = 1, |
| 727 | + .event_mask = SNB_UNC_CTL_EV_SEL_MASK, |
| 728 | + .format_group = &icl_uncore_clock_format_group, |
| 729 | + .ops = &mtl_uncore_msr_ops, |
| 730 | + .event_descs = icl_uncore_events, |
| 731 | +}; |
| 732 | + |
| 733 | +static struct intel_uncore_type *mtl_msr_uncores[] = { |
| 734 | + &mtl_uncore_cbox, |
| 735 | + &mtl_uncore_hac_arb, |
| 736 | + &mtl_uncore_arb, |
| 737 | + &mtl_uncore_hac_cbox, |
| 738 | + &mtl_uncore_cncu, |
| 739 | + &mtl_uncore_sncu, |
| 740 | + NULL |
| 741 | +}; |
| 742 | + |
| 743 | +void mtl_uncore_cpu_init(void) |
| 744 | +{ |
| 745 | + mtl_uncore_cbox.num_boxes = icl_get_cbox_num(); |
| 746 | + uncore_msr_uncores = mtl_msr_uncores; |
| 747 | +} |
| 748 | + |
601 | 749 | enum {
|
602 | 750 | SNB_PCI_UNCORE_IMC,
|
603 | 751 | };
|
@@ -1264,6 +1412,19 @@ static const struct pci_device_id tgl_uncore_pci_ids[] = {
|
1264 | 1412 | IMC_UNCORE_DEV(RPL_23),
|
1265 | 1413 | IMC_UNCORE_DEV(RPL_24),
|
1266 | 1414 | IMC_UNCORE_DEV(RPL_25),
|
| 1415 | + IMC_UNCORE_DEV(MTL_1), |
| 1416 | + IMC_UNCORE_DEV(MTL_2), |
| 1417 | + IMC_UNCORE_DEV(MTL_3), |
| 1418 | + IMC_UNCORE_DEV(MTL_4), |
| 1419 | + IMC_UNCORE_DEV(MTL_5), |
| 1420 | + IMC_UNCORE_DEV(MTL_6), |
| 1421 | + IMC_UNCORE_DEV(MTL_7), |
| 1422 | + IMC_UNCORE_DEV(MTL_8), |
| 1423 | + IMC_UNCORE_DEV(MTL_9), |
| 1424 | + IMC_UNCORE_DEV(MTL_10), |
| 1425 | + IMC_UNCORE_DEV(MTL_11), |
| 1426 | + IMC_UNCORE_DEV(MTL_12), |
| 1427 | + IMC_UNCORE_DEV(MTL_13), |
1267 | 1428 | { /* end: all zeroes */ }
|
1268 | 1429 | };
|
1269 | 1430 |
|
|
0 commit comments