Commit c8405cc8 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Hans de Goede

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: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarZhang Rui <rui.zhang@intel.com>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240423204619.3946901-5-srinivas.pandruvada@linux.intel.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 11925344
...@@ -128,6 +128,9 @@ struct intel_tpmi_info { ...@@ -128,6 +128,9 @@ struct intel_tpmi_info {
* @dev: PCI device number * @dev: PCI device number
* @bus: PCI bus number * @bus: PCI bus number
* @pkg: CPU Package id * @pkg: CPU Package id
* @segment: PCI segment id
* @partition: Package Partition id
* @cdie_mask: Bitmap of compute dies in the current partition
* @reserved: Reserved for future use * @reserved: Reserved for future use
* @lock: When set to 1 the register is locked and becomes read-only * @lock: When set to 1 the register is locked and becomes read-only
* until next reset. Not for use by the OS driver. * until next reset. Not for use by the OS driver.
...@@ -139,7 +142,10 @@ struct tpmi_info_header { ...@@ -139,7 +142,10 @@ struct tpmi_info_header {
u64 dev:5; u64 dev:5;
u64 bus:8; u64 bus:8;
u64 pkg:8; u64 pkg:8;
u64 reserved:39; u64 segment:8;
u64 partition:2;
u64 cdie_mask:16;
u64 reserved:13;
u64 lock:1; u64 lock:1;
} __packed; } __packed;
...@@ -667,6 +673,7 @@ static int tpmi_create_devices(struct intel_tpmi_info *tpmi_info) ...@@ -667,6 +673,7 @@ static int tpmi_create_devices(struct intel_tpmi_info *tpmi_info)
#define TPMI_INFO_BUS_INFO_OFFSET 0x08 #define TPMI_INFO_BUS_INFO_OFFSET 0x08
#define TPMI_INFO_MAJOR_VERSION 0x00 #define TPMI_INFO_MAJOR_VERSION 0x00
#define TPMI_INFO_MINOR_VERSION 0x02
static int tpmi_process_info(struct intel_tpmi_info *tpmi_info, static int tpmi_process_info(struct intel_tpmi_info *tpmi_info,
struct intel_tpmi_pm_feature *pfs) struct intel_tpmi_pm_feature *pfs)
...@@ -693,6 +700,12 @@ static int tpmi_process_info(struct intel_tpmi_info *tpmi_info, ...@@ -693,6 +700,12 @@ static int tpmi_process_info(struct intel_tpmi_info *tpmi_info,
tpmi_info->plat_info.device_number = header.dev; tpmi_info->plat_info.device_number = header.dev;
tpmi_info->plat_info.function_number = header.fn; tpmi_info->plat_info.function_number = header.fn;
if (TPMI_MINOR_VERSION(feature_header) >= TPMI_INFO_MINOR_VERSION) {
tpmi_info->plat_info.cdie_mask = header.cdie_mask;
tpmi_info->plat_info.partition = header.partition;
tpmi_info->plat_info.segment = header.segment;
}
error_info_header: error_info_header:
iounmap(info_mem); iounmap(info_mem);
......
...@@ -27,7 +27,10 @@ enum intel_tpmi_id { ...@@ -27,7 +27,10 @@ enum intel_tpmi_id {
/** /**
* struct intel_tpmi_plat_info - Platform information for a TPMI device instance * struct intel_tpmi_plat_info - Platform information for a TPMI device instance
* @cdie_mask: Mask of all compute dies in the partition
* @package_id: CPU Package id * @package_id: CPU Package id
* @partition: Package partition id when multiple VSEC PCI devices per package
* @segment: PCI segment ID
* @bus_number: PCI bus number * @bus_number: PCI bus number
* @device_number: PCI device number * @device_number: PCI device number
* @function_number: PCI function number * @function_number: PCI function number
...@@ -36,7 +39,10 @@ enum intel_tpmi_id { ...@@ -36,7 +39,10 @@ enum intel_tpmi_id {
* struct is used to return data via tpmi_get_platform_data(). * struct is used to return data via tpmi_get_platform_data().
*/ */
struct intel_tpmi_plat_info { struct intel_tpmi_plat_info {
u16 cdie_mask;
u8 package_id; u8 package_id;
u8 partition;
u8 segment;
u8 bus_number; u8 bus_number;
u8 device_number; u8 device_number;
u8 function_number; u8 function_number;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment