<p>Patrick Rudolph has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/c/coreboot/+/30290">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/intel/fsp_broadwell_de/romstage: Workaround broken platform state<br><br>Sometimes the platform boots in an invalid state, that will cause<br>FSP-M to fail. As a board_reset() doesn't fix it, issue an full_reset()<br>as soon as the IA32_FEATURE_CONTROL MSR is locked at beging of romstage.<br><br>Tested on wedge100s. After full reset the system behaves as normal.<br><br>Change-Id: I1a382b8fb650311b0c24b48e0986d22edfa2d261<br>Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com><br>---<br>M src/soc/intel/fsp_broadwell_de/romstage/romstage.c<br>1 file changed, 16 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/90/30290/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/intel/fsp_broadwell_de/romstage/romstage.c b/src/soc/intel/fsp_broadwell_de/romstage/romstage.c</span><br><span>index 801f9e0..453f7c7 100644</span><br><span>--- a/src/soc/intel/fsp_broadwell_de/romstage/romstage.c</span><br><span>+++ b/src/soc/intel/fsp_broadwell_de/romstage/romstage.c</span><br><span>@@ -34,6 +34,7 @@</span><br><span> #include <soc/romstage.h></span><br><span> #include <soc/gpio.h></span><br><span> #include <build.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <cf9_reset.h></span><br><span> </span><br><span> static void init_rtc(void)</span><br><span> {</span><br><span>@@ -68,6 +69,21 @@</span><br><span>                                       LPC_EN, 0x340f);</span><br><span>  }</span><br><span>    console_init();</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     /*</span><br><span style="color: hsl(120, 100%, 40%);">+     * Sometimes the system boots in an invalid state, where random values</span><br><span style="color: hsl(120, 100%, 40%);">+         * have been written to MSRs and then the MSRs are locked.</span><br><span style="color: hsl(120, 100%, 40%);">+     * Seems to always happen on warm reset.</span><br><span style="color: hsl(120, 100%, 40%);">+       *</span><br><span style="color: hsl(120, 100%, 40%);">+     * Power cycling or a board_reset() isn't sufficient in this case, so</span><br><span style="color: hsl(120, 100%, 40%);">+      * issue a full_reset() to "fix" this issue.</span><br><span style="color: hsl(120, 100%, 40%);">+         */</span><br><span style="color: hsl(120, 100%, 40%);">+   msr_t msr = rdmsr(IA32_FEATURE_CONTROL);</span><br><span style="color: hsl(120, 100%, 40%);">+      if (msr.lo & 1) {</span><br><span style="color: hsl(120, 100%, 40%);">+         printk(BIOS_EMERG, "Detected broken platform state. Issuing full reset\n");</span><br><span style="color: hsl(120, 100%, 40%);">+         full_reset();</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  init_rtc();</span><br><span>  setup_gpio_io_address();</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/c/coreboot/+/30290">change 30290</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/c/coreboot/+/30290"/><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-Change-Id: I1a382b8fb650311b0c24b48e0986d22edfa2d261 </div>
<div style="display:none"> Gerrit-Change-Number: 30290 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Rudolph <patrick.rudolph@9elements.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>