]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
env: fat: Add support for NVME
authorFabio Estevam <festevam@gmail.com>
Tue, 12 Aug 2025 17:46:10 +0000 (14:46 -0300)
committerTom Rini <trini@konsulko.com>
Wed, 20 Aug 2025 21:05:31 +0000 (15:05 -0600)
Add support for retrieving the FAT environment from an NVME device, the
same way it can be retrieved from MMC, SCSI, or VIRTIO.

To use the FAT environment from an NVME device, pass
CONFIG_ENV_FAT_INTERFACE="nvme" in the defconfig.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
env/fat.c

index 65ee1c8e086dd8adb489773a771dd350fb4f20ae..412d95dc3057e11fa08343cf979a8bdd379736e1 100644 (file)
--- a/env/fat.c
+++ b/env/fat.c
 #include <memalign.h>
 #include <search.h>
 #include <errno.h>
+#include <init.h>
 #include <fat.h>
 #include <mmc.h>
+#include <nvme.h>
 #include <scsi.h>
 #include <virtio.h>
 #include <asm/cache.h>
@@ -136,6 +138,14 @@ static int env_fat_load(void)
        if (!strcmp(ifname, "virtio"))
                virtio_init();
 #endif
+#if defined(CONFIG_NVME)
+       if (!strcmp(ifname, "nvme")) {
+               if (IS_ENABLED(CONFIG_PCI))
+                       pci_init();
+
+               nvme_scan_namespace();
+       }
+#endif
 #endif
        part = blk_get_device_part_str(ifname, dev_and_part,
                                       &dev_desc, &info, 1);