<p>Richard Spiegel has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/23574">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/amd/stoneyridge/acpi/sb_pci0_fch.asl: Fix guarded code<br><br>Remove #if statements and replace them with if(IS_ENABLED(...)) per coreboot<br>recommendations. The if conditional on CONFIG_ACPI_ENABLE_THERMAL_ZONE will<br>be moved to procedure ITZE() inside AmdImc.asl.<br><br>BUG=b:62200858<br>TEST=Build kahlee.<br><br>Change-Id: I3a518e4b76a5124d4b860d03d33878d145d0c1de<br>Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com><br>---<br>M src/soc/amd/stoneyridge/acpi/AmdImc.asl<br>M src/soc/amd/stoneyridge/acpi/sb_pci0_fch.asl<br>2 files changed, 37 insertions(+), 36 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/23574/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/amd/stoneyridge/acpi/AmdImc.asl b/src/soc/amd/stoneyridge/acpi/AmdImc.asl</span><br><span>index 519b05c..8fcdb54 100644</span><br><span>--- a/src/soc/amd/stoneyridge/acpi/AmdImc.asl</span><br><span>+++ b/src/soc/amd/stoneyridge/acpi/AmdImc.asl</span><br><span>@@ -1,7 +1,7 @@</span><br><span> /*</span><br><span>  * This file is part of the coreboot project.</span><br><span>  *</span><br><span style="color: hsl(0, 100%, 40%);">- * Copyright (C) 2015 Advanced Micro Devices, Inc.</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2015-2018 Advanced Micro Devices, Inc.</span><br><span>  *</span><br><span>  * This program is free software; you can redistribute it and/or modify</span><br><span>  * it under the terms of the GNU General Public License as published by</span><br><span>@@ -32,33 +32,38 @@</span><br><span> </span><br><span> Method(WACK, 0)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-   Store(0, Local0)</span><br><span style="color: hsl(0, 100%, 40%);">-        While (LNotEqual(Local0, 0xFA)) {</span><br><span style="color: hsl(0, 100%, 40%);">-               Store(MRG0, Local0)</span><br><span style="color: hsl(0, 100%, 40%);">-             Sleep(10)</span><br><span style="color: hsl(120, 100%, 40%);">+     if (IS_ENABLED(CONFIG_STONEYRIDGE_IMC_FWM)) {</span><br><span style="color: hsl(120, 100%, 40%);">+         Store(0, Local0)</span><br><span style="color: hsl(120, 100%, 40%);">+              While (LNotEqual(Local0, 0xFA)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     Store(MRG0, Local0)</span><br><span style="color: hsl(120, 100%, 40%);">+                   Sleep(10)</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span>    }</span><br><span> }</span><br><span> </span><br><span> //Init</span><br><span> Method (ITZE, 0)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-   Store(0, MRG0)</span><br><span style="color: hsl(0, 100%, 40%);">-  Store(0xB5, MRG1)</span><br><span style="color: hsl(0, 100%, 40%);">-       Store(0, MRG2)</span><br><span style="color: hsl(0, 100%, 40%);">-  Store(0x96, MSTI)</span><br><span style="color: hsl(0, 100%, 40%);">-       WACK()</span><br><span style="color: hsl(120, 100%, 40%);">+        if (LAnd(IS_ENABLED(CONFIG_STONEYRIDGE_IMC_FWM),</span><br><span style="color: hsl(120, 100%, 40%);">+               IS_ENABLED(CONFIG_ACPI_ENABLE_THERMAL_ZONE))) {</span><br><span style="color: hsl(120, 100%, 40%);">+              Store(0, MRG0)</span><br><span style="color: hsl(120, 100%, 40%);">+                Store(0xB5, MRG1)</span><br><span style="color: hsl(120, 100%, 40%);">+             Store(0, MRG2)</span><br><span style="color: hsl(120, 100%, 40%);">+                Store(0x96, MSTI)</span><br><span style="color: hsl(120, 100%, 40%);">+             WACK()</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      Store(0, MRG0)</span><br><span style="color: hsl(0, 100%, 40%);">-  Store(0, MRG1)</span><br><span style="color: hsl(0, 100%, 40%);">-  Store(0, MRG2)</span><br><span style="color: hsl(0, 100%, 40%);">-  Store(0x80, MSTI)</span><br><span style="color: hsl(0, 100%, 40%);">-       WACK()</span><br><span style="color: hsl(120, 100%, 40%);">+                Store(0, MRG0)</span><br><span style="color: hsl(120, 100%, 40%);">+                Store(0, MRG1)</span><br><span style="color: hsl(120, 100%, 40%);">+                Store(0, MRG2)</span><br><span style="color: hsl(120, 100%, 40%);">+                Store(0x80, MSTI)</span><br><span style="color: hsl(120, 100%, 40%);">+             WACK()</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      Or(MRG2, 0x01, Local0)</span><br><span style="color: hsl(120, 100%, 40%);">+                Or(MRG2, 0x01, Local0)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      Store(0, MRG0)</span><br><span style="color: hsl(0, 100%, 40%);">-  Store(0, MRG1)</span><br><span style="color: hsl(0, 100%, 40%);">-  Store(Local0, MRG2)</span><br><span style="color: hsl(0, 100%, 40%);">-     Store(0x81, MSTI)</span><br><span style="color: hsl(0, 100%, 40%);">-       WACK()</span><br><span style="color: hsl(120, 100%, 40%);">+                Store(0, MRG0)</span><br><span style="color: hsl(120, 100%, 40%);">+                Store(0, MRG1)</span><br><span style="color: hsl(120, 100%, 40%);">+                Store(Local0, MRG2)</span><br><span style="color: hsl(120, 100%, 40%);">+           Store(0x81, MSTI)</span><br><span style="color: hsl(120, 100%, 40%);">+             WACK()</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span> }</span><br><span>diff --git a/src/soc/amd/stoneyridge/acpi/sb_pci0_fch.asl b/src/soc/amd/stoneyridge/acpi/sb_pci0_fch.asl</span><br><span>index ad7326c..af9323c 100644</span><br><span>--- a/src/soc/amd/stoneyridge/acpi/sb_pci0_fch.asl</span><br><span>+++ b/src/soc/amd/stoneyridge/acpi/sb_pci0_fch.asl</span><br><span>@@ -1,7 +1,7 @@</span><br><span> /*</span><br><span>  * This file is part of the coreboot project.</span><br><span>  *</span><br><span style="color: hsl(0, 100%, 40%);">- * Copyright (C) 2011 Advanced Micro Devices, Inc.</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2011-2018 Advanced Micro Devices, Inc.</span><br><span>  * Copyright (C) 2013 Sage Electronic Engineering, LLC</span><br><span>  *</span><br><span>  * This program is free software; you can redistribute it and/or modify</span><br><span>@@ -130,9 +130,13 @@</span><br><span>      Return(CRES) /* note to change the Name buffer */</span><br><span> } /* end of Method(_SB.PCI0._CRS) */</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if IS_ENABLED(CONFIG_STONEYRIDGE_IMC_FWM)</span><br><span style="color: hsl(0, 100%, 40%);">- #include "acpi/AmdImc.asl"</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * You can't use if (IS_ENABLED(CONFIG_STONEYRIDGE_IMC_FWM)) outside a</span><br><span style="color: hsl(120, 100%, 40%);">+ * method, thus the file has to be permanently included and the</span><br><span style="color: hsl(120, 100%, 40%);">+ * if (IS_ENABLED(CONFIG_STONEYRIDGE_IMC_FWM)) moved to every method</span><br><span style="color: hsl(120, 100%, 40%);">+ * within the file.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+#include "acpi/AmdImc.asl"</span><br><span> </span><br><span> /*</span><br><span>  *</span><br><span>@@ -159,17 +163,9 @@</span><br><span>     /* Determine the OS we're running on */</span><br><span>  OSFL()</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/*</span><br><span style="color: hsl(0, 100%, 40%);">- * This is an ugly temporary construction part of a group of commits that</span><br><span style="color: hsl(0, 100%, 40%);">- * will remove all #if from ASL files. This message plus this temporary</span><br><span style="color: hsl(0, 100%, 40%);">- * construction will be removed in next commit from the series, its sole</span><br><span style="color: hsl(0, 100%, 40%);">- * purpose to facilitate next commit.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-#if IS_ENABLED(CONFIG_STONEYRIDGE_IMC_FWM)</span><br><span style="color: hsl(0, 100%, 40%);">-#if IS_ENABLED(CONFIG_ACPI_ENABLE_THERMAL_ZONE)</span><br><span style="color: hsl(0, 100%, 40%);">-   ITZE() /* enable IMC Fan Control*/</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(120, 100%, 40%);">+        if (IS_ENABLED(CONFIG_STONEYRIDGE_IMC_FWM)) {</span><br><span style="color: hsl(120, 100%, 40%);">+         ITZE() /* enable IMC Fan Control*/</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span> } /* End Method(_SB._INI) */</span><br><span> </span><br><span> Method(OSFL, 0){</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/23574">change 23574</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/23574"/><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: I3a518e4b76a5124d4b860d03d33878d145d0c1de </div>
<div style="display:none"> Gerrit-Change-Number: 23574 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Spiegel <richard.spiegel@silverbackltd.com> </div>