Skip to content

Commit ec437d7

Browse files
huangruirafaeljw
authored andcommitted
cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors
AMD P-State is the AMD CPU performance scaling driver that introduces a new CPU frequency control mechanism on AMD Zen based CPU series in Linux kernel. The new mechanism is based on Collaborative processor performance control (CPPC) which is finer grain frequency management than legacy ACPI hardware P-States. Current AMD CPU platforms are using the ACPI P-states driver to manage CPU frequency and clocks with switching only in 3 P-states. AMD P-State is to replace the ACPI P-states controls, allows a flexible, low-latency interface for the Linux kernel to directly communicate the performance hints to hardware. AMD P-State leverages the Linux kernel governors such as *schedutil*, *ondemand*, etc. to manage the performance hints which are provided by CPPC hardware functionality. The first version for AMD P-State is to support one of the Zen3 processors, and we will support more in future after we verify the hardware and SBIOS functionalities. There are two types of hardware implementations for AMD P-State: one is full MSR support and another is shared memory support. It can use X86_FEATURE_CPPC feature flag to distinguish the different types. Using the new AMD P-State method + kernel governors (*schedutil*, *ondemand*, ...) to manage the frequency update is the most appropriate bridge between AMD Zen based hardware processor and Linux kernel, the processor is able to adjust to the most efficiency frequency according to the kernel scheduler loading. Please check the detailed CPU feature and MSR register description in Processor Programming Reference (PPR) for AMD Family 19h Model 51h, Revision A1 Processors: https://www.amd.com/system/files/TechDocs/56569-A1-PUB.zip Signed-off-by: Huang Rui <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent fb0b00a commit ec437d7

File tree

3 files changed

+404
-0
lines changed

3 files changed

+404
-0
lines changed

drivers/cpufreq/Kconfig.x86

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ config X86_PCC_CPUFREQ
3434

3535
If in doubt, say N.
3636

37+
config X86_AMD_PSTATE
38+
tristate "AMD Processor P-State driver"
39+
depends on X86
40+
select ACPI_PROCESSOR if ACPI
41+
select ACPI_CPPC_LIB if X86_64 && ACPI
42+
select CPU_FREQ_GOV_SCHEDUTIL if SMP
43+
help
44+
This driver adds a CPUFreq driver which utilizes a fine grain
45+
processor performance frequency control range instead of legacy
46+
performance levels. _CPC needs to be present in the ACPI tables
47+
of the system.
48+
49+
For details, take a look at:
50+
<file:Documentation/admin-guide/pm/amd-pstate.rst>.
51+
52+
If in doubt, say N.
53+
3754
config X86_ACPI_CPUFREQ
3855
tristate "ACPI Processor P-States driver"
3956
depends on ACPI_PROCESSOR

drivers/cpufreq/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ obj-$(CONFIG_CPUFREQ_DT_PLATDEV) += cpufreq-dt-platdev.o
2525
# speedstep-* is preferred over p4-clockmod.
2626

2727
obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o
28+
obj-$(CONFIG_X86_AMD_PSTATE) += amd-pstate.o
2829
obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o
2930
obj-$(CONFIG_X86_PCC_CPUFREQ) += pcc-cpufreq.o
3031
obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o

0 commit comments

Comments
 (0)