summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Smith <smithbone@gmail.com>2006-04-23 23:12:21 +0000
committerRichard Smith <smithbone@gmail.com>2006-04-23 23:12:21 +0000
commit2a7352cb9dd7211c9a7edbef5145dd59df264644 (patch)
treefd50995bb28ef91e18abfb3fa833f1eb2e07c1f8 /src
parent2f1980026865af7b11f27257c36b61d897932186 (diff)
downloadcoreboot-2a7352cb9dd7211c9a7edbef5145dd59df264644.tar.xz
Adds a CONFIG_MAX_PCI_BUSES to pci_locate_device()
Default is 255. This allows mainboard configs for working across various groups of boards that differ a device that may not loaded. If you search for a device that is not loaded and max buses is 255 then there can be up to a 8 second delay to search the entire PCI space. Board configs that know thier max bus can limit this search space. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2273 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src')
-rw-r--r--src/arch/i386/include/arch/romcc_io.h2
-rw-r--r--src/config/Options.lb5
-rw-r--r--src/mainboard/via/epia-m/Options.lb10
3 files changed, 16 insertions, 1 deletions
diff --git a/src/arch/i386/include/arch/romcc_io.h b/src/arch/i386/include/arch/romcc_io.h
index adda3f8ef8..983835a093 100644
--- a/src/arch/i386/include/arch/romcc_io.h
+++ b/src/arch/i386/include/arch/romcc_io.h
@@ -168,7 +168,7 @@ static inline __attribute__((always_inline)) void pci_write_config32(device_t de
#define PCI_DEV_INVALID (0xffffffffU)
static device_t pci_locate_device(unsigned pci_id, device_t dev)
{
- for(; dev <= PCI_DEV(255, 31, 7); dev += PCI_DEV(0,0,1)) {
+ for(; dev <= PCI_DEV(CONFIG_MAX_PCI_BUSES, 31, 7); dev += PCI_DEV(0,0,1)) {
unsigned int id;
id = pci_read_config32(dev, 0);
if (id == pci_id) {
diff --git a/src/config/Options.lb b/src/config/Options.lb
index 1342366fe9..2f3d8dd1c0 100644
--- a/src/config/Options.lb
+++ b/src/config/Options.lb
@@ -490,6 +490,11 @@ define CONFIG_SYS_CLK_FREQ
export used
comment "System clock frequency in MHz"
end
+define CONFIG_MAX_PCI_BUSES
+ default 255
+ export always
+ comment "Maximum number of PCI buses to search for devices"
+end
###############################################
# SMP options
###############################################
diff --git a/src/mainboard/via/epia-m/Options.lb b/src/mainboard/via/epia-m/Options.lb
index 6c3193e78d..735d4421a0 100644
--- a/src/mainboard/via/epia-m/Options.lb
+++ b/src/mainboard/via/epia-m/Options.lb
@@ -38,6 +38,7 @@ uses CONFIG_CONSOLE_SERIAL8250
uses CONFIG_UDELAY_TSC
uses CONFIG_PCI_ROM_RUN
uses CONFIG_CONSOLE_VGA
+uses CONFIG_MAX_PCI_BUSES
## ROM_SIZE is the size of boot ROM that this board will use.
default ROM_SIZE = 256*1024
@@ -121,5 +122,14 @@ default CROSS_COMPILE=""
default CC="$(CROSS_COMPILE)gcc -m32"
default HOSTCC="gcc"
+##
+## Set this to the max PCI bus number you
+## would ever use for PCI config IO.
+## Setting this number very high will make
+## pci_locate_device take a long time when
+## it can't find a device.
+##
+default CONFIG_MAX_PCI_BUSES = 5
+
end