<p>Marshall Dawson has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/28877">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">amd/stoneyridge: Prepare for vboot rebooting system<br><br>Implement the function vboot_platform_prepare_reboot() which is normally<br>a weak function.<br><br>The SlpTyp field of the PM1 register is not reset to its default value<br>when the APU restarts.  This change prevents a failing condition if<br>vboot decides to reset the system instead of allowing an S3 resume to<br>continue.<br><br>TEST=Resume Grunt when vboot attempts a reset, verify a fresh boot instead<br>BUG=b:117089826<br><br>Change-Id: I6e0e3e541bad89ca5b23d6ddb6e5c0df7f762f10<br>Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com><br>---<br>M src/soc/amd/stoneyridge/pmutil.c<br>1 file changed, 12 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/28877/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/amd/stoneyridge/pmutil.c b/src/soc/amd/stoneyridge/pmutil.c</span><br><span>index baabba5..2d603d0 100644</span><br><span>--- a/src/soc/amd/stoneyridge/pmutil.c</span><br><span>+++ b/src/soc/amd/stoneyridge/pmutil.c</span><br><span>@@ -32,3 +32,15 @@</span><br><span> </span><br><span>       return acpi_sleep_from_pm1(inw(pm_acpi_pm_cnt_blk())) == ACPI_S3;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* If vboot requests a system reset, modify the PM1 register so it will never be</span><br><span style="color: hsl(120, 100%, 40%);">+ * misinterpreted as an S3 resume. */</span><br><span style="color: hsl(120, 100%, 40%);">+void vboot_platform_prepare_reboot(void)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        uint32_t pm1;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       pm1 = inw(pm_acpi_pm_cnt_blk());</span><br><span style="color: hsl(120, 100%, 40%);">+      pm1 &= ~SLP_TYP;</span><br><span style="color: hsl(120, 100%, 40%);">+  pm1 |= SLP_TYP_S5 << SLP_TYP_SHIFT;</span><br><span style="color: hsl(120, 100%, 40%);">+     outw(pm1, pm_acpi_pm_cnt_blk());</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/28877">change 28877</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/28877"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I6e0e3e541bad89ca5b23d6ddb6e5c0df7f762f10 </div>
<div style="display:none"> Gerrit-Change-Number: 28877 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Marshall Dawson <marshalldawson3rd@gmail.com> </div>