summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/Kconfig10
-rw-r--r--common/board_r.c5
2 files changed, 12 insertions, 3 deletions
diff --git a/common/Kconfig b/common/Kconfig
index 30cba15948..2d86dd7e63 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -932,6 +932,16 @@ config LAST_STAGE_INIT
U-Boot calls last_stage_init() before the command-line interpreter is
started.
+config PCI_INIT_R
+ bool "Enumerate PCI buses during init"
+ depends on PCI
+ default y if !DM_PCI
+ help
+ With this option U-Boot will call pci_init() soon after relocation,
+ which will enumerate PCI buses. This is needed, for instance, in the
+ case of DM PCI-based Ethernet devices, which will not be detected
+ without having the enumeration performed earlier.
+
endmenu
menu "Security support"
diff --git a/common/board_r.c b/common/board_r.c
index f6770f2300..96034b874e 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -232,9 +232,8 @@ static int initr_unlock_ram_in_cache(void)
#ifdef CONFIG_PCI
static int initr_pci(void)
{
-#ifndef CONFIG_DM_PCI
- pci_init();
-#endif
+ if (IS_ENABLED(CONFIG_PCI_INIT_R))
+ pci_init();
return 0;
}