platform/x86/intel-uncore-freq: Uncore frequency control via TPMI
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Thu, 20 Apr 2023 22:05:14 +0000 (15:05 -0700)
committerHans de Goede <hdegoede@redhat.com>
Tue, 9 May 2023 09:54:42 +0000 (11:54 +0200)
commit8a54e2253e4c25e5b61c9a9bee157bb52da5d432
tree7f9665171b90e9e775d6aecb41c987393f6d5f6d
parent334e3516f23360e0690511fb43052959111f51b4
platform/x86/intel-uncore-freq: Uncore frequency control via TPMI

Implement support of uncore frequency control via TPMI (Topology Aware
Register and PM Capsule Interface). This driver provides the similar
functionality as the current uncore frequency driver using MSRs.

The hardware interface to read/write is basically substitution of MSR
0x620 and 0x621. There are specific MMIO offset and bits to get/set
minimum and maximum uncore ratio, similar to MSRs.

The scope of the uncore MSRs is package/die. But new generation of CPUs
have more granular control at a cluster level. Each package/die can have
multiple power domains, which further can have multiple clusters. The
TPMI interface allows control at cluster level.

The primary use case for uncore sysfs is to set maximum and minimum
uncore frequency to reduce power consumption or latency. The current
uncore sysfs control is per package/die. This is enough for the majority
of users as workload will move to different power domains as it moves
between different CPUs.

The current uncore sysfs provides controls at package/die level. When
user sets maximum/minimum limits, the driver sets the same limits to
each cluster.

Here number of power domains = number of resources in this aux device.
There are offsets and bits to discover number of clusters and offset for
each cluster level controls.

The TPMI documentation can be downloaded from:
https://github.com/intel/tpmi_power_management

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Wendy Wang <wendy.wang@intel.com>
Link: https://lore.kernel.org/r/20230420220514.747573-1-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/uncore-frequency/Kconfig
drivers/platform/x86/intel/uncore-frequency/Makefile
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-tpmi.c [new file with mode: 0644]