[coreboot-gerrit] Change in coreboot[master]: Move `pci_ops_mmconf` from arch/x86/ to device/

Nico Huber (Code Review) gerrit at coreboot.org
Fri May 4 16:30:55 CEST 2018


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/26062


Change subject: Move `pci_ops_mmconf` from arch/x86/ to device/
......................................................................

Move `pci_ops_mmconf` from arch/x86/ to device/

MMConf is not architecture specific. We also always provide a
pci_bus_default_ops() now if MMCONF_SUPPORT is selected.

Change-Id: I3f9b403da29d3fa81914cc1519710ba7d1bf2bb5
Signed-off-by: Nico Huber <nico.huber at secunet.com>
---
M src/arch/x86/Makefile.inc
M src/arch/x86/include/arch/pci_ops.h
M src/arch/x86/pci_ops.c
M src/device/Makefile.inc
R src/device/pci_ops_mmconf.c
M src/include/device/pci_ops.h
6 files changed, 11 insertions(+), 7 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/26062/1

diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index df054f8..f94e547 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -346,8 +346,7 @@
 ramstage-$(CONFIG_X86_TOP4G_BOOTMEDIA_MAP) += mmap_boot.c
 ramstage-$(CONFIG_GENERATE_MP_TABLE) += mpspec.c
 ramstage-y += pci_ops_conf1.c
-ramstage-y += pci_ops.c
-ramstage-$(CONFIG_MMCONF_SUPPORT) += pci_ops_mmconf.c
+ramstage-$(CONFIG_NO_MMCONF_SUPPORT) += pci_ops.c
 ramstage-$(CONFIG_GENERATE_PIRQ_TABLE) += pirq_routing.c
 ramstage-y += rdrand.c
 ramstage-$(CONFIG_GENERATE_SMBIOS_TABLES) += smbios.c
diff --git a/src/arch/x86/include/arch/pci_ops.h b/src/arch/x86/include/arch/pci_ops.h
index 678edbb..3f1515e 100644
--- a/src/arch/x86/include/arch/pci_ops.h
+++ b/src/arch/x86/include/arch/pci_ops.h
@@ -17,7 +17,6 @@
 #ifndef __SIMPLE_DEVICE__
 
 extern const struct pci_bus_operations pci_cf8_conf1;
-extern const struct pci_bus_operations pci_ops_mmconf;
 
 #endif
 
diff --git a/src/arch/x86/pci_ops.c b/src/arch/x86/pci_ops.c
index 4fd916c..82f9fd2 100644
--- a/src/arch/x86/pci_ops.c
+++ b/src/arch/x86/pci_ops.c
@@ -18,8 +18,5 @@
 
 const struct pci_bus_operations *pci_bus_default_ops(struct device *dev)
 {
-	if (IS_ENABLED(CONFIG_NO_MMCONF_SUPPORT))
-		return &pci_cf8_conf1;
-
-	return &pci_ops_mmconf;
+	return &pci_cf8_conf1;
 }
diff --git a/src/device/Makefile.inc b/src/device/Makefile.inc
index af5e7a9..82d4b36 100644
--- a/src/device/Makefile.inc
+++ b/src/device/Makefile.inc
@@ -12,6 +12,7 @@
 ramstage-$(CONFIG_ARCH_RAMSTAGE_X86_32) += pnp_device.c
 ramstage-$(CONFIG_ARCH_RAMSTAGE_X86_64) += pnp_device.c
 ramstage-$(CONFIG_PCI) += pci_ops.c
+ramstage-$(CONFIG_MMCONF_SUPPORT) += pci_ops_mmconf.c
 ramstage-$(CONFIG_PCI) += pci_early.c
 ramstage-$(CONFIG_PCI) += pci_rom.c
 ramstage-y += smbus_ops.c
diff --git a/src/arch/x86/pci_ops_mmconf.c b/src/device/pci_ops_mmconf.c
similarity index 95%
rename from src/arch/x86/pci_ops_mmconf.c
rename to src/device/pci_ops_mmconf.c
index cf08e17..8a013dd 100644
--- a/src/arch/x86/pci_ops_mmconf.c
+++ b/src/device/pci_ops_mmconf.c
@@ -71,3 +71,8 @@
 	.write16 = pci_mmconf_write_config16,
 	.write32 = pci_mmconf_write_config32,
 };
+
+const struct pci_bus_operations *pci_bus_default_ops(struct device *dev)
+{
+	return &pci_ops_mmconf;
+}
diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h
index 2518f20..b79dbe5 100644
--- a/src/include/device/pci_ops.h
+++ b/src/include/device/pci_ops.h
@@ -6,6 +6,9 @@
 #include <arch/pci_ops.h>
 
 #ifndef __SIMPLE_DEVICE__
+
+extern const struct pci_bus_operations pci_ops_mmconf;
+
 u8 pci_read_config8(struct device *dev, unsigned int where);
 u16 pci_read_config16(struct device *dev, unsigned int where);
 u32 pci_read_config32(struct device *dev, unsigned int where);

-- 
To view, visit https://review.coreboot.org/26062
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f9b403da29d3fa81914cc1519710ba7d1bf2bb5
Gerrit-Change-Number: 26062
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180504/4c19da36/attachment.html>


More information about the coreboot-gerrit mailing list