]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spl: initialize PCI before booting
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 24 Jul 2023 20:18:41 +0000 (22:18 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 30 Jul 2023 16:53:08 +0000 (18:53 +0200)
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>
common/spl/spl.c
common/spl/spl_nvme.c

index f09bb9778148e85b09603dd82aecd18183f80bf4..0062f3f45d9a745515c2fe18d41a9a2df6f4733d 100644 (file)
@@ -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 */
index 2af63f1dc8c9b44f61d9fccf9ef2c21b97dc40db..c8774d67ecf132ae7bf81c9d5cacea47995a5be4 100644 (file)
@@ -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;