Skip to contentSkip to conversation

SPL NVMe support

RFC PATCH Superseded Mayuresh Chitale 2 participants 9 messages Sep 29, 2022 – Sep 30, 2022

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover SPL NVMe support

This patchset adds support to load images of the SPL's next booting stage from a NVMe device.

Mayuresh Chitale (3):
spl: Add Kconfig options for NVME
nvme: pci: Enable for SPL
common: spl: Add spl NVMe boot support

 arch/riscv/include/asm/spl.h |  1 +
 common/spl/Kconfig           | 25 ++++++++++++++++++++
 common/spl/Makefile          |  1 +
 common/spl/spl_nvme.c        | 44 ++++++++++++++++++++++++++++++++++++
 drivers/Makefile             |  2 +-
 drivers/nvme/Makefile        |  2 +-
 drivers/nvme/nvme_pci.c      |  1 +
 drivers/pci/Kconfig          |  7 ++++++
 drivers/pci/pci-uclass.c     |  3 ++-
 9 files changed, 83 insertions(+), 3 deletions(-)
 create mode 100644 common/spl/spl_nvme.c
Signature · 1 line
2.25.1
#1 lore raw

RFC PATCH 1/3 spl: Add Kconfig options for NVME

This patch adds options to enable PCI NVMe support in SPL

---
 common/spl/Kconfig | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
common/spl/Kconfig +25 -0
index 70d97815f0..2bc97421f9 100644
@@ -1218,6 +1218,31 @@ config SPL_SATA
 	  expense and power consumption. This enables loading from SATA
 	  using a configured device.
 
+config SPL_NVME
+	bool "NVM Express device support"
+	depends on BLK
+	select HAVE_BLOCK_DEVICE
+	help
+	  This option enables support for NVM Express devices.
+	  It supports basic functions of NVMe (read/write).
+
+config SPL_NVME_PCI
+	bool "NVM Express PCI device support for SPL"
+	depends on SPL_PCI && SPL_NVME
+	help
+	  This option enables support for NVM Express PCI devices.
+	  This allows use of NVMe devices for loading u-boot.
+
+config SPL_NVME_BOOT_DEVICE
+	hex "NVMe boot device number"
+	depends on SPL_NVME
+	default 0x0
+
+config SYS_NVME_FAT_BOOT_PARTITION
+	hex "NVMe boot partition number"
+	depends on SPL_NVME
+	default	0x1
+
 config SPL_SATA_RAW_U_BOOT_USE_SECTOR
 	bool "SATA raw mode: by sector"
 	depends on SPL_SATA
Signature · 1 line
2.25.1
#3 lore raw

RFC PATCH 2/3 nvme: pci: Enable for SPL

In reply to Mayuresh Chitale

Build PCI NVMe driver when enabled for SPI and enable dm-pre-reloc for the driver. Also enable PCI_PNP for SPL which is required to auto configure the PCIe devices.

---
 drivers/Makefile         | 2 +-
 drivers/nvme/Makefile    | 2 +-
 drivers/nvme/nvme_pci.c  | 1 +
 drivers/pci/Kconfig      | 7 +++++++
 drivers/pci/pci-uclass.c | 3 ++-
 5 files changed, 12 insertions(+), 3 deletions(-)
drivers/Makefile +1 -1
index eba9940231..581ae9f819 100644
@@ -34,6 +34,7 @@ obj-$(CONFIG_$(SPL_)DM_MAILBOX) += mailbox/
 obj-$(CONFIG_$(SPL_)REMOTEPROC) += remoteproc/
 obj-$(CONFIG_$(SPL_)SYSINFO) += sysinfo/
 obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm/
+obj-$(CONFIG_$(SPL_)NVME) += nvme/
 obj-$(CONFIG_XEN) += xen/
 obj-$(CONFIG_$(SPL_)FPGA) += fpga/
 
@@ -86,7 +87,6 @@ obj-y += crypto/
 obj-$(CONFIG_FASTBOOT) += fastboot/
 obj-y += misc/
 obj-$(CONFIG_MMC) += mmc/
-obj-$(CONFIG_NVME) += nvme/
 obj-$(CONFIG_PCI_ENDPOINT) += pci_endpoint/
 obj-y += dfu/
 obj-$(CONFIG_PCH) += pch/
