From 7b21bf086053679c5ef1ea612072a78018370281 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Tue, 12 Aug 2025 14:46:11 -0300 Subject: [PATCH] env: ext4: Add support for NVME Add support for retrieving the EXT4 environment from an NVME device, the same way it can be retrieved from MMC, SCSI, or VIRTIO. To use the EXT4 environment from an NVME device, pass CONFIG_ENV_EXT4_INTERFACE="nvme" in the defconfig. Signed-off-by: Fabio Estevam --- env/ext4.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/env/ext4.c b/env/ext4.c index d92c844ea6c..c8122b4d22c 100644 --- a/env/ext4.c +++ b/env/ext4.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -30,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -156,6 +158,14 @@ static int env_ext4_load(void) virtio_init(); #endif +#if defined(CONFIG_NVME) + if (!strcmp(ifname, "nvme")) { + if (IS_ENABLED(CONFIG_PCI)) + pci_init(); + + nvme_scan_namespace(); + } +#endif part = blk_get_device_part_str(ifname, dev_and_part, &dev_desc, &info, 1); if (part < 0) -- 2.47.3