summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-08-20 14:24:57 -0600
committerTom Rini <[email protected]>2025-08-20 15:05:31 -0600
commitb436af06419adee8e63f4ee4482fba561831d25d (patch)
tree739606e5d1e0466d9747a29b4c2b77dd92062479
parent0572f7cad13e96bc239166121ecec1ebcf85a8e2 (diff)
parent82444e3ecd0ea8404ed6fd1dd3710bfd8d641f52 (diff)
Merge patch series "env: fat: Add support for NVME"
This series from Fabio Estevam <[email protected]> adds support for having the environment be found on an NVMe device that contains a FAT filesystem. Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--env/ext4.c10
-rw-r--r--env/fat.c12
2 files changed, 21 insertions, 1 deletions
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 <command.h>
#include <env.h>
+#include <init.h>
#include <env_internal.h>
#include <linux/stddef.h>
#include <malloc.h>
@@ -30,6 +31,7 @@
#include <errno.h>
#include <ext4fs.h>
#include <mmc.h>
+#include <nvme.h>
#include <scsi.h>
#include <virtio.h>
#include <asm/global_data.h>
@@ -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)
diff --git a/env/fat.c b/env/fat.c
index 65ee1c8e086..58c279ff769 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>
@@ -129,13 +131,21 @@ static int env_fat_load(void)
#endif
#ifndef CONFIG_XPL_BUILD
#if defined(CONFIG_AHCI) || defined(CONFIG_SCSI)
- if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "scsi"))
+ if (!strcmp(ifname, "scsi"))
scsi_scan(true);
#endif
#if defined(CONFIG_VIRTIO)
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);