Loadable Module support for PCIe Cadence and J721E
From: | Siddharth Vadapalli <s-vadapalli-AT-ti.com> | |
To: | <lpieralisi-AT-kernel.org>, <kw-AT-linux.com>, <manivannan.sadhasivam-AT-linaro.org>, <robh-AT-kernel.org>, <bhelgaas-AT-google.com>, <vigneshr-AT-ti.com>, <kishon-AT-kernel.org>, <18255117159-AT-163.com>, <cassel-AT-kernel.org>, <wojciech.jasko-EXT-AT-continental-corporation.com>, <thomas.richard-AT-bootlin.com>, <bwawrzyn-AT-cisco.com> | |
Subject: | [PATCH v2 0/4] Loadable Module support for PCIe Cadence and J721E | |
Date: | Sun, 30 Mar 2025 14:09:10 +0530 | |
Message-ID: | <20250330083914.529222-1-s-vadapalli@ti.com> | |
Cc: | <linux-pci-AT-vger.kernel.org>, <linux-omap-AT-vger.kernel.org>, <linux-kernel-AT-vger.kernel.org>, <linux-arm-kernel-AT-lists.infradead.org>, <srk-AT-ti.com>, <s-vadapalli-AT-ti.com> | |
Archive-link: | Article |
Hello, This series enables support to build the PCIe Cadence Controller drivers and the PCI J721E Application/Wrapper/Glue driver as Loadable Kernel Modules. The motivation for this series is that PCIe is not a necessity for booting the SoC, due to which it doesn't have to be a built-in module. Additionally, the defconfig doesn't enable the PCIe Cadence Controller drivers and the PCI J721E driver, due to which PCIe is not supported by default. Enabling the configs as of now (i.e. without this series) will result in built-in drivers i.e. a bloated Linux Image for everyone who doesn't have the PCIe Controller. Therefore, with this series, after enabling support for building the drivers as loadable modules, the driver configs can be enabled in the defconfig to build the drivers as loadable modules, thereby enabling PCIe. Series is based on linux-next tagged next-20250328. Series has been tested by loading and unloading the PCI J721E driver when operating in the Root-Complex mode on J700-EVM with an NVMe SSD connected to the PCIe Connector. "hdparm" based reads of the NVMe SSD have been performed to validate functionality before and after a module unload-load sequence using modprobe. Additionally, the module unload was performed while running "hdparm" in the background. No crash was seen and reloading the module enumerated the NVMe SSD and "hdparm" could be re-run successfully. v1 of this series is at: https://lore.kernel.org/r/20250307103128.3287497-1-s-vada... Changes since v1: - Collected "Reviewed-by" tags from: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> for the first two patches in this series. - Based on feedback from Mani on the third patch of the v1 series at: https://lore.kernel.org/r/20250318080304.jsmrxqil6pn74nzh... pci_epc_deinit_notify() has been included in cdns_pcie_ep_disable(). - Based on feedback from Thomas on the fourth patch of the v1 series at: https://lore.kernel.org/r/88b3ecbe-32b6-4310-afb9-da19a2d... the "check" for a non-NULL "pcie-refclk" in j721e_pcie_remove() has been dropped. Regards, Siddharth. Kishon Vijay Abraham I (1): PCI: cadence: Add support to build pcie-cadence library as a kernel module Siddharth Vadapalli (3): PCI: cadence-host: Introduce cdns_pcie_host_disable helper for cleanup PCI: cadence-ep: Introduce cdns_pcie_ep_disable helper for cleanup PCI: j721e: Add support to build as a loadable module drivers/pci/controller/cadence/Kconfig | 12 +- drivers/pci/controller/cadence/pci-j721e.c | 33 ++++- .../pci/controller/cadence/pcie-cadence-ep.c | 17 +++ .../controller/cadence/pcie-cadence-host.c | 113 ++++++++++++++++++ drivers/pci/controller/cadence/pcie-cadence.c | 12 ++ drivers/pci/controller/cadence/pcie-cadence.h | 14 ++- 6 files changed, 192 insertions(+), 9 deletions(-) -- 2.34.1