Richard Spiegel has uploaded this change for review. ( https://review.coreboot.org/27110
Change subject: soc/amd/stoneyridge/southbridge.c: Log failed S3 resume
......................................................................
soc/amd/stoneyridge/southbridge.c: Log failed S3 resume
Newly defined structure soc_power_reg includes information on last sleep
type (S3/S5) extracted from power management control register. If the last
sleep type was S3, but code is about to load an OS (normal boot), we have
a situation in which S3 resume failed and was converted into a regular boot.
We need to log this event.
BUG=b:110225041
TEST=The fact that wake_from variable is working was proved in parent
commit. So add code to fake S3 resume in a normal boot. Build and boot
grunt, verify failed S3 resume was logged. Remove fake S3 resume.
Change-Id: I77e13ff30a0ca0e9b21fca47c9b60400129365a7
Signed-off-by: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
---
M src/include/elog.h
M src/soc/amd/stoneyridge/include/soc/southbridge.h
M src/soc/amd/stoneyridge/southbridge.c
3 files changed, 20 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/27110/1
diff --git a/src/include/elog.h b/src/include/elog.h
index 0776c36..03ec9a7 100644
--- a/src/include/elog.h
+++ b/src/include/elog.h
@@ -219,6 +219,11 @@
#define ELOG_TYPE_S0IX_ENTER 0xaf
#define ELOG_TYPE_S0IX_EXIT 0xb0
+/* Detected errors */
+#define ELOG_TYPE_DETECTED_ERROR 0xb1
+#define ELOG_ERROR_S3_RESUME 0x00 /* failed resume, normal boot */
+#define ELOG_ERROR_SECURITY 0x01 /* ex: failed TPM */
+
#if IS_ENABLED(CONFIG_ELOG)
/* Eventlog backing storage must be initialized before calling elog_init(). */
extern int elog_init(void);
diff --git a/src/soc/amd/stoneyridge/include/soc/southbridge.h b/src/soc/amd/stoneyridge/include/soc/southbridge.h
index 40cf621..ac5033d 100644
--- a/src/soc/amd/stoneyridge/include/soc/southbridge.h
+++ b/src/soc/amd/stoneyridge/include/soc/southbridge.h
@@ -416,6 +416,7 @@
void xhci_pm_write32(uint8_t reg, uint32_t value);
uint32_t xhci_pm_read32(uint8_t reg);
void bootblock_fch_early_init(void);
+void sb_log_error(uint8_t error);
/**
* @brief Save the UMA bize returned by AGESA
*
diff --git a/src/soc/amd/stoneyridge/southbridge.c b/src/soc/amd/stoneyridge/southbridge.c
index 0f69e5b..651809c 100644
--- a/src/soc/amd/stoneyridge/southbridge.c
+++ b/src/soc/amd/stoneyridge/southbridge.c
@@ -514,6 +514,14 @@
pci_write_config16(SOC_LPC_DEV, ROM_ADDRESS_RANGE2_END, 0xffff);
}
+void sb_log_error(uint8_t error)
+{
+ if (!IS_ENABLED(CONFIG_ELOG))
+ return;
+
+ elog_add_event_byte(ELOG_TYPE_DETECTED_ERROR, error);
+}
+
static void sb_lpc_early_setup(void)
{
uint32_t dword;
@@ -748,8 +756,14 @@
void southbridge_final(void *chip_info)
{
+ struct soc_power_reg *sws;
uint8_t restored_power = PM_S5_AT_POWER_RECOVERY;
+ sws = cbmem_find(CBMEM_ID_POWER_STATE);
+ if (sws != NULL) {
+ if (sws->wake_from == 3)
+ sb_log_error(ELOG_ERROR_S3_RESUME);
+ }
if (IS_ENABLED(CONFIG_STONEYRIDGE_IMC_FWM)) {
agesawrapper_fchecfancontrolservice();
if (!IS_ENABLED(CONFIG_ACPI_ENABLE_THERMAL_ZONE))
--
To view, visit https://review.coreboot.org/27110
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I77e13ff30a0ca0e9b21fca47c9b60400129365a7
Gerrit-Change-Number: 27110
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
Nico Huber has uploaded a new patch set (#2). ( https://review.coreboot.org/27062 )
Change subject: gma: Turn constants depending on Config.CPU* into functions
......................................................................
gma: Turn constants depending on Config.CPU* into functions
To reduce elaboration time dependencies, turn constants at package
level into functions. This will allow us to use the same code for
configurations with constant and non-constant `GMA.Config.CPU*`.
Change-Id: I0522f5c63c63080bf9633f3d1b6019f35e52d226
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M common/hw-gfx-gma-pch-fdi.adb
M common/hw-gfx-gma-pch-vga.adb
M common/hw-gfx-gma-pch.ads
M common/ironlake/hw-gfx-gma-connectors-fdi.adb
M common/ironlake/hw-gfx-gma-pch-hdmi.adb
5 files changed, 57 insertions(+), 45 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/62/27062/2
--
To view, visit https://review.coreboot.org/27062
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0522f5c63c63080bf9633f3d1b6019f35e52d226
Gerrit-Change-Number: 27062
Gerrit-PatchSet: 2
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Nico Huber has uploaded a new patch set (#2). ( https://review.coreboot.org/27060 )
Change subject: gma config: Introduce per generation/CPU booleans
......................................................................
gma config: Introduce per generation/CPU booleans
The per CPU booleans are additionally guarded by the respective
generation so that the compiler may decide purely on the generation.
Also use the new booleans to get rid of all direct references to
`Config.CPU` and `Config.CPU_Var`.
Change-Id: I307d1dd56f480fdb4fbc6e2e25fc5f413c4158f8
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M common/haswell/hw-gfx-gma-connectors-ddi-buffers.adb
M common/hw-gfx-gma-config.ads.template
M common/hw-gfx-gma.adb
3 files changed, 137 insertions(+), 132 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/60/27060/2
--
To view, visit https://review.coreboot.org/27060
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I307d1dd56f480fdb4fbc6e2e25fc5f413c4158f8
Gerrit-Change-Number: 27060
Gerrit-PatchSet: 2
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Nico Huber has uploaded a new patch set (#2). ( https://review.coreboot.org/27059 )
Change subject: gma: Introduce Generation type
......................................................................
gma: Introduce Generation type
It's the subset of `CPU_Type` that we have different compilation units
for. Also use it in the `Config` wherever we can decide something purely
on the `Generation` (i.e. don't mix `Gen` and `CPU` in expressions).
Change-Id: I5061021a80cd75ee3d7996ca343e6388b22bf341
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M common/Makefile.inc
M common/hw-gfx-gma-config.ads.template
M common/hw-gfx-gma-config_helpers.adb
M common/hw-gfx-gma.adb
M common/hw-gfx-gma.ads
M configs/broadwell
M configs/broadwell_ult
M configs/broxton
M configs/g45
M configs/haswell
M configs/haswell_ult
M configs/ironlake
M configs/ivybridge_edp
M configs/ivybridge_lvds
M configs/sandybridge
M configs/skylake
M configs/skylake_ult
17 files changed, 67 insertions(+), 61 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/59/27059/2
--
To view, visit https://review.coreboot.org/27059
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I5061021a80cd75ee3d7996ca343e6388b22bf341
Gerrit-Change-Number: 27059
Gerrit-PatchSet: 2
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>