<p>Marshall Dawson has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21744">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">amd/stoneyridge: Check SMI command address before reading<br><br>Use the currently programmed address of the SMI pommand port before<br>checking the passed command.  This ensures we're reading the right<br>port in case the port was relocated without our knowledge.<br><br>Change-Id: I8a3ca285d3a9afd4a107cd471c202abf03f372ac<br>Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com><br>---<br>M src/soc/amd/stoneyridge/Makefile.inc<br>M src/soc/amd/stoneyridge/smi_util.c<br>M src/soc/amd/stoneyridge/smihandler.c<br>3 files changed, 8 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/21744/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/soc/amd/stoneyridge/Makefile.inc b/src/soc/amd/stoneyridge/Makefile.inc<br>index 28b3244..9041c46 100644<br>--- a/src/soc/amd/stoneyridge/Makefile.inc<br>+++ b/src/soc/amd/stoneyridge/Makefile.inc<br>@@ -94,6 +94,7 @@<br> smm-y += smi_util.c<br> smm-y += tsc_freq.c<br> smm-y += uart.c<br>+smm-y += southbridge.c<br> <br> CPPFLAGS_common += -I$(src)/soc/amd/stoneyridge<br> CPPFLAGS_common += -I$(src)/soc/amd/stoneyridge/include<br>diff --git a/src/soc/amd/stoneyridge/smi_util.c b/src/soc/amd/stoneyridge/smi_util.c<br>index 68e792c..833e6e3 100644<br>--- a/src/soc/amd/stoneyridge/smi_util.c<br>+++ b/src/soc/amd/stoneyridge/smi_util.c<br>@@ -6,6 +6,7 @@<br>  */<br> <br> #include <console/console.h><br>+#include <soc/southbridge.h><br> #include <soc/smi.h><br> <br> static void configure_smi(uint8_t smi_num, uint8_t mode)<br>@@ -73,3 +74,8 @@<br> {<br>   configure_smi(SMITYPE_SMI_CMD_PORT, SMI_MODE_SMI);<br> }<br>+<br>+uint16_t pm_acpi_smi_cmd_port(void)<br>+{<br>+  return pm_read16(PM_ACPI_SMI_CMD);<br>+}<br>diff --git a/src/soc/amd/stoneyridge/smihandler.c b/src/soc/amd/stoneyridge/smihandler.c<br>index 45dada5..c3c85e3 100644<br>--- a/src/soc/amd/stoneyridge/smihandler.c<br>+++ b/src/soc/amd/stoneyridge/smihandler.c<br>@@ -5,7 +5,6 @@<br>  * Subject to the GNU GPL v2, or (at your option) any later version.<br>  */<br> <br>-<br> #include <console/console.h><br> #include <cpu/x86/smm.h><br> #include <delay.h><br>@@ -27,7 +26,7 @@<br> static void sb_apmc_smi_handler(void)<br> {<br>   u32 reg32;<br>-   const uint8_t cmd = inb(APM_CNT);<br>+    const uint8_t cmd = inb(pm_acpi_smi_cmd_port());<br> <br>   switch (cmd) {<br>        case APM_CNT_ACPI_ENABLE:<br></pre><p>To view, visit <a href="https://review.coreboot.org/21744">change 21744</a>. To unsubscribe, 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/21744"/><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: I8a3ca285d3a9afd4a107cd471c202abf03f372ac </div>
<div style="display:none"> Gerrit-Change-Number: 21744 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Marshall Dawson <marshalldawson3rd@gmail.com> </div>