Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48516 )
Change subject: soc/amd/picasso: factor out write_resume_eip to common code
......................................................................
soc/amd/picasso: factor out write_resume_eip to common code
Change-Id: I24454aa9e2ccc98b2aceb6b189e072e6e50b8b30
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
---
M src/soc/amd/common/block/cpu/noncar/Makefile.inc
A src/soc/amd/common/block/cpu/noncar/write_resume_eip.c
A src/soc/amd/common/block/include/amdblocks/cpu.h
M src/soc/amd/picasso/bootblock.c
4 files changed, 36 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/48516/1
diff --git a/src/soc/amd/common/block/cpu/noncar/Makefile.inc b/src/soc/amd/common/block/cpu/noncar/Makefile.inc
index 7a3be34..ed08d2a 100644
--- a/src/soc/amd/common/block/cpu/noncar/Makefile.inc
+++ b/src/soc/amd/common/block/cpu/noncar/Makefile.inc
@@ -1,5 +1,6 @@
ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_NONCAR),y)
bootblock-y += pre_c.S
+bootblock-y += write_resume_eip.c
endif # CONFIG_SOC_AMD_COMMON_BLOCK_NONCAR
diff --git a/src/soc/amd/common/block/cpu/noncar/write_resume_eip.c b/src/soc/amd/common/block/cpu/noncar/write_resume_eip.c
new file mode 100644
index 0000000..e9b59d9
--- /dev/null
+++ b/src/soc/amd/common/block/cpu/noncar/write_resume_eip.c
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpi.h>
+#include <arch/cpu.h>
+#include <amdblocks/cpu.h>
+#include <cpu/amd/msr.h>
+#include <cpu/x86/msr.h>
+
+asmlinkage void bootblock_resume_entry(void);
+
+void write_resume_eip(void)
+{
+ msr_t s3_resume_entry = {
+ .hi = (uint64_t)(uintptr_t)bootblock_resume_entry >> 32,
+ .lo = (uintptr_t)bootblock_resume_entry & 0xffffffff,
+ };
+
+ /*
+ * Writing to the EIP register can only be done once, otherwise a fault is triggered.
+ * When this register is written, it will trigger the microcode to stash the CPU state
+ * (crX , mtrrs, registers, etc) into the CC6 save area. On resume, the state will be
+ * restored and execution will continue at the EIP.
+ */
+ if (!acpi_is_wakeup_s3())
+ wrmsr(S3_RESUME_EIP_MSR, s3_resume_entry);
+}
diff --git a/src/soc/amd/common/block/include/amdblocks/cpu.h b/src/soc/amd/common/block/include/amdblocks/cpu.h
new file mode 100644
index 0000000..0a93643
--- /dev/null
+++ b/src/soc/amd/common/block/include/amdblocks/cpu.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef AMD_BLOCK_CPU_H
+#define AMD_BLOCK_CPU_H
+
+void write_resume_eip(void);
+
+#endif /* AMD_BLOCK_CPU_H */
diff --git a/src/soc/amd/picasso/bootblock.c b/src/soc/amd/picasso/bootblock.c
index 0b52a17..7d1f01c 100644
--- a/src/soc/amd/picasso/bootblock.c
+++ b/src/soc/amd/picasso/bootblock.c
@@ -2,12 +2,12 @@
#include <stdint.h>
#include <symbols.h>
+#include <amdblocks/cpu.h>
#include <amdblocks/reset.h>
#include <bootblock_common.h>
#include <console/console.h>
#include <cpu/x86/cache.h>
#include <cpu/x86/msr.h>
-#include <cpu/amd/msr.h>
#include <cpu/x86/mtrr.h>
#include <cpu/amd/mtrr.h>
#include <cpu/x86/tsc.h>
@@ -16,9 +16,6 @@
#include <soc/southbridge.h>
#include <soc/i2c.h>
#include <amdblocks/amd_pci_mmconf.h>
-#include <acpi/acpi.h>
-
-asmlinkage void bootblock_resume_entry(void);
/* PSP performs the memory training and setting up DRAM map prior to x86 cores
being released. Honor TOP_MEM and set up caching from 0 til TOP_MEM. Likewise,
@@ -91,23 +88,6 @@
enable_cache();
}
-static void write_resume_eip(void)
-{
- msr_t s3_resume_entry = {
- .hi = (uint64_t)(uintptr_t)bootblock_resume_entry >> 32,
- .lo = (uintptr_t)bootblock_resume_entry & 0xffffffff,
- };
-
- /*
- * Writing to the EIP register can only be done once, otherwise a fault is triggered.
- * When this register is written, it will trigger the microcode to stash the CPU state
- * (crX , mtrrs, registers, etc) into the CC6 save area. On resume, the state will be
- * restored and execution will continue at the EIP.
- */
- if (!acpi_is_wakeup_s3())
- wrmsr(S3_RESUME_EIP_MSR, s3_resume_entry);
-}
-
asmlinkage void bootblock_c_entry(uint64_t base_timestamp)
{
set_caching();
--
To view, visit https://review.coreboot.org/c/coreboot/+/48516
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I24454aa9e2ccc98b2aceb6b189e072e6e50b8b30
Gerrit-Change-Number: 48516
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48521 )
Change subject: soc/amd/piasso,cezanne: add warning about using all-y in Makefile.inc
......................................................................
soc/amd/piasso,cezanne: add warning about using all-y in Makefile.inc
all-y will also add a compilation unit to the verstage on PSP build that
runs on an ARM code instead of a x86 one. At the moment Cezanne doesn't
have verstage on PSP support yet, but since it'll eventually land it
doesn't hurt to already add the comment now.
Change-Id: I15fb66e796cab48737ba5ac463c4c973794a005a
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
---
M src/soc/amd/cezanne/Makefile.inc
M src/soc/amd/picasso/Makefile.inc
2 files changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/21/48521/1
diff --git a/src/soc/amd/cezanne/Makefile.inc b/src/soc/amd/cezanne/Makefile.inc
index 946e480..e7d0aea 100644
--- a/src/soc/amd/cezanne/Makefile.inc
+++ b/src/soc/amd/cezanne/Makefile.inc
@@ -2,6 +2,7 @@
ifeq ($(CONFIG_SOC_AMD_CEZANNE),y)
+# Beware that all-y also adds the compilation unit to verstage on PSP
all-y += config.c
bootblock-y += bootblock.c
diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc
index 7cbae92..142fb0c 100644
--- a/src/soc/amd/picasso/Makefile.inc
+++ b/src/soc/amd/picasso/Makefile.inc
@@ -9,6 +9,7 @@
subdirs-y += ../../../cpu/x86/smm
subdirs-$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK) += psp_verstage
+# Beware that all-y also adds the compilation unit to verstage on PSP
all-y += config.c
all-y += aoac.c
--
To view, visit https://review.coreboot.org/c/coreboot/+/48521
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I15fb66e796cab48737ba5ac463c4c973794a005a
Gerrit-Change-Number: 48521
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48485 )
Change subject: soc/amd/picasso/aoac: only check FCH_AOAC_UART_FOR_CONSOLE if used
......................................................................
soc/amd/picasso/aoac: only check FCH_AOAC_UART_FOR_CONSOLE if used
FCH_AOAC_UART_FOR_CONSOLE will only be used in the code if
PICASSO_CONSOLE_UART is selected, so only check if it's a valid value in
this case.
Change-Id: I103dd8d469a084c7dc7dcf55175b1f77f900adc5
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
---
M src/soc/amd/picasso/aoac.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/48485/1
diff --git a/src/soc/amd/picasso/aoac.c b/src/soc/amd/picasso/aoac.c
index 7fd839b..c97700d 100644
--- a/src/soc/amd/picasso/aoac.c
+++ b/src/soc/amd/picasso/aoac.c
@@ -12,7 +12,7 @@
: CONFIG_UART_FOR_CONSOLE == 2 ? FCH_AOAC_DEV_UART2 \
: CONFIG_UART_FOR_CONSOLE == 3 ? FCH_AOAC_DEV_UART3 \
: -1)
-#if FCH_AOAC_UART_FOR_CONSOLE == -1
+#if CONFIG(PICASSO_CONSOLE_UART) && FCH_AOAC_UART_FOR_CONSOLE == -1
# error Unsupported UART_FOR_CONSOLE chosen
#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/48485
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I103dd8d469a084c7dc7dcf55175b1f77f900adc5
Gerrit-Change-Number: 48485
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange