[coreboot-gerrit] Change in coreboot[master]: amd/stoneyridge: Prepare for vboot rebooting system

Marshall Dawson (Code Review) gerrit at coreboot.org
Tue Oct 2 17:32:13 CEST 2018


Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/28877


Change subject: amd/stoneyridge: Prepare for vboot rebooting system
......................................................................

amd/stoneyridge: Prepare for vboot rebooting system

Implement the function vboot_platform_prepare_reboot() which is normally
a weak function.

The SlpTyp field of the PM1 register is not reset to its default value
when the APU restarts.  This change prevents a failing condition if
vboot decides to reset the system instead of allowing an S3 resume to
continue.

TEST=Resume Grunt when vboot attempts a reset, verify a fresh boot instead
BUG=b:117089826

Change-Id: I6e0e3e541bad89ca5b23d6ddb6e5c0df7f762f10
Signed-off-by: Marshall Dawson <marshalldawson3rd at gmail.com>
---
M src/soc/amd/stoneyridge/pmutil.c
1 file changed, 12 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/28877/1

diff --git a/src/soc/amd/stoneyridge/pmutil.c b/src/soc/amd/stoneyridge/pmutil.c
index baabba5..2d603d0 100644
--- a/src/soc/amd/stoneyridge/pmutil.c
+++ b/src/soc/amd/stoneyridge/pmutil.c
@@ -32,3 +32,15 @@
 
 	return acpi_sleep_from_pm1(inw(pm_acpi_pm_cnt_blk())) == ACPI_S3;
 }
+
+/* If vboot requests a system reset, modify the PM1 register so it will never be
+ * misinterpreted as an S3 resume. */
+void vboot_platform_prepare_reboot(void)
+{
+	uint32_t pm1;
+
+	pm1 = inw(pm_acpi_pm_cnt_blk());
+	pm1 &= ~SLP_TYP;
+	pm1 |= SLP_TYP_S5 << SLP_TYP_SHIFT;
+	outw(pm1, pm_acpi_pm_cnt_blk());
+}

-- 
To view, visit https://review.coreboot.org/28877
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: I6e0e3e541bad89ca5b23d6ddb6e5c0df7f762f10
Gerrit-Change-Number: 28877
Gerrit-PatchSet: 1
Gerrit-Owner: Marshall Dawson <marshalldawson3rd at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181002/24dd80a4/attachment-0001.html>


More information about the coreboot-gerrit mailing list