aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-07-24 22:18:41 +0200
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-07-30 18:53:08 +0200
commit7d4c8cfe2547596d07c51b2f38cde8d4c75f17fc (patch)
tree772d0829c3ec68135a399efb229b29f964fc920b
parent8d2c311ce64939fe829037e4ef7951c3fafaee06 (diff)
downloadu-boot-7d4c8cfe2547596d07c51b2f38cde8d4c75f17fc.zip
u-boot-7d4c8cfe2547596d07c51b2f38cde8d4c75f17fc.tar.gz
u-boot-7d4c8cfe2547596d07c51b2f38cde8d4c75f17fc.tar.bz2
spl: initialize PCI before booting
MMC, SATA, and USB may be using PCI based controllers. Initialize the PCI sub-system before trying to boot. Remove the initialization for NVMe that is now redundant. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Mayuresh Chitale <mchitale@ventanamicro.com>
-rw-r--r--common/spl/spl.c7
-rw-r--r--common/spl/spl_nvme.c5
2 files changed, 7 insertions, 5 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index f09bb97..0062f3f 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -800,6 +800,13 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
IS_ENABLED(CONFIG_SPL_ATF))
dram_init_banksize();
+ if (CONFIG_IS_ENABLED(PCI)) {
+ ret = pci_init();
+ if (ret)
+ puts(SPL_TPL_PROMPT "Cannot initialize PCI\n");
+ /* Don't fail. We still can try other boot methods. */
+ }
+
bootcount_inc();
/* Dump driver model states to aid analysis */
diff --git a/common/spl/spl_nvme.c b/common/spl/spl_nvme.c
index 2af63f1..c8774d6 100644
--- a/common/spl/spl_nvme.c
+++ b/common/spl/spl_nvme.c
@@ -7,7 +7,6 @@
#include <common.h>
#include <spl.h>
-#include <init.h>
#include <nvme.h>
static int spl_nvme_load_image(struct spl_image_info *spl_image,
@@ -15,10 +14,6 @@ static int spl_nvme_load_image(struct spl_image_info *spl_image,
{
int ret;
- ret = pci_init();
- if (ret < 0)
- return ret;
-
ret = nvme_scan_namespace();
if (ret < 0)
return ret;