<p>Patrick Rudolph has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/25724">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pci: Fix MMCONF_SUPPORT on non x86<br><br>Move x86 specific pci_bus_default_ops into arch/x86 folder.<br>Fixes compilation on platforms that do neither have MMCONF_SUPPORT<br>nor NO_MMCONF_SUPPORT.<br><br>Change-Id: I0991ab00c9a56b23cd012dd2b8b861f9737a9e9c<br>Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com><br>---<br>M src/arch/x86/Makefile.inc<br>M src/arch/x86/include/arch/pci_ops.h<br>A src/arch/x86/pci_ops.c<br>M src/device/pci_ops.c<br>M src/include/device/pci_ops.h<br>5 files changed, 34 insertions(+), 7 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/25724/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc</span><br><span>index cc529b2..ef9abe8 100644</span><br><span>--- a/src/arch/x86/Makefile.inc</span><br><span>+++ b/src/arch/x86/Makefile.inc</span><br><span>@@ -332,6 +332,7 @@</span><br><span> ramstage-$(CONFIG_X86_TOP4G_BOOTMEDIA_MAP) += mmap_boot.c</span><br><span> ramstage-$(CONFIG_GENERATE_MP_TABLE) += mpspec.c</span><br><span> ramstage-y += pci_ops_conf1.c</span><br><span style="color: hsl(120, 100%, 40%);">+ramstage-y += pci_ops.c</span><br><span> ramstage-$(CONFIG_MMCONF_SUPPORT) += pci_ops_mmconf.c</span><br><span> ramstage-$(CONFIG_GENERATE_PIRQ_TABLE) += pirq_routing.c</span><br><span> ramstage-y += rdrand.c</span><br><span>diff --git a/src/arch/x86/include/arch/pci_ops.h b/src/arch/x86/include/arch/pci_ops.h</span><br><span>index 1b245aa..678edbb 100644</span><br><span>--- a/src/arch/x86/include/arch/pci_ops.h</span><br><span>+++ b/src/arch/x86/include/arch/pci_ops.h</span><br><span>@@ -19,8 +19,6 @@</span><br><span> extern const struct pci_bus_operations pci_cf8_conf1;</span><br><span> extern const struct pci_bus_operations pci_ops_mmconf;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-const struct pci_bus_operations *pci_bus_default_ops(device_t dev);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> #endif</span><br><span> </span><br><span> #endif /* ARCH_I386_PCI_OPS_H */</span><br><span>diff --git a/src/arch/x86/pci_ops.c b/src/arch/x86/pci_ops.c</span><br><span>new file mode 100644</span><br><span>index 0000000..85f7391</span><br><span>--- /dev/null</span><br><span>+++ b/src/arch/x86/pci_ops.c</span><br><span>@@ -0,0 +1,28 @@</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 2018-present Facebook, Inc.</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%);">+#include <device/device.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <device/pci_ops.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+const struct pci_bus_operations *pci_bus_default_ops(device_t dev)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+#if IS_ENABLED(CONFIG_MMCONF_SUPPORT)</span><br><span style="color: hsl(120, 100%, 40%);">+     return &pci_ops_mmconf;</span><br><span style="color: hsl(120, 100%, 40%);">+#elif IS_ENABLED(CONFIG_NO_MMCONF_SUPPORT)</span><br><span style="color: hsl(120, 100%, 40%);">+       return &pci_cf8_conf1;</span><br><span style="color: hsl(120, 100%, 40%);">+#else</span><br><span style="color: hsl(120, 100%, 40%);">+     return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/src/device/pci_ops.c b/src/device/pci_ops.c</span><br><span>index b6fc32d..64e50bf 100644</span><br><span>--- a/src/device/pci_ops.c</span><br><span>+++ b/src/device/pci_ops.c</span><br><span>@@ -20,12 +20,10 @@</span><br><span> #include <device/pci_ids.h></span><br><span> #include <device/pci_ops.h></span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-const struct pci_bus_operations *pci_bus_default_ops(device_t dev)</span><br><span style="color: hsl(120, 100%, 40%);">+const struct pci_bus_operations __attribute__((weak))</span><br><span style="color: hsl(120, 100%, 40%);">+*pci_bus_default_ops(device_t dev)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-      if (IS_ENABLED(CONFIG_NO_MMCONF_SUPPORT))</span><br><span style="color: hsl(0, 100%, 40%);">-               return &pci_cf8_conf1;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      return &pci_ops_mmconf;</span><br><span style="color: hsl(120, 100%, 40%);">+   return NULL;</span><br><span> }</span><br><span> </span><br><span> static const struct pci_bus_operations *pci_bus_ops(struct bus *bus, struct device *dev)</span><br><span>diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h</span><br><span>index 3310e10..3a44824 100644</span><br><span>--- a/src/include/device/pci_ops.h</span><br><span>+++ b/src/include/device/pci_ops.h</span><br><span>@@ -15,4 +15,6 @@</span><br><span> </span><br><span> #endif</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+const struct pci_bus_operations *pci_bus_default_ops(device_t dev);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> #endif /* PCI_OPS_H */</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/25724">change 25724</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/25724"/><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: I0991ab00c9a56b23cd012dd2b8b861f9737a9e9c </div>
<div style="display:none"> Gerrit-Change-Number: 25724 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Rudolph <patrick.rudolph@9elements.com> </div>