drivers/nvme/Makefile +1 -1
index fa7b619446..fd3e68a91d 100644
@@ -4,4 +4,4 @@
 
 obj-y += nvme-uclass.o nvme.o nvme_show.o
 obj-$(CONFIG_NVME_APPLE) += nvme_apple.o
-obj-$(CONFIG_NVME_PCI) += nvme_pci.o
+obj-$(CONFIG_$(SPL_)NVME_PCI) += nvme_pci.o
drivers/nvme/nvme_pci.c +1 -0
index 36bf9c5ffb..16d8b9fff7 100644
@@ -39,6 +39,7 @@ U_BOOT_DRIVER(nvme) = {
 	.bind	= nvme_bind,
 	.probe	= nvme_probe,
 	.priv_auto	= sizeof(struct nvme_dev),
+	.flags	= DM_FLAG_PRE_RELOC,
 };
 
 struct pci_device_id nvme_supported[] = {
drivers/pci/Kconfig +7 -0
index 22f4995453..2d4c9f0781 100644
@@ -40,6 +40,13 @@ config PCI_PNP
 	help
 	  Enable PCI memory and I/O space resource allocation and assignment.
 
+config SPL_PCI_PNP
+	bool "Enable Plug & Play support for PCI"
+	default n
+	help
+	  Enable PCI memory and I/O space resource allocation and assignment.
+	  This is required to auto configure the enumerated devices.
+
 config PCI_REGION_MULTI_ENTRY
 	bool "Enable Multiple entries of region type MEMORY in ranges for PCI"
 	help
drivers/pci/pci-uclass.c +2 -1
index 16a6a699f9..62d2409a6d 100644
@@ -1140,7 +1140,8 @@ static int pci_uclass_post_probe(struct udevice *bus)
 	if (ret)
 		return log_msg_ret("bind", ret);
 
-	if (CONFIG_IS_ENABLED(PCI_PNP) && ll_boot_init() &&
+	if ((CONFIG_IS_ENABLED(PCI_PNP) || CONFIG_IS_ENABLED(SPL_PCI_PNP)) &&
+	    ll_boot_init() &&
 	    (!hose->skip_auto_config_until_reloc ||
 	     (gd->flags & GD_FLG_RELOC))) {
 		ret = pci_auto_config_devices(bus);
Signature · 1 line
2.25.1
#7 lore raw

RFC PATCH 3/3 common: spl: Add spl NVMe boot support

In reply to Mayuresh Chitale

Add spl_nvme to read a fat partition from a bootable NVMe device.

---
 arch/riscv/include/asm/spl.h |  1 +
 common/spl/Makefile          |  1 +
 common/spl/spl_nvme.c        | 44 ++++++++++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+)
 create mode 100644 common/spl/spl_nvme.c
arch/riscv/include/asm/spl.h +1 -0
index e8a94fcb1f..5d0ba4b034 100644
@@ -20,6 +20,7 @@ enum {
 	BOOT_DEVICE_SPI,
 	BOOT_DEVICE_USB,
 	BOOT_DEVICE_SATA,
+	BOOT_DEVICE_NVME,
 	BOOT_DEVICE_I2C,
 	BOOT_DEVICE_BOARD,
 	BOOT_DEVICE_DFU,
common/spl/Makefile +1 -0
index 13db3df993..4bcc3d7e68 100644
@@ -28,6 +28,7 @@ obj-$(CONFIG_$(SPL_TPL_)USB_STORAGE) += spl_usb.o
 obj-$(CONFIG_$(SPL_TPL_)FS_FAT) += spl_fat.o
 obj-$(CONFIG_$(SPL_TPL_)FS_EXT4) += spl_ext.o
 obj-$(CONFIG_$(SPL_TPL_)SATA) += spl_sata.o
+obj-$(CONFIG_$(SPL_TPL_)NVME) += spl_nvme.o
 obj-$(CONFIG_$(SPL_TPL_)SEMIHOSTING) += spl_semihosting.o
 obj-$(CONFIG_$(SPL_TPL_)DFU) += spl_dfu.o
 obj-$(CONFIG_$(SPL_TPL_)SPI_LOAD) += spl_spi.o
common/spl/spl_nvme.c new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.25.1
#4 lore raw

Re: [RFC PATCH v1 2/3] nvme: pci: Enable for SPL

In reply to Mayuresh Chitale

Hi Mayuresh,

Quoted 49 lines · Mayuresh Chitale

Build PCI NVMe driver when enabled for SPI and enable dm-pre-reloc for the driver. Also enable PCI_PNP for SPL which is required to auto configure the PCIe devices.

---
 drivers/Makefile         | 2 +-
 drivers/nvme/Makefile    | 2 +-
 drivers/nvme/nvme_pci.c  | 1 +
 drivers/pci/Kconfig      | 7 +++++++
 drivers/pci/pci-uclass.c | 3 ++-
 5 files changed, 12 insertions(+), 3 deletions(-)
drivers/Makefile +1 -1
index eba9940231..581ae9f819 100644
@@ -34,6 +34,7 @@ obj-$(CONFIG_$(SPL_)DM_MAILBOX) += mailbox/
 obj-$(CONFIG_$(SPL_)REMOTEPROC) += remoteproc/
 obj-$(CONFIG_$(SPL_)SYSINFO) += sysinfo/
 obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm/
+obj-$(CONFIG_$(SPL_)NVME) += nvme/
 obj-$(CONFIG_XEN) += xen/
 obj-$(CONFIG_$(SPL_)FPGA) += fpga/
 
@@ -86,7 +87,6 @@ obj-y += crypto/
 obj-$(CONFIG_FASTBOOT) += fastboot/
 obj-y += misc/
 obj-$(CONFIG_MMC) += mmc/
-obj-$(CONFIG_NVME) += nvme/
 obj-$(CONFIG_PCI_ENDPOINT) += pci_endpoint/
 obj-y += dfu/
 obj-$(CONFIG_PCH) += pch/
drivers/nvme/Makefile +1 -1
index fa7b619446..fd3e68a91d 100644
@@ -4,4 +4,4 @@
 
 obj-y += nvme-uclass.o nvme.o nvme_show.o
 obj-$(CONFIG_NVME_APPLE) += nvme_apple.o
-obj-$(CONFIG_NVME_PCI) += nvme_pci.o
+obj-$(CONFIG_$(SPL_)NVME_PCI) += nvme_pci.o
drivers/nvme/nvme_pci.c +0 -0
index 36bf9c5ffb..16d8b9fff7 100644

drivers/nvme/nvme_pci.c U_BOOT_DRIVER(nvme) = { · line 42

Quoted 4 lines
drivers/nvme/nvme_pci.c +1 -0
@@ -39,6 +39,7 @@ U_BOOT_DRIVER(nvme) = {
        .bind   = nvme_bind,
        .probe  = nvme_probe,
        .priv_auto      = sizeof(struct nvme_dev),
+       .flags  = DM_FLAG_PRE_RELOC,

Why is this here? It is only applicable on some boards.

Instead, add the appropriate tag (e.g. u-boot,dm-spl) to the device node.

Quoted 36 lines
drivers/nvme/nvme_pci.c +0 -0
 };
 
 struct pci_device_id nvme_supported[] = {
drivers/pci/Kconfig +7 -0
index 22f4995453..2d4c9f0781 100644
@@ -40,6 +40,13 @@ config PCI_PNP
        help
          Enable PCI memory and I/O space resource allocation and assignment.
 
+config SPL_PCI_PNP
+       bool "Enable Plug & Play support for PCI"
+       default n
+       help
+         Enable PCI memory and I/O space resource allocation and assignment.
+         This is required to auto configure the enumerated devices.
+
 config PCI_REGION_MULTI_ENTRY
        bool "Enable Multiple entries of region type MEMORY in ranges for PCI"
        help
drivers/pci/pci-uclass.c +2 -2
index 16a6a699f9..62d2409a6d 100644
@@ -1140,7 +1140,8 @@ static int pci_uclass_post_probe(struct udevice *bus)
        if (ret)
                return log_msg_ret("bind", ret);
 
-       if (CONFIG_IS_ENABLED(PCI_PNP) && ll_boot_init() &&
+       if ((CONFIG_IS_ENABLED(PCI_PNP) || CONFIG_IS_ENABLED(SPL_PCI_PNP)) &&
+           ll_boot_init() &&
            (!hose->skip_auto_config_until_reloc ||
             (gd->flags & GD_FLG_RELOC))) {
                ret = pci_auto_config_devices(bus);
--
Quoted 2 lines

2.25.1

Regards,
Simon

Reviewed-by on v1 3/3
#8 lore raw

Re: [RFC PATCH v1 3/3] common: spl: Add spl NVMe boot support

In reply to Mayuresh Chitale

Hi Mayuresh,

Quoted 10 lines · Mayuresh Chitale

Add spl_nvme to read a fat partition from a bootable NVMe device.

---
 arch/riscv/include/asm/spl.h |  1 +
 common/spl/Makefile          |  1 +
 common/spl/spl_nvme.c        | 44 ++++++++++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+)
 create mode 100644 common/spl/spl_nvme.c

(but see below)

Quoted 35 lines
arch/riscv/include/asm/spl.h +1 -0
index e8a94fcb1f..5d0ba4b034 100644
@@ -20,6 +20,7 @@ enum {
        BOOT_DEVICE_SPI,
        BOOT_DEVICE_USB,
        BOOT_DEVICE_SATA,
+       BOOT_DEVICE_NVME,
        BOOT_DEVICE_I2C,
        BOOT_DEVICE_BOARD,
        BOOT_DEVICE_DFU,
common/spl/Makefile +1 -0
index 13db3df993..4bcc3d7e68 100644
@@ -28,6 +28,7 @@ obj-$(CONFIG_$(SPL_TPL_)USB_STORAGE) += spl_usb.o
 obj-$(CONFIG_$(SPL_TPL_)FS_FAT) += spl_fat.o
 obj-$(CONFIG_$(SPL_TPL_)FS_EXT4) += spl_ext.o
 obj-$(CONFIG_$(SPL_TPL_)SATA) += spl_sata.o
+obj-$(CONFIG_$(SPL_TPL_)NVME) += spl_nvme.o
 obj-$(CONFIG_$(SPL_TPL_)SEMIHOSTING) += spl_semihosting.o
 obj-$(CONFIG_$(SPL_TPL_)DFU) += spl_dfu.o
 obj-$(CONFIG_$(SPL_TPL_)SPI_LOAD) += spl_spi.o
common/spl/spl_nvme.c new file +4 -0
new file mode 100644
index 0000000000..d8a9dba845
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2022
+ * Ventana Micro Systems Inc.

common/spl/spl_nvme.c line 14

Quoted 10 lines
common/spl/spl_nvme.c new file +10 -0
+ *
+ * Derived work from spl_sata.c
+ */
+
+#include <common.h>
+#include <spl.h>
+#include <errno.h>
+#include <fat.h>
+#include <nvme.h>
+#include <init.h>

Should go above nvme.h

Quoted 8 lines
common/spl/spl_nvme.c new file +8 -0
+
+static int spl_nvme_load_image(struct spl_image_info *spl_image,
+                              struct spl_boot_device *bootdev)
+{
+       int ret;
+       struct blk_desc *blk_desc;
+
+       ret = pci_init();

common/spl/spl_nvme.c line 32

Quoted 10 lines
common/spl/spl_nvme.c new file +10 -0
+       if (ret < 0)
+               goto out;
+
+       ret = nvme_scan_namespace();
+       if (ret < 0)
+               goto out;
+
+       blk_show_device(IF_TYPE_NVME, CONFIG_SPL_NVME_BOOT_DEVICE);
+       blk_desc = blk_get_devnum_by_type(IF_TYPE_NVME,
+                                         CONFIG_SPL_NVME_BOOT_DEVICE);

I think we need to move this to device tree, but it is OK for now.

Quoted 13 lines
common/spl/spl_nvme.c new file +12 -1
+       if (IS_ENABLED(CONFIG_SPL_FS_FAT))
+               ret = spl_load_image_fat(spl_image, bootdev, blk_desc,
+                                        CONFIG_SYS_NVME_FAT_BOOT_PARTITION,
+                                        CONFIG_SPL_PAYLOAD);
+       else
+               ret = -ENOSYS;
+
+out:
+       return ret;
+}
+
+SPL_LOAD_IMAGE_METHOD("NVME", 0, BOOT_DEVICE_NVME, spl_nvme_load_image);
--
Quoted 2 lines

2.25.1

Regards,
Simon

#5 lore raw

Re: [RFC PATCH v1 2/3] nvme: pci: Enable for SPL

In reply to Simon Glass

Hi Simon,

Quoted 60 lines · Simon Glass

Hi Mayuresh,

Quoted 49 lines · Mayuresh Chitale

Build PCI NVMe driver when enabled for SPI and enable dm-pre-reloc for the driver. Also enable PCI_PNP for SPL which is required to auto configure the PCIe devices.

---
 drivers/Makefile         | 2 +-
 drivers/nvme/Makefile    | 2 +-
 drivers/nvme/nvme_pci.c  | 1 +
 drivers/pci/Kconfig      | 7 +++++++
 drivers/pci/pci-uclass.c | 3 ++-
 5 files changed, 12 insertions(+), 3 deletions(-)
drivers/Makefile +1 -1
index eba9940231..581ae9f819 100644
@@ -34,6 +34,7 @@ obj-$(CONFIG_$(SPL_)DM_MAILBOX) += mailbox/
 obj-$(CONFIG_$(SPL_)REMOTEPROC) += remoteproc/
 obj-$(CONFIG_$(SPL_)SYSINFO) += sysinfo/
 obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm/
+obj-$(CONFIG_$(SPL_)NVME) += nvme/
 obj-$(CONFIG_XEN) += xen/
 obj-$(CONFIG_$(SPL_)FPGA) += fpga/
 
@@ -86,7 +87,6 @@ obj-y += crypto/
 obj-$(CONFIG_FASTBOOT) += fastboot/
 obj-y += misc/
 obj-$(CONFIG_MMC) += mmc/
-obj-$(CONFIG_NVME) += nvme/
 obj-$(CONFIG_PCI_ENDPOINT) += pci_endpoint/
 obj-y += dfu/
 obj-$(CONFIG_PCH) += pch/
drivers/nvme/Makefile +1 -1
index fa7b619446..fd3e68a91d 100644
@@ -4,4 +4,4 @@
 
 obj-y += nvme-uclass.o nvme.o nvme_show.o
 obj-$(CONFIG_NVME_APPLE) += nvme_apple.o
-obj-$(CONFIG_NVME_PCI) += nvme_pci.o
+obj-$(CONFIG_$(SPL_)NVME_PCI) += nvme_pci.o
drivers/nvme/nvme_pci.c +0 -0
index 36bf9c5ffb..16d8b9fff7 100644

drivers/nvme/nvme_pci.c U_BOOT_DRIVER(nvme) = { · line 42

Quoted 4 lines
drivers/nvme/nvme_pci.c +1 -0
@@ -39,6 +39,7 @@ U_BOOT_DRIVER(nvme) = {
        .bind   = nvme_bind,
        .probe  = nvme_probe,
        .priv_auto      = sizeof(struct nvme_dev),
+       .flags  = DM_FLAG_PRE_RELOC,

Why is this here? It is only applicable on some boards.

Quoted 2 lines

Instead, add the appropriate tag (e.g. u-boot,dm-spl) to the device node.

I am not sure how that can be done for PCI devices as those would be probed at run time. Could you please point to any examples? Also,
the pci_find_and_bind_driver function only checks for this flag in the drivers when binding the devices

Quoted 48 lines

drivers/pci/Kconfig config PCI_PNP · line 41

Quoted 11 lines
drivers/nvme/nvme_pci.c +0 -0
 };
 
 struct pci_device_id nvme_supported[] = {
drivers/pci/Kconfig +0 -0
index 22f4995453..2d4c9f0781 100644
@@ -40,6 +40,13 @@ config PCI_PNP
        help
          Enable PCI memory and I/O space resource allocation and

assignment.

drivers/pci/Kconfig config PCI_PNP

Quoted 6 lines
drivers/pci/Kconfig +5 -0
+config SPL_PCI_PNP
+       bool "Enable Plug & Play support for PCI"
+       default n
+       help
+         Enable PCI memory and I/O space resource allocation and

assignment.

drivers/pci/Kconfig config PCI_PNP

Quoted 4 lines
drivers/pci/Kconfig +2 -0
+         This is required to auto configure the enumerated devices.
+
 config PCI_REGION_MULTI_ENTRY
        bool "Enable Multiple entries of region type MEMORY in ranges

for PCI"

drivers/pci/pci-uclass.c static int pci_uclass_post_probe(struct udevice

Quoted 6 lines
drivers/pci/Kconfig +0 -0
        help
drivers/pci/pci-uclass.c +0 -0
index 16a6a699f9..62d2409a6d 100644
@@ -1140,7 +1140,8 @@ static int pci_uclass_post_probe(struct udevice

*bus)

drivers/pci/pci-uclass.c static int pci_uclass_post_probe(struct udevice *bus)

Quoted 5 lines
drivers/pci/pci-uclass.c +1 -1
        if (ret)
                return log_msg_ret("bind", ret);
 
-       if (CONFIG_IS_ENABLED(PCI_PNP) && ll_boot_init() &&
+       if ((CONFIG_IS_ENABLED(PCI_PNP) ||

CONFIG_IS_ENABLED(SPL_PCI_PNP)) &&

Quoted 7 lines
drivers/pci/pci-uclass.c +1 -1
+           ll_boot_init() &&
            (!hose->skip_auto_config_until_reloc ||
             (gd->flags & GD_FLG_RELOC))) {
                ret = pci_auto_config_devices(bus);
--

2.25.1

Regards,
Simon

#6 lore raw

Re: [RFC PATCH v1 2/3] nvme: pci: Enable for SPL

Hi Mayuresh,

Quoted 65 lines · Mayuresh Chitale

Hi Simon,

Quoted 61 lines · Simon Glass

Hi Mayuresh,

Quoted 49 lines · Mayuresh Chitale

Build PCI NVMe driver when enabled for SPI and enable dm-pre-reloc for the driver. Also enable PCI_PNP for SPL which is required to auto configure the PCIe devices.

---
 drivers/Makefile         | 2 +-
 drivers/nvme/Makefile    | 2 +-
 drivers/nvme/nvme_pci.c  | 1 +
 drivers/pci/Kconfig      | 7 +++++++
 drivers/pci/pci-uclass.c | 3 ++-
 5 files changed, 12 insertions(+), 3 deletions(-)
drivers/Makefile +1 -1
index eba9940231..581ae9f819 100644
@@ -34,6 +34,7 @@ obj-$(CONFIG_$(SPL_)DM_MAILBOX) += mailbox/
 obj-$(CONFIG_$(SPL_)REMOTEPROC) += remoteproc/
 obj-$(CONFIG_$(SPL_)SYSINFO) += sysinfo/
 obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm/
+obj-$(CONFIG_$(SPL_)NVME) += nvme/
 obj-$(CONFIG_XEN) += xen/
 obj-$(CONFIG_$(SPL_)FPGA) += fpga/
 
@@ -86,7 +87,6 @@ obj-y += crypto/
 obj-$(CONFIG_FASTBOOT) += fastboot/
 obj-y += misc/
 obj-$(CONFIG_MMC) += mmc/
-obj-$(CONFIG_NVME) += nvme/
 obj-$(CONFIG_PCI_ENDPOINT) += pci_endpoint/
 obj-y += dfu/
 obj-$(CONFIG_PCH) += pch/
drivers/nvme/Makefile +1 -1
index fa7b619446..fd3e68a91d 100644
@@ -4,4 +4,4 @@
 
 obj-y += nvme-uclass.o nvme.o nvme_show.o
 obj-$(CONFIG_NVME_APPLE) += nvme_apple.o
-obj-$(CONFIG_NVME_PCI) += nvme_pci.o
+obj-$(CONFIG_$(SPL_)NVME_PCI) += nvme_pci.o
drivers/nvme/nvme_pci.c +0 -0
index 36bf9c5ffb..16d8b9fff7 100644

drivers/nvme/nvme_pci.c U_BOOT_DRIVER(nvme) = { · line 42

Quoted 4 lines
drivers/nvme/nvme_pci.c +1 -0
@@ -39,6 +39,7 @@ U_BOOT_DRIVER(nvme) = {
        .bind   = nvme_bind,
        .probe  = nvme_probe,
        .priv_auto      = sizeof(struct nvme_dev),
+       .flags  = DM_FLAG_PRE_RELOC,

Why is this here? It is only applicable on some boards.

Quoted 4 lines
Quoted 1 line

Instead, add the appropriate tag (e.g. u-boot,dm-spl) to the device node.

I am not sure how that can be done for PCI devices as those would be probed at run time. Could you please point to any examples? Also, the pci_find_and_bind_driver function only checks for this flag in the drivers when binding the devices

See host-bridge@0,0 in chromebook_coral.dts for an example of using the u-boot,dm-pre-reloc flag. Note that pci_find_and_bind_driver() is only called if the device tree lacks anything.

Which board is this for?

Regards,
Simon