]> www.infradead.org Git - users/dwmw2/linux.git/commit
platform/x86/intel: TPMI domain id and CPU mapping
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tue, 28 May 2024 07:34:57 +0000 (10:34 +0300)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 31 May 2024 13:31:23 +0000 (16:31 +0300)
commit17ca2780458cdb0afc623e3432b1977847da3d15
tree2806ad009ed4a9b8d5f2ba2d2a4e17d20f0abef5
parentd36842bacf8e3491f555059f27de57b3436cc3ff
platform/x86/intel: TPMI domain id and CPU mapping

Each TPMI power domain includes a group of CPUs. Several power
management settings in this case applicable to a group of CPUs.
There can be several power domains in a CPU package. So, provide
interfaces for:
- Get power domain id for a Linux CPU
- Get mask of Linux CPUs in a power domain

Hardware Punit uses different CPU numbering, which is not based on
APIC (Advanced Programmable Interrupt Controller) CPU numbering.
The Linux CPU numbering is based on APIC CPU numbering. Some PM features
like Intel Speed Select, the CPU core mask provided by the hardware is
based on the Punit CPU numbering. To use the core mask, this mask
needs to be converted to a Linux CPUs mask. So, provide interfaces for:
- Convert to a Linux CPU number from a Punit CPU number
- Convert to a Punit CPU number from a Linux CPU number

On each CPU online, MSR 0x54 is used to read the mapping and stores in
a per cpu array. Create a hash for faster searching of a Linux CPU number
from a Punit CPU number.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
[tero.kristo: minor updates]
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com>
Link: https://lore.kernel.org/r/20240528073457.497816-1-tero.kristo@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/intel/Kconfig
drivers/platform/x86/intel/Makefile
drivers/platform/x86/intel/tpmi_power_domains.c [new file with mode: 0644]
drivers/platform/x86/intel/tpmi_power_domains.h [new file with mode: 0644]