summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/conf/GENERIC3
-rw-r--r--src/sys/io/pci/pci.c14
2 files changed, 15 insertions, 2 deletions
diff --git a/src/sys/conf/GENERIC b/src/sys/conf/GENERIC
index 816ece3..a667a78 100644
--- a/src/sys/conf/GENERIC
+++ b/src/sys/conf/GENERIC
@@ -1 +1,4 @@
option DUMP_MEMMAP yes // Dump memory map on boot
+
+// PCI switches and knobs
+setval PCI_MAX_BUS 8 // Max buses to scan on boot
diff --git a/src/sys/io/pci/pci.c b/src/sys/io/pci/pci.c
index ba96670..fcb5a8b 100644
--- a/src/sys/io/pci/pci.c
+++ b/src/sys/io/pci/pci.c
@@ -35,7 +35,14 @@
#include <io/pci/pci.h>
#include <io/pci/cam.h>
-#define PCI_BUS_ROOT 0
+#if defined(__PCI_MAX_BUS)
+#define PCI_MAX_BUS __PCI_MAX_BUS
+#if PCI_MAX_BUS > 256
+#error "PCI_MAX_BUS must be <= 256"
+#endif /* PCI_MAX_BUS */
+#else
+#define PCI_MAX_BUS 1
+#endif /* __PCI_MAX_BUS */
static struct cam_hook cam;
@@ -160,5 +167,8 @@ pci_init_bus(void)
panic("pci_init_bus: failed to init CAM\n");
}
- pci_enum_bus(PCI_BUS_ROOT);
+ printf("pci: enumerating %d buses\n", PCI_MAX_BUS);
+ for (int i = 0; i < PCI_MAX_BUS; ++i) {
+ pci_enum_bus(i);
+ }
}