OSDN Git Service

platform/x86/intel/tpmi: Process CPU package mapping
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Thu, 2 Feb 2023 01:07:36 +0000 (17:07 -0800)
committerHans de Goede <hdegoede@redhat.com>
Mon, 6 Feb 2023 12:47:36 +0000 (13:47 +0100)
commit762ed313574652ac604fb95dd601232a6e0320ef
treec779414615bcac4df8823362806be857e26d9840
parent47731fd2865fcbcd0b9cdbe90fcd6583c9559631
platform/x86/intel/tpmi: Process CPU package mapping

There is one Intel Out-of-Band (OOB) PCI device per CPU package. Since
TPMI feature is exposed via OOB PCI device, there will be multiple
TPMI device instances on a multi CPU package system.

There are several PM features, which needs to associate APIC based CPU
package ID information to a TPMI instance. For example if Intel Speed
Select feature requires control of a CPU package, it needs to identify
right TPMI device instance.

There is one special TPMI ID (ID = 0x81) in the PFS. The MMIO
region of this TPMI ID points to a mapping table:
- PCI Bus ID
- PCI Device ID
- APIC based Package ID

This mapping information can be used by any PM feature driver which
requires mapping from a CPU package to a TPMI device instance.

Unlike other TPMI features, device node is not created for this feature
ID (0x81). Instead store the mapping information as platform data, which
is part of the per PCI device TPMI instance (struct intel_tpmi_info).
Later the TPMI feature drivers can get the mapping information using an
interface "tpmi_get_platform_data()"

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20230202010738.2186174-6-srinivas.pandruvada@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/intel/tpmi.c
include/linux/intel_tpmi.h [new file with mode: 0644]