diff mbox series

[v2,2/4] nvme: pci: Enable for SPL

Message ID 20230502161902.1339861-3-mchitale@ventanamicro.com
State Superseded
Delegated to: Tom Rini
Headers show
Series SPL NVme support | expand

Commit Message

Mayuresh Chitale May 2, 2023, 4:19 p.m. UTC
Enable NVME and PCI NVMe drivers for SPL builds. Also enable PCI_PNP
for SPL which is required to auto configure the PCIe devices.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
---
 drivers/Makefile         | 1 +
 drivers/nvme/Makefile    | 2 +-
 drivers/pci/Kconfig      | 7 +++++++
 drivers/pci/pci-uclass.c | 3 ++-
 4 files changed, 11 insertions(+), 2 deletions(-)

Comments

Simon Glass May 3, 2023, 1:28 a.m. UTC | #1
Hi Mayuresh,

On Tue, 2 May 2023 at 10:19, Mayuresh Chitale <mchitale@ventanamicro.com> wrote:
>
> Enable NVME and PCI NVMe drivers for SPL builds. Also enable PCI_PNP
> for SPL which is required to auto configure the PCIe devices.
>
> Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
> ---
>  drivers/Makefile         | 1 +
>  drivers/nvme/Makefile    | 2 +-
>  drivers/pci/Kconfig      | 7 +++++++
>  drivers/pci/pci-uclass.c | 3 ++-
>  4 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/Makefile b/drivers/Makefile
> index 58be410135..dc559ea7f7 100644
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -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/
>  obj-y += bus/
> diff --git a/drivers/nvme/Makefile b/drivers/nvme/Makefile
> index fa7b619446..fd3e68a91d 100644
> --- a/drivers/nvme/Makefile
> +++ b/drivers/nvme/Makefile
> @@ -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
> diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
> index ef328d2652..ecab6ddc7e 100644
> --- a/drivers/pci/Kconfig
> +++ b/drivers/pci/Kconfig
> @@ -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
> diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
> index 9343cfc62a..dff63a68ce 100644
> --- a/drivers/pci/pci-uclass.c
> +++ b/drivers/pci/pci-uclass.c
> @@ -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)) &&

The CONFIG_IS_ENABLED() macro checks SPL_PCI_PNP when used in an SPL
build, so you should not need this change.

> +           ll_boot_init() &&
>             (!hose->skip_auto_config_until_reloc ||
>              (gd->flags & GD_FLG_RELOC))) {
>                 ret = pci_auto_config_devices(bus);
> --
> 2.34.1
>

Regards,
Simon
Mayuresh Chitale May 4, 2023, 8:27 a.m. UTC | #2
Hi Simon,

On Wed, May 3, 2023 at 6:58 AM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Mayuresh,
>
> On Tue, 2 May 2023 at 10:19, Mayuresh Chitale <mchitale@ventanamicro.com> wrote:
> >
> > Enable NVME and PCI NVMe drivers for SPL builds. Also enable PCI_PNP
> > for SPL which is required to auto configure the PCIe devices.
> >
> > Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
> > ---
> >  drivers/Makefile         | 1 +
> >  drivers/nvme/Makefile    | 2 +-
> >  drivers/pci/Kconfig      | 7 +++++++
> >  drivers/pci/pci-uclass.c | 3 ++-
> >  4 files changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/Makefile b/drivers/Makefile
> > index 58be410135..dc559ea7f7 100644
> > --- a/drivers/Makefile
> > +++ b/drivers/Makefile
> > @@ -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/
> >  obj-y += bus/
> > diff --git a/drivers/nvme/Makefile b/drivers/nvme/Makefile
> > index fa7b619446..fd3e68a91d 100644
> > --- a/drivers/nvme/Makefile
> > +++ b/drivers/nvme/Makefile
> > @@ -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
> > diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
> > index ef328d2652..ecab6ddc7e 100644
> > --- a/drivers/pci/Kconfig
> > +++ b/drivers/pci/Kconfig
> > @@ -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
> > diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
> > index 9343cfc62a..dff63a68ce 100644
> > --- a/drivers/pci/pci-uclass.c
> > +++ b/drivers/pci/pci-uclass.c
> > @@ -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)) &&
>
> The CONFIG_IS_ENABLED() macro checks SPL_PCI_PNP when used in an SPL
> build, so you should not need this change.
Ok. Will remove it in the next version.
>
> > +           ll_boot_init() &&
> >             (!hose->skip_auto_config_until_reloc ||
> >              (gd->flags & GD_FLG_RELOC))) {
> >                 ret = pci_auto_config_devices(bus);
> > --
> > 2.34.1
> >
>
> Regards,
> Simon

Thanks,
Mayuresh.
diff mbox series

Patch

diff --git a/drivers/Makefile b/drivers/Makefile
index 58be410135..dc559ea7f7 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -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/
 obj-y += bus/
diff --git a/drivers/nvme/Makefile b/drivers/nvme/Makefile
index fa7b619446..fd3e68a91d 100644
--- a/drivers/nvme/Makefile
+++ b/drivers/nvme/Makefile
@@ -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
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index ef328d2652..ecab6ddc7e 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -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
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index 9343cfc62a..dff63a68ce 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -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);