Skip to content

Commit f55fee5

Browse files
Mani-Sadhasivambjorn-helgaas
authored andcommitted
PCI: qcom-ep: Add Qualcomm PCIe Endpoint controller driver
Add driver for Qualcomm PCIe Endpoint controller based on the DesignWare core with added Qualcomm-specific wrapper around the core. The driver support is very basic such that it supports only enumeration, PCIe read/write, and MSI. There is no ASPM and PM support for now but these will be added later. The driver is capable of using the PERST# and WAKE# side-band GPIOs for operation and written on top of the DWC PCI framework. [bhelgaas: wrap a few long lines] Co-developed-by: Siddartha Mohanadoss <[email protected]> [mani: restructured the driver and fixed several bugs for upstream] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Siddartha Mohanadoss <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Rob Herring <[email protected]>
1 parent 31c9ef0 commit f55fee5

File tree

4 files changed

+735
-0
lines changed

4 files changed

+735
-0
lines changed

drivers/pci/controller/dwc/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,16 @@ config PCIE_QCOM
180180
PCIe controller uses the DesignWare core plus Qualcomm-specific
181181
hardware wrappers.
182182

183+
config PCIE_QCOM_EP
184+
tristate "Qualcomm PCIe controller - Endpoint mode"
185+
depends on OF && (ARCH_QCOM || COMPILE_TEST)
186+
depends on PCI_ENDPOINT
187+
select PCIE_DW_EP
188+
help
189+
Say Y here to enable support for the PCIe controllers on Qualcomm SoCs
190+
to work in endpoint mode. The PCIe controller uses the DesignWare core
191+
plus Qualcomm-specific hardware wrappers.
192+
183193
config PCIE_ARMADA_8K
184194
bool "Marvell Armada-8K PCIe controller"
185195
depends on ARCH_MVEBU || COMPILE_TEST

drivers/pci/controller/dwc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ obj-$(CONFIG_PCI_KEYSTONE) += pci-keystone.o
1212
obj-$(CONFIG_PCI_LAYERSCAPE) += pci-layerscape.o
1313
obj-$(CONFIG_PCI_LAYERSCAPE_EP) += pci-layerscape-ep.o
1414
obj-$(CONFIG_PCIE_QCOM) += pcie-qcom.o
15+
obj-$(CONFIG_PCIE_QCOM_EP) += pcie-qcom-ep.o
1516
obj-$(CONFIG_PCIE_ARMADA_8K) += pcie-armada8k.o
1617
obj-$(CONFIG_PCIE_ARTPEC6) += pcie-artpec6.o
1718
obj-$(CONFIG_PCIE_ROCKCHIP_DW_HOST) += pcie-dw-rockchip.o

drivers/pci/controller/dwc/pcie-designware-ep.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ void dw_pcie_ep_reset_bar(struct dw_pcie *pci, enum pci_barno bar)
8383
for (func_no = 0; func_no < funcs; func_no++)
8484
__dw_pcie_ep_reset_bar(pci, func_no, bar, 0);
8585
}
86+
EXPORT_SYMBOL_GPL(dw_pcie_ep_reset_bar);
8687

8788
static u8 __dw_pcie_ep_find_next_cap(struct dw_pcie_ep *ep, u8 func_no,
8889
u8 cap_ptr, u8 cap)
@@ -485,6 +486,7 @@ int dw_pcie_ep_raise_legacy_irq(struct dw_pcie_ep *ep, u8 func_no)
485486

486487
return -EINVAL;
487488
}
489+
EXPORT_SYMBOL_GPL(dw_pcie_ep_raise_legacy_irq);
488490

489491
int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no,
490492
u8 interrupt_num)
@@ -536,6 +538,7 @@ int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no,
536538

537539
return 0;
538540
}
541+
EXPORT_SYMBOL_GPL(dw_pcie_ep_raise_msi_irq);
539542

540543
int dw_pcie_ep_raise_msix_irq_doorbell(struct dw_pcie_ep *ep, u8 func_no,
541544
u16 interrupt_num)

0 commit comments

Comments
 (0)