summaryrefslogtreecommitdiffstats
path: root/src/soc/amd/cezanne/include
diff options
context:
space:
mode:
authorJulian Schroeder <julianmarcusschroeder@gmail.com>2021-07-09 16:10:08 -0500
committerFelix Held <felix-coreboot@felixheld.de>2021-07-15 21:39:04 +0000
commit577e146895d489d809b4d41da7f6f2d7428143a2 (patch)
tree963579f26d4c4d179ad797c3ed1fb48f9b0048a6 /src/soc/amd/cezanne/include
parent82e2f3229ea752f76deeba3b3c511a53906e6acc (diff)
downloadcoreboot-577e146895d489d809b4d41da7f6f2d7428143a2.tar.gz
coreboot-577e146895d489d809b4d41da7f6f2d7428143a2.tar.bz2
coreboot-577e146895d489d809b4d41da7f6f2d7428143a2.zip
soc/amd/cezanne: add ACPI CPPC support for AMD
This leverages the existing Collaborative Processor Performance Control (CPPC) support and adds CPPC init for AMD/Cezanne. BUG=b:185814875 TEST=under Linux/ChromeOS, acpidump ssdt2, find expected CPPC entries Signed-off-by: Julian Schroeder <julianmarcusschroeder@gmail.com> Change-Id: I94172f40c7fa4b7b89237fd382448e598da00fbb Reviewed-on: https://review.coreboot.org/c/coreboot/+/56188 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/soc/amd/cezanne/include')
-rw-r--r--src/soc/amd/cezanne/include/soc/cppc.h12
-rw-r--r--src/soc/amd/cezanne/include/soc/msr.h18
2 files changed, 30 insertions, 0 deletions
diff --git a/src/soc/amd/cezanne/include/soc/cppc.h b/src/soc/amd/cezanne/include/soc/cppc.h
new file mode 100644
index 000000000000..60a5efd33417
--- /dev/null
+++ b/src/soc/amd/cezanne/include/soc/cppc.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef _CPU_AMD_COMMON_H
+#define _CPU_AMD_COMMON_H
+
+#include <types.h>
+
+struct cppc_config;
+void cpu_init_cppc_config(struct cppc_config *config, u32 version);
+void generate_cppc_entries(unsigned int core_id);
+
+#endif
diff --git a/src/soc/amd/cezanne/include/soc/msr.h b/src/soc/amd/cezanne/include/soc/msr.h
index cc1f77e35b98..ca2992a1214d 100644
--- a/src/soc/amd/cezanne/include/soc/msr.h
+++ b/src/soc/amd/cezanne/include/soc/msr.h
@@ -21,4 +21,22 @@
#define PSTATE_DEF_LO_FREQ_MUL_MASK (0xFF << PSTATE_DEF_LO_FREQ_MUL_SHIFT)
#define PSTATE_DEF_LO_CORE_FREQ_BASE 25
+#define MSR_CPPC_CAPABILITY_1 0xc00102b0
+#define SHIFT_CPPC_CAPABILITY_1_HIGHEST_PERF 24
+#define SHIFT_CPPC_CAPABILITY_1_NOMINAL_PERF 16
+#define SHIFT_CPPC_CAPABILITY_1_LOW_NON_LIN_PERF 8
+#define SHIFT_CPPC_CAPABILITY_1_LOWEST_PERF 0
+
+#define MSR_CPPC_ENABLE 0xc00102b1
+#define MSR_CPPC_REQUEST 0xc00102b3
+#define SHIFT_CPPC_REQUEST_ENERGY_PERF_PREF 24
+#define SHIFT_CPPC_REQUEST_DES_PERF 16
+#define SHIFT_CPPC_REQUEST_MIN_PERF 8
+#define SHIFT_CPPC_REQUEST_MAX_PERF 0
+
+#define MSR_CPPC_STATUS 0xc00102b4
+
+#define MSR_MAX_PERFORMANCE_FREQUENCY_CLOCK_COUNT 0xe7
+#define MSR_ACTUAL_PERFORMANCE_FREQUENCY_CLOCK_COUNT 0xe8
+
#endif /* AMD_CEZANNE_MSR_H */