Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86/intel/pmc: Show Die C6 counter on Meteor Lake

Expose the Die C6 counter on Meteor Lake.

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231129222132.2331261-21-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

David E. Box and committed by
Hans de Goede
6e796485 3621df43

+32
+32
drivers/platform/x86/intel/pmc/mtl.c
··· 10 10 11 11 #include <linux/pci.h> 12 12 #include "core.h" 13 + #include "../pmt/telemetry.h" 13 14 14 15 /* PMC SSRAM PMT Telemetry GUIDS */ 15 16 #define SOCP_LPM_REQ_GUID 0x2625030 16 17 #define IOEM_LPM_REQ_GUID 0x4357464 17 18 #define IOEP_LPM_REQ_GUID 0x5077612 19 + 20 + /* Die C6 from PUNIT telemetry */ 21 + #define MTL_PMT_DMU_DIE_C6_OFFSET 15 22 + #define MTL_PMT_DMU_GUID 0x1A067102 18 23 19 24 static const u8 MTL_LPM_REG_INDEX[] = {0, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20}; 20 25 ··· 973 968 {} 974 969 }; 975 970 971 + static void mtl_punit_pmt_init(struct pmc_dev *pmcdev) 972 + { 973 + struct telem_endpoint *ep; 974 + struct pci_dev *pcidev; 975 + 976 + pcidev = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(10, 0)); 977 + if (!pcidev) { 978 + dev_err(&pmcdev->pdev->dev, "PUNIT PMT device not found.\n"); 979 + return; 980 + } 981 + 982 + ep = pmt_telem_find_and_register_endpoint(pcidev, MTL_PMT_DMU_GUID, 0); 983 + if (IS_ERR(ep)) { 984 + dev_err(&pmcdev->pdev->dev, 985 + "pmc_core: couldn't get DMU telem endpoint, %ld\n", 986 + PTR_ERR(ep)); 987 + return; 988 + } 989 + 990 + pci_dev_put(pcidev); 991 + pmcdev->punit_ep = ep; 992 + 993 + pmcdev->has_die_c6 = true; 994 + pmcdev->die_c6_offset = MTL_PMT_DMU_DIE_C6_OFFSET; 995 + } 996 + 976 997 #define MTL_GNA_PCI_DEV 0x7e4c 977 998 #define MTL_IPU_PCI_DEV 0x7d19 978 999 #define MTL_VPU_PCI_DEV 0x7d1d ··· 1063 1032 } 1064 1033 1065 1034 pmc_core_get_low_power_modes(pmcdev); 1035 + mtl_punit_pmt_init(pmcdev); 1066 1036 1067 1037 /* Due to a hardware limitation, the GBE LTR blocks PC10 1068 1038 * when a cable is attached. Tell the PMC to ignore it.