From patchwork Thu Sep 29 09:56:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mayuresh Chitale X-Patchwork-Id: 1684407 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=WsYHH+X6; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MdWbr4hD5z1yqS for ; Thu, 29 Sep 2022 21:39:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D471984D6A; Thu, 29 Sep 2022 13:38:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="WsYHH+X6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7912984C61; Thu, 29 Sep 2022 11:57:21 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5724184BB9 for ; Thu, 29 Sep 2022 11:57:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mchitale@ventanamicro.com Received: by mail-pj1-x102f.google.com with SMTP id v10-20020a17090a634a00b00205e48cf845so5425516pjs.4 for ; Thu, 29 Sep 2022 02:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=V4EDa/8Jxkp9KPD4jiJJwJ+Y6Q6vtb0lypJ8WIISKLE=; b=WsYHH+X6lricyAMyEHt9V5lNBmtSQQS1uVkXd9ZiNgi1iMJxIZ430DHB1CwDKFMKlg bddZZcbpi8KJ1xQUH9mlXx4IpC6hyd/HJmJrl6azMbta3wmGXFeXbvsVV5AKlCy17wij XxBtunxs5MO0R+JcFV7XJAo4jazwH7fXLoa82tsgBzcWBU+W+16+4JR/4yCRqsIQe4IW TaSPBI8U6Um9/3V9c+g56fgR+oM3ctPOXAL1eK0KPzt32tC0qP9dGnXM6cIZxa+7tHC3 aY4FRCnjHHYcay34Q2lOaqY6hxIw5j3J1aiWrtXA89Pc1kswHKqrIEDqh2D5AkQRFBk/ e51w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=V4EDa/8Jxkp9KPD4jiJJwJ+Y6Q6vtb0lypJ8WIISKLE=; b=Q+0OJmBKj4mjlypudiZZiwAyPQxEJtX+2A8GbL5tBbup/nMxNpYVuj/2O/2niGX+BL m8T/5AkF8vGx4H+RYg2VN6Hs91IkVdW6rRIG2ZLtWJoyoeIUkHVysNdqmSJ8oq1UH63f LvobAB/zcso63xzrpOEC7ENhKtuWXJ/OAR1be2FQ12yOpksCxxfecbciF3/PA2r0zr6y s5BiGA9hDWbhTDMjm+8kmH4u80mpf1FKpU8PR88GKhufn4Ci2QwZYkwvH85C5cyAD/UQ kfSuKhU6AYy+K09UuZ6pH6NQAcnqy+cA16V5kqnbr/r3A7qG1qswLLi9ZBhspXdURepf Gsdw== X-Gm-Message-State: ACrzQf1UqIMPmHn+M8fopJXQqvI12ZaRfaCm/LBfC+PkXaVcGVsTTIAj /CpfBm5HCRFwz8obw9lYOt9OgA== X-Google-Smtp-Source: AMsMyM5Gwg4MM2N4pv9kBAJPeEXeN86v7nqqM4SEmphhge0J0JsDmCg5Klde21f5xgzYzXfypdNH7Q== X-Received: by 2002:a17:90a:fa8e:b0:200:b4b9:c6f3 with SMTP id cu14-20020a17090afa8e00b00200b4b9c6f3mr15415156pjb.190.1664445436655; Thu, 29 Sep 2022 02:57:16 -0700 (PDT) Received: from ThinkPad-T490.dc1.ventanamicro.com ([103.97.165.210]) by smtp.googlemail.com with ESMTPSA id a1-20020a170902710100b00176dee43e0dsm5418139pll.285.2022.09.29.02.57.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 02:57:16 -0700 (PDT) From: Mayuresh Chitale To: Bin Meng , Simon Glass Cc: Mayuresh Chitale , u-boot@lists.denx.de, Heinrich Schuchardt , Rick Chen , Leo Subject: [RFC PATCH v1 2/3] nvme: pci: Enable for SPL Date: Thu, 29 Sep 2022 15:26:38 +0530 Message-Id: <20220929095639.355675-3-mchitale@ventanamicro.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929095639.355675-1-mchitale@ventanamicro.com> References: <20220929095639.355675-1-mchitale@ventanamicro.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 29 Sep 2022 13:38:11 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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. Signed-off-by: Mayuresh Chitale --- 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(-) diff --git a/drivers/Makefile b/drivers/Makefile index eba9940231..581ae9f819 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/ @@ -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/ 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/nvme/nvme_pci.c b/drivers/nvme/nvme_pci.c index 36bf9c5ffb..16d8b9fff7 100644 --- a/drivers/nvme/nvme_pci.c +++ b/drivers/nvme/nvme_pci.c @@ -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[] = { diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig index 22f4995453..2d4c9f0781 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 16a6a699f9..62d2409a6d 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);