Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/25723
Change subject: pci: Fixes to remove remaining simple device functions ......................................................................
pci: Fixes to remove remaining simple device functions
* Move function prototypes * Guard function with preprocessor directives * Only build pci_early on x86
Fixes build on non x86.
Change-Id: I71d6f82367e907732944ac5dfaabfa77181c5f20 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/device/Makefile.inc M src/device/pci_device.c M src/include/device/pci.h 3 files changed, 9 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/25723/1
diff --git a/src/device/Makefile.inc b/src/device/Makefile.inc index af5e7a9..7d2286a 100644 --- a/src/device/Makefile.inc +++ b/src/device/Makefile.inc @@ -12,8 +12,11 @@ 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_PCI) += pci_early.c ramstage-$(CONFIG_PCI) += pci_rom.c +#ifeq ($(CONFIG_PCI),y) +ramstage-$(CONFIG_ARCH_X86) += pci_early.c +romstage-$(CONFIG_ARCH_X86) += pci_early.c +#endif ramstage-y += smbus_ops.c
ifeq ($(CONFIG_AZALIA_PLUGIN_SUPPORT),y) @@ -25,7 +28,6 @@ smm-y += device_simple.c verstage-y += device_simple.c romstage-y += device_simple.c -romstage-$(CONFIG_PCI) += pci_early.c
subdirs-y += oprom dram
diff --git a/src/device/pci_device.c b/src/device/pci_device.c index 539c2a3..9ccdea3 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -1088,6 +1088,7 @@ return dev; }
+#if IS_ENABLED(CONFIG_ARCH_X86) /** * Test for match between romstage and ramstage device instance. * @@ -1100,6 +1101,7 @@ return dev->bus->secondary == PCI_DEV2SEGBUS(sdev) && dev->path.pci.devfn == PCI_DEV2DEVFN(sdev); } +#endif
/** * Scan a PCI bus. diff --git a/src/include/device/pci.h b/src/include/device/pci.h index 284ad69..8c27c70 100644 --- a/src/include/device/pci.h +++ b/src/include/device/pci.h @@ -80,7 +80,7 @@ struct device *pci_probe_dev(struct device *dev, struct bus *bus, unsigned int devfn);
-void do_pci_scan_bridge(device_t bus, +void do_pci_scan_bridge(struct device *dev, void (*do_scan_bus)(struct bus *bus, unsigned int min_devfn, unsigned int max_devfn));
@@ -95,7 +95,6 @@ void pci_dev_set_subsystem(struct device *dev, unsigned int vendor, unsigned int device); void pci_dev_init(struct device *dev); -unsigned int pci_match_simple_dev(struct device *dev, pci_devfn_t sdev);
const char *pin_to_str(int pin); int get_pci_irq_pins(struct device *dev, struct device **parent_bdg); @@ -117,6 +116,8 @@ }
#ifdef __SIMPLE_DEVICE__ +unsigned int pci_match_simple_dev(struct device *dev, pci_devfn_t sdev); + unsigned int pci_find_next_capability(pci_devfn_t dev, unsigned int cap, unsigned int last); unsigned int pci_find_capability(pci_devfn_t dev, unsigned int cap);