summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2018-05-15 14:07:51 +0200
committerPatrick Georgi <pgeorgi@google.com>2018-05-24 12:17:51 +0000
commit9129f1aae9dcd669dfd9a0502d7884261fa324e9 (patch)
tree27d23e85bb83f79de8a88fd1f8ad64b469491452
parent7094f4ea61a26dec4b47c0f30a8100e0887be420 (diff)
downloadcoreboot-9129f1aae9dcd669dfd9a0502d7884261fa324e9.tar.gz
coreboot-9129f1aae9dcd669dfd9a0502d7884261fa324e9.tar.bz2
coreboot-9129f1aae9dcd669dfd9a0502d7884261fa324e9.zip
device: Always build device_simple.c for less code duplication
Change-Id: Iec0a11d67d7641996f26b3a01352be762006ebb6 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/26292 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de>
-rw-r--r--src/device/Makefile.inc1
-rw-r--r--src/device/device.c2
-rw-r--r--src/device/device_util.c67
3 files changed, 1 insertions, 69 deletions
diff --git a/src/device/Makefile.inc b/src/device/Makefile.inc
index 82d4b36f1f3c..e86aa2cdfdc2 100644
--- a/src/device/Makefile.inc
+++ b/src/device/Makefile.inc
@@ -26,6 +26,7 @@ postcar-y += device_simple.c
smm-y += device_simple.c
verstage-y += device_simple.c
romstage-y += device_simple.c
+ramstage-y += device_simple.c
romstage-$(CONFIG_PCI) += pci_early.c
subdirs-y += oprom dram
diff --git a/src/device/device.c b/src/device/device.c
index 5b4c26475283..79dceaaf4f5f 100644
--- a/src/device/device.c
+++ b/src/device/device.c
@@ -51,8 +51,6 @@
#endif
#include <timer.h>
-/** Linked list of ALL devices */
-struct device *all_devices = &dev_root;
/** Pointer to the last device */
extern struct device *last_dev;
/** Linked list of free resources */
diff --git a/src/device/device_util.c b/src/device/device_util.c
index c4f5873f5b4c..3315e480fc55 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -44,73 +44,6 @@ struct device *find_dev_path(struct bus *parent, struct device_path *path)
}
/**
- * Given a PCI bus and a devfn number, find the device structure.
- *
- * @param bus The bus number.
- * @param devfn A device/function number.
- * @return Pointer to the device structure (if found), 0 otherwise.
- */
-struct device *dev_find_slot(unsigned int bus, unsigned int devfn)
-{
- struct device *dev, *result;
-
- result = 0;
- for (dev = all_devices; dev; dev = dev->next) {
- if ((dev->path.type == DEVICE_PATH_PCI) &&
- (dev->bus->secondary == bus) &&
- (dev->path.pci.devfn == devfn)) {
- result = dev;
- break;
- }
- }
- return result;
-}
-
-/**
- * Given an SMBus bus and a device number, find the device structure.
- *
- * @param bus The bus number.
- * @param addr A device number.
- * @return Pointer to the device structure (if found), 0 otherwise.
- */
-struct device *dev_find_slot_on_smbus(unsigned int bus, unsigned int addr)
-{
- struct device *dev, *result;
-
- result = 0;
- for (dev = all_devices; dev; dev = dev->next) {
- if ((dev->path.type == DEVICE_PATH_I2C) &&
- (dev->bus->secondary == bus) &&
- (dev->path.i2c.device == addr)) {
- result = dev;
- break;
- }
- }
- return result;
-}
-
-/**
- * Given a PnP port and a device number, find the device structure.
- *
- * @param port The I/O port.
- * @param device Logical device number.
- * @return Pointer to the device structure (if found), 0 otherwise.
- */
-struct device *dev_find_slot_pnp(u16 port, u16 device)
-{
- struct device *dev;
-
- for (dev = all_devices; dev; dev = dev->next) {
- if ((dev->path.type == DEVICE_PATH_PNP) &&
- (dev->path.pnp.port == port) &&
- (dev->path.pnp.device == device)) {
- return dev;
- }
- }
- return 0;
-}
-
-/**
* Given a Local APIC ID, find the device structure.
*
* @param apic_id The Local APIC ID number.