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

platform/x86/intel/tpmi: Add additional TPMI header fields

TPMI information header added additional fields in version 2. Some of the
reserved fields in version 1 are used to define new fields.

Parse new fields and export as part of platform data. These fields include:
- PCI segment ID
- Partition ID of the package: If a package is represented by more than
one PCI device, then partition ID along with cdie_mask, describes the
scope. For example to update get/set properties for a compute die, one
of the PCI MMIO region is selected from the partition ID.
- cdie_mask: Mask of all compute dies in this partition.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240423204619.3946901-5-srinivas.pandruvada@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Srinivas Pandruvada and committed by
Hans de Goede
c8405cc8 11925344

+20 -1
+14 -1
drivers/platform/x86/intel/tpmi.c
··· 128 128 * @dev: PCI device number 129 129 * @bus: PCI bus number 130 130 * @pkg: CPU Package id 131 + * @segment: PCI segment id 132 + * @partition: Package Partition id 133 + * @cdie_mask: Bitmap of compute dies in the current partition 131 134 * @reserved: Reserved for future use 132 135 * @lock: When set to 1 the register is locked and becomes read-only 133 136 * until next reset. Not for use by the OS driver. ··· 142 139 u64 dev:5; 143 140 u64 bus:8; 144 141 u64 pkg:8; 145 - u64 reserved:39; 142 + u64 segment:8; 143 + u64 partition:2; 144 + u64 cdie_mask:16; 145 + u64 reserved:13; 146 146 u64 lock:1; 147 147 } __packed; 148 148 ··· 673 667 674 668 #define TPMI_INFO_BUS_INFO_OFFSET 0x08 675 669 #define TPMI_INFO_MAJOR_VERSION 0x00 670 + #define TPMI_INFO_MINOR_VERSION 0x02 676 671 677 672 static int tpmi_process_info(struct intel_tpmi_info *tpmi_info, 678 673 struct intel_tpmi_pm_feature *pfs) ··· 699 692 tpmi_info->plat_info.bus_number = header.bus; 700 693 tpmi_info->plat_info.device_number = header.dev; 701 694 tpmi_info->plat_info.function_number = header.fn; 695 + 696 + if (TPMI_MINOR_VERSION(feature_header) >= TPMI_INFO_MINOR_VERSION) { 697 + tpmi_info->plat_info.cdie_mask = header.cdie_mask; 698 + tpmi_info->plat_info.partition = header.partition; 699 + tpmi_info->plat_info.segment = header.segment; 700 + } 702 701 703 702 error_info_header: 704 703 iounmap(info_mem);
+6
include/linux/intel_tpmi.h
··· 27 27 28 28 /** 29 29 * struct intel_tpmi_plat_info - Platform information for a TPMI device instance 30 + * @cdie_mask: Mask of all compute dies in the partition 30 31 * @package_id: CPU Package id 32 + * @partition: Package partition id when multiple VSEC PCI devices per package 33 + * @segment: PCI segment ID 31 34 * @bus_number: PCI bus number 32 35 * @device_number: PCI device number 33 36 * @function_number: PCI function number ··· 39 36 * struct is used to return data via tpmi_get_platform_data(). 40 37 */ 41 38 struct intel_tpmi_plat_info { 39 + u16 cdie_mask; 42 40 u8 package_id; 41 + u8 partition; 42 + u8 segment; 43 43 u8 bus_number; 44 44 u8 device_number; 45 45 u8 function_number;