<p>Marshall Dawson has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/23724">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">amd/stoneyridge: Move model_15_init.c to cpu.c<br><br>Move the remaining model_15_init.c functionality to cpu.c, making it<br>similar to other soc implementations.<br><br>Change-Id: Ic8c62b09209fcdaa50ff8ffc7773ef155f979a1b<br>Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com><br>---<br>M src/soc/amd/stoneyridge/Makefile.inc<br>M src/soc/amd/stoneyridge/cpu.c<br>D src/soc/amd/stoneyridge/model_15_init.c<br>3 files changed, 31 insertions(+), 60 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/23724/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/amd/stoneyridge/Makefile.inc b/src/soc/amd/stoneyridge/Makefile.inc</span><br><span>index 59405de..aae30ea 100644</span><br><span>--- a/src/soc/amd/stoneyridge/Makefile.inc</span><br><span>+++ b/src/soc/amd/stoneyridge/Makefile.inc</span><br><span>@@ -92,7 +92,6 @@</span><br><span> ramstage-y += sb_util.c</span><br><span> ramstage-$(CONFIG_STONEYRIDGE_IMC_FWM) += imc.c</span><br><span> ramstage-y += lpc.c</span><br><span style="color: hsl(0, 100%, 40%);">-ramstage-y += model_15_init.c</span><br><span> ramstage-y += northbridge.c</span><br><span> ramstage-y += pmutil.c</span><br><span> ramstage-y += reset.c</span><br><span>diff --git a/src/soc/amd/stoneyridge/cpu.c b/src/soc/amd/stoneyridge/cpu.c</span><br><span>index 5042cbc..14b6881 100644</span><br><span>--- a/src/soc/amd/stoneyridge/cpu.c</span><br><span>+++ b/src/soc/amd/stoneyridge/cpu.c</span><br><span>@@ -18,6 +18,7 @@</span><br><span> #include <cpu/x86/mp.h></span><br><span> #include <cpu/x86/mtrr.h></span><br><span> #include <cpu/x86/msr.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <cpu/x86/lapic.h></span><br><span> #include <cpu/amd/amdfam15.h></span><br><span> #include <device/device.h></span><br><span> #include <soc/pci_devs.h></span><br><span>@@ -113,3 +114,33 @@</span><br><span>        if (mp_init_with_smm(dev->link_list, &mp_ops) < 0)</span><br><span>                 printk(BIOS_ERR, "MP initialization failure.\n");</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static void model_15_init(device_t dev)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        printk(BIOS_DEBUG, "Model 15 Init.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   int i;</span><br><span style="color: hsl(120, 100%, 40%);">+        msr_t msr;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* zero the machine check error status registers */</span><br><span style="color: hsl(120, 100%, 40%);">+   msr.lo = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+   msr.hi = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+   for (i = 0 ; i < 6 ; i++)</span><br><span style="color: hsl(120, 100%, 40%);">+          wrmsr(MCI_STATUS + (i * 4), msr);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   setup_lapic();</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%);">+static struct device_operations cpu_dev_ops = {</span><br><span style="color: hsl(120, 100%, 40%);">+  .init = model_15_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%);">+static struct cpu_device_id cpu_table[] = {</span><br><span style="color: hsl(120, 100%, 40%);">+     { X86_VENDOR_AMD, 0x670f00 },</span><br><span style="color: hsl(120, 100%, 40%);">+ { 0, 0 },</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%);">+static const struct cpu_driver model_15 __cpu_driver = {</span><br><span style="color: hsl(120, 100%, 40%);">+     .ops      = &cpu_dev_ops,</span><br><span style="color: hsl(120, 100%, 40%);">+ .id_table = cpu_table,</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span>diff --git a/src/soc/amd/stoneyridge/model_15_init.c b/src/soc/amd/stoneyridge/model_15_init.c</span><br><span>deleted file mode 100644</span><br><span>index 83fadd0..0000000</span><br><span>--- a/src/soc/amd/stoneyridge/model_15_init.c</span><br><span>+++ /dev/null</span><br><span>@@ -1,59 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-/*</span><br><span style="color: hsl(0, 100%, 40%);">- * This file is part of the coreboot project.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * Copyright (C) 2015-2016 Advanced Micro Devices, Inc.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(0, 100%, 40%);">- * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(0, 100%, 40%);">- * the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(0, 100%, 40%);">- * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(0, 100%, 40%);">- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(0, 100%, 40%);">- * GNU General Public License for more details.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#include <console/console.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <cpu/x86/lapic.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <cpu/x86/msr.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <device/device.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <device/pci.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <string.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <cpu/x86/msr.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <cpu/x86/pae.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <pc80/mc146818rtc.h></span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#include <cpu/cpu.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <cpu/x86/cache.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <cpu/amd/amdfam15.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <arch/acpi.h></span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static void model_15_init(device_t dev)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-       printk(BIOS_DEBUG, "Model 15 Init.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       int i;</span><br><span style="color: hsl(0, 100%, 40%);">-  msr_t msr;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      /* zero the machine check error status registers */</span><br><span style="color: hsl(0, 100%, 40%);">-     msr.lo = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-     msr.hi = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-     for (i = 0 ; i < 6 ; i++)</span><br><span style="color: hsl(0, 100%, 40%);">-            wrmsr(MCI_STATUS + (i * 4), msr);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       setup_lapic();</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static struct device_operations cpu_dev_ops = {</span><br><span style="color: hsl(0, 100%, 40%);">-  .init = model_15_init,</span><br><span style="color: hsl(0, 100%, 40%);">-};</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static const struct cpu_device_id cpu_table[] = {</span><br><span style="color: hsl(0, 100%, 40%);">-       { X86_VENDOR_AMD, 0x670f00 },</span><br><span style="color: hsl(0, 100%, 40%);">-   { 0, 0 },</span><br><span style="color: hsl(0, 100%, 40%);">-};</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static const struct cpu_driver model_15 __cpu_driver = {</span><br><span style="color: hsl(0, 100%, 40%);">-     .ops      = &cpu_dev_ops,</span><br><span style="color: hsl(0, 100%, 40%);">-   .id_table = cpu_table,</span><br><span style="color: hsl(0, 100%, 40%);">-};</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/23724">change 23724</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/23724"/><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: Ic8c62b09209fcdaa50ff8ffc7773ef155f979a1b </div>
<div style="display:none"> Gerrit-Change-Number: 23724 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Marshall Dawson <marshalldawson3rd@gmail.com> </div>