summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-05-15 21:44:46 -0400
committerTom Rini <trini@konsulko.com>2020-05-15 21:44:46 -0400
commit515f613253cf0a892c3a321770ab927fa3d925cf (patch)
tree8385db76a60ea1ed2c3169b71b28e438557d2725 /common
parent585da32f4cedcad5a86534f45d397f352af7da0a (diff)
parentc60f6d668dd6c439f4a88bdce3398ac05e5f8843 (diff)
Merge branch '2020-05-15-kconfig-migrations'
- Convert CONFIG_DELAY_ENVIRONMENT to Kconfig and update initr_pci to be Kconfig'd.
Diffstat (limited to 'common')
-rw-r--r--common/Kconfig10
-rw-r--r--common/board_r.c26
2 files changed, 23 insertions, 13 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 d9015cd057..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;
}
@@ -464,13 +463,14 @@ static int initr_mmc(void)
*/
static int should_load_env(void)
{
-#ifdef CONFIG_OF_CONTROL
- return fdtdec_get_config_int(gd->fdt_blob, "load-environment", 1);
-#elif defined CONFIG_DELAY_ENVIRONMENT
- return 0;
-#else
+ if (IS_ENABLED(CONFIG_OF_CONTROL))
+ return fdtdec_get_config_int(gd->fdt_blob,
+ "load-environment", 1);
+
+ if (IS_ENABLED(CONFIG_DELAY_ENVIRONMENT))
+ return 0;
+
return 1;
-#endif
}
static int initr_env(void)
@@ -480,10 +480,10 @@ static int initr_env(void)
env_relocate();
else
env_set_default(NULL, 0);
-#ifdef CONFIG_OF_CONTROL
- env_set_hex("fdtcontroladdr",
- (unsigned long)map_to_sysmem(gd->fdt_blob));
-#endif
+
+ if (IS_ENABLED(CONFIG_OF_CONTROL))
+ env_set_hex("fdtcontroladdr",
+ (unsigned long)map_to_sysmem(gd->fdt_blob));
/* Initialize from environment */
image_load_addr = env_get_ulong("loadaddr", 16, image_load_addr);