From 4187747e4da8e25fccbac4af99d7b81abd11ae83 Mon Sep 17 00:00:00 2001 From: Dmitriy Korovkin Date: Mon, 25 May 2015 17:42:40 -0400 Subject: [PATCH] List PCI devices after console initialized. In order to display PCI devices, make sure console is initialized and list all the devices. Change-Id: Ia7f47e58cee1a0da0ee1f86d9229a3e23e7a0dbb Signed-off-by: Dmitriy Korovkin --- arch/x86/quark/system.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/x86/quark/system.c b/arch/x86/quark/system.c index 30c12ccda57..a97b8384903 100644 --- a/arch/x86/quark/system.c +++ b/arch/x86/quark/system.c @@ -48,6 +48,8 @@ Handlers for the secondary serial port have not been added. #include #include #include +#include +#include #if defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE) #define DO_CONSOLE_INIT @@ -122,6 +124,20 @@ void _InitHardware(void) consoleInit(); /* NOP if not needed */ #ifdef PCI_DEBUG - pci_show(); -#endif /* PCI_DEBUG */ + /* Rescan PCI and display the list of PCI attached devices */ + struct pci_dev_info info = { + .bar = PCI_BAR_ANY, + }; + + pci_bus_scan_init(); + + while (pci_bus_scan(&info)) + { + pci_show(&info); + info.class = 0; + info.vendor_id = 0; + info.device_id = 0; + info.bar = PCI_BAR_ANY; + } +#endif /* PCI_DEBUG */ }