summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-02-08 22:37:17 +0100
committerFelix Held <felix-coreboot@felixheld.de>2021-02-09 21:57:24 +0000
commit9a6fc577d1b6a877b30c623433fffee57c69c5da (patch)
tree685199f2dee8b5307301a331ed3ff5b301dad927 /src/soc/amd/common/block
parentdd2f3fa533eb8f7537aa480b20d9bbf61f01d6a7 (diff)
soc/amd/picasso/cpu: move set_cstate_io_addr to common code
Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I3b8a38ea39d8dc56ff1249a3212fe352b3e805ce Reviewed-on: https://review.coreboot.org/c/coreboot/+/50407 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Diffstat (limited to 'src/soc/amd/common/block')
-rw-r--r--src/soc/amd/common/block/cpu/noncar/cpu.c12
-rw-r--r--src/soc/amd/common/block/include/amdblocks/cpu.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/cpu/noncar/cpu.c b/src/soc/amd/common/block/cpu/noncar/cpu.c
index 7c1daf96f1..98926bff7e 100644
--- a/src/soc/amd/common/block/cpu/noncar/cpu.c
+++ b/src/soc/amd/common/block/cpu/noncar/cpu.c
@@ -2,8 +2,20 @@
#include <amdblocks/cpu.h>
#include <cpu/cpu.h>
+#include <cpu/x86/msr.h>
+#include <cpu/amd/msr.h>
+#include <soc/iomap.h>
int get_cpu_count(void)
{
return 1 + (cpuid_ecx(0x80000008) & 0xff);
}
+
+void set_cstate_io_addr(void)
+{
+ msr_t cst_addr;
+
+ cst_addr.hi = 0;
+ cst_addr.lo = ACPI_CPU_CONTROL;
+ wrmsr(MSR_CSTATE_ADDRESS, cst_addr);
+}
diff --git a/src/soc/amd/common/block/include/amdblocks/cpu.h b/src/soc/amd/common/block/include/amdblocks/cpu.h
index 50300d5a0f..0627bc1377 100644
--- a/src/soc/amd/common/block/include/amdblocks/cpu.h
+++ b/src/soc/amd/common/block/include/amdblocks/cpu.h
@@ -4,6 +4,7 @@
#define AMD_BLOCK_CPU_H
int get_cpu_count(void);
+void set_cstate_io_addr(void);
void write_resume_eip(void);
#endif /* AMD_BLOCK_CPU_H */