summaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
authorFabio Estevam <[email protected]>2025-08-12 14:46:10 -0300
committerTom Rini <[email protected]>2025-08-20 15:05:31 -0600
commitafbed1ba2f8776b06ef821212b14a3e34bdcd2bd (patch)
treeb03c67490b72bd2e8adc56a8ccb867b2e2f6faa4 /env
parent0572f7cad13e96bc239166121ecec1ebcf85a8e2 (diff)
env: fat: Add support for NVME
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 <[email protected]>
Diffstat (limited to 'env')
-rw-r--r--env/fat.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/env/fat.c b/env/fat.c
index 65ee1c8e086..412d95dc305 100644
--- a/env/fat.c
+++ b/env/fat.c
@@ -14,8 +14,10 @@
#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);