Skip to content

Commit c8405cc

Browse files
spandruvadajwrdegoede
authored andcommitted
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 <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Zhang Rui <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 1192534 commit c8405cc

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

drivers/platform/x86/intel/tpmi.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ struct intel_tpmi_info {
128128
* @dev: PCI device number
129129
* @bus: PCI bus number
130130
* @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
131134
* @reserved: Reserved for future use
132135
* @lock: When set to 1 the register is locked and becomes read-only
133136
* until next reset. Not for use by the OS driver.
@@ -139,7 +142,10 @@ struct tpmi_info_header {
139142
u64 dev:5;
140143
u64 bus:8;
141144
u64 pkg:8;
142-
u64 reserved:39;
145+
u64 segment:8;
146+
u64 partition:2;
147+
u64 cdie_mask:16;
148+
u64 reserved:13;
143149
u64 lock:1;
144150
} __packed;
145151

@@ -667,6 +673,7 @@ static int tpmi_create_devices(struct intel_tpmi_info *tpmi_info)
667673

668674
#define TPMI_INFO_BUS_INFO_OFFSET 0x08
669675
#define TPMI_INFO_MAJOR_VERSION 0x00
676+
#define TPMI_INFO_MINOR_VERSION 0x02
670677

671678
static int tpmi_process_info(struct intel_tpmi_info *tpmi_info,
672679
struct intel_tpmi_pm_feature *pfs)
@@ -693,6 +700,12 @@ static int tpmi_process_info(struct intel_tpmi_info *tpmi_info,
693700
tpmi_info->plat_info.device_number = header.dev;
694701
tpmi_info->plat_info.function_number = header.fn;
695702

703+
if (TPMI_MINOR_VERSION(feature_header) >= TPMI_INFO_MINOR_VERSION) {
704+
tpmi_info->plat_info.cdie_mask = header.cdie_mask;
705+
tpmi_info->plat_info.partition = header.partition;
706+
tpmi_info->plat_info.segment = header.segment;
707+
}
708+
696709
error_info_header:
697710
iounmap(info_mem);
698711

include/linux/intel_tpmi.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ enum intel_tpmi_id {
2727

2828
/**
2929
* struct intel_tpmi_plat_info - Platform information for a TPMI device instance
30+
* @cdie_mask: Mask of all compute dies in the partition
3031
* @package_id: CPU Package id
32+
* @partition: Package partition id when multiple VSEC PCI devices per package
33+
* @segment: PCI segment ID
3134
* @bus_number: PCI bus number
3235
* @device_number: PCI device number
3336
* @function_number: PCI function number
@@ -36,7 +39,10 @@ enum intel_tpmi_id {
3639
* struct is used to return data via tpmi_get_platform_data().
3740
*/
3841
struct intel_tpmi_plat_info {
42+
u16 cdie_mask;
3943
u8 package_id;
44+
u8 partition;
45+
u8 segment;
4046
u8 bus_number;
4147
u8 device_number;
4248
u8 function_number;

0 commit comments

Comments
 (0)