<p>Martin Roth has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/25635">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/amd/stoneyridge: add a romstage hook for mainboards<br><br>There wasn't previously a way for Stoney platforms to run mainboard<br>specific code in romstage.  This adds an early call for configuration<br>and passes along whether the system is currently resuming from S3.<br><br>BUG=b:77921345<br>TEST=Build, verify that weak function implementation gets called.<br><br>Change-Id: Id94855e1084814ec37956e603cd093d70f01a559<br>Signed-off-by: Martin Roth <martinroth@chromium.org><br>---<br>A src/soc/amd/stoneyridge/include/soc/romstage.h<br>M src/soc/amd/stoneyridge/romstage.c<br>2 files changed, 29 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/35/25635/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/amd/stoneyridge/include/soc/romstage.h b/src/soc/amd/stoneyridge/include/soc/romstage.h</span><br><span>new file mode 100644</span><br><span>index 0000000..af30fd9</span><br><span>--- /dev/null</span><br><span>+++ b/src/soc/amd/stoneyridge/include/soc/romstage.h</span><br><span>@@ -0,0 +1,21 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2018 Google, LLC.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU General Public License for more details.</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%);">+#ifndef __STONEYRIDGE_ROMSTAGE_H__</span><br><span style="color: hsl(120, 100%, 40%);">+#define __STONEYRIDGE_ROMSTAGE_H__</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+void mainboard_romstage_entry(int s3_resume);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#endif /* __STONEYRIDGE_ROMSTAGE_H__ */</span><br><span>diff --git a/src/soc/amd/stoneyridge/romstage.c b/src/soc/amd/stoneyridge/romstage.c</span><br><span>index cb24756..6c9726a 100644</span><br><span>--- a/src/soc/amd/stoneyridge/romstage.c</span><br><span>+++ b/src/soc/amd/stoneyridge/romstage.c</span><br><span>@@ -30,9 +30,15 @@</span><br><span> #include <amdblocks/agesawrapper.h></span><br><span> #include <amdblocks/agesawrapper_call.h></span><br><span> #include <soc/northbridge.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <soc/romstage.h></span><br><span> #include <soc/southbridge.h></span><br><span> #include <amdblocks/psp.h></span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+void __attribute__((weak)) mainboard_romstage_entry(int s3_resume)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        /* By default, don't do anything */</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> asmlinkage void car_stage_entry(void)</span><br><span> {</span><br><span>   struct postcar_frame pcf;</span><br><span>@@ -53,6 +59,8 @@</span><br><span> </span><br><span>    console_init();</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   mainboard_romstage_entry(s3_resume);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>       if (!s3_resume) {</span><br><span>            post_code(0x40);</span><br><span>             do_agesawrapper(agesawrapper_amdinitpost, "amdinitpost");</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/25635">change 25635</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/25635"/><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: Id94855e1084814ec37956e603cd093d70f01a559 </div>
<div style="display:none"> Gerrit-Change-Number: 25635 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Martin Roth <martinroth@google.com> </div>