Skip to content

Commit 0c4ffcf

Browse files
Murali Karicheribjorn-helgaas
authored andcommitted
PCI: keystone: Add TI Keystone PCIe driver
The Keystone PCIe controller is based on v3.65 version of the Designware h/w. Main differences are: 1. No ATU support 2. Legacy and MSI IRQ functions are implemented in application register space 3. MSI interrupts are multiplexed over 8 IRQ lines to the Host side. All of the application register space handing code is organized into pci-keystone-dw.c and the functions are called from pci-keystone.c to implement PCI controller driver. Also add necessary DT documentation and update the MAINTAINERS file for the driver. [bhelgaas: spelling and whitespace fixes] Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> CC: Russell King <linux@arm.linux.org.uk> CC: Grant Likely <grant.likely@linaro.org> CC: Rob Herring <robh+dt@kernel.org> CC: Mohit Kumar <mohit.kumar@st.com> CC: Pratyush Anand <pratyush.anand@st.com> CC: Jingoo Han <jg1.han@samsung.com> CC: Richard Zhu <r65037@freescale.com> CC: Kishon Vijay Abraham I <kishon@ti.com> CC: Marek Vasut <marex@denx.de> CC: Arnd Bergmann <arnd@arndb.de> CC: Pawel Moll <pawel.moll@arm.com> CC: Mark Rutland <mark.rutland@arm.com> CC: Ian Campbell <ijc+devicetree@hellion.org.uk> CC: Kumar Gala <galak@codeaurora.org> CC: Randy Dunlap <rdunlap@infradead.org> CC: Grant Likely <grant.likely@linaro.org>
1 parent b14a3d1 commit 0c4ffcf

7 files changed

Lines changed: 1046 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
TI Keystone PCIe interface
2+
3+
Keystone PCI host Controller is based on Designware PCI h/w version 3.65.
4+
It shares common functions with PCIe Designware core driver and inherit
5+
common properties defined in
6+
Documentation/devicetree/bindings/pci/designware-pci.txt
7+
8+
Please refer to Documentation/devicetree/bindings/pci/designware-pci.txt
9+
for the details of Designware DT bindings. Additional properties are
10+
described here as well as properties that are not applicable.
11+
12+
Required Properties:-
13+
14+
compatibility: "ti,keystone-pcie"
15+
reg: index 1 is the base address and length of DW application registers.
16+
index 2 is the base address and length of PCI mode configuration
17+
register.
18+
index 3 is the base address and length of PCI device ID register.
19+
20+
pcie_msi_intc : Interrupt controller device node for MSI IRQ chip
21+
interrupt-cells: should be set to 1
22+
interrupt-parent: Parent interrupt controller phandle
23+
interrupts: GIC interrupt lines connected to PCI MSI interrupt lines
24+
25+
Example:
26+
pcie_msi_intc: msi-interrupt-controller {
27+
interrupt-controller;
28+
#interrupt-cells = <1>;
29+
interrupt-parent = <&gic>;
30+
interrupts = <GIC_SPI 30 IRQ_TYPE_EDGE_RISING>,
31+
<GIC_SPI 31 IRQ_TYPE_EDGE_RISING>,
32+
<GIC_SPI 32 IRQ_TYPE_EDGE_RISING>,
33+
<GIC_SPI 33 IRQ_TYPE_EDGE_RISING>,
34+
<GIC_SPI 34 IRQ_TYPE_EDGE_RISING>,
35+
<GIC_SPI 35 IRQ_TYPE_EDGE_RISING>,
36+
<GIC_SPI 36 IRQ_TYPE_EDGE_RISING>,
37+
<GIC_SPI 37 IRQ_TYPE_EDGE_RISING>;
38+
};
39+
40+
pcie_intc: Interrupt controller device node for Legacy IRQ chip
41+
interrupt-cells: should be set to 1
42+
interrupt-parent: Parent interrupt controller phandle
43+
interrupts: GIC interrupt lines connected to PCI Legacy interrupt lines
44+
45+
Example:
46+
pcie_intc: legacy-interrupt-controller {
47+
interrupt-controller;
48+
#interrupt-cells = <1>;
49+
interrupt-parent = <&gic>;
50+
interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>,
51+
<GIC_SPI 27 IRQ_TYPE_EDGE_RISING>,
52+
<GIC_SPI 28 IRQ_TYPE_EDGE_RISING>,
53+
<GIC_SPI 29 IRQ_TYPE_EDGE_RISING>;
54+
};
55+
56+
Optional properties:-
57+
phys: phandle to Generic Keystone SerDes phy for PCI
58+
phy-names: name of the Generic Keystine SerDes phy for PCI
59+
- If boot loader already does PCI link establishment, then phys and
60+
phy-names shouldn't be present.
61+
62+
Designware DT Properties not applicable for Keystone PCI
63+
64+
1. pcie_bus clock-names not used. Instead, a phandle to phys is used.
65+
66+
Note for PCI driver usage
67+
=========================
68+
Driver requires pci=pcie_bus_perf in the bootargs for proper functioning.

‎MAINTAINERS‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6876,6 +6876,13 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
68766876
S: Maintained
68776877
F: drivers/pci/host/*imx6*
68786878

6879+
PCI DRIVER FOR TI KEYSTONE
6880+
M: Murali Karicheri <m-karicheri2@ti.com>
6881+
L: linux-pci@vger.kernel.org
6882+
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
6883+
S: Maintained
6884+
F: drivers/pci/host/*keystone*
6885+
68796886
PCI DRIVER FOR MVEBU (Marvell Armada 370 and Armada XP SOC support)
68806887
M: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
68816888
M: Jason Cooper <jason@lakedaemon.net>

‎drivers/pci/host/Kconfig‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,14 @@ config PCIE_SPEAR13XX
6363
help
6464
Say Y here if you want PCIe support on SPEAr13XX SoCs.
6565

66+
config PCI_KEYSTONE
67+
bool "TI Keystone PCIe controller"
68+
depends on ARCH_KEYSTONE
69+
select PCIE_DW
70+
select PCIEPORTBUS
71+
help
72+
Say Y here if you want to enable PCI controller support on Keystone
73+
SoCs. The PCI controller on Keystone is based on Designware hardware
74+
and therefore the driver re-uses the Designware core functions to
75+
implement the driver.
6676
endmenu

‎drivers/pci/host/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ obj-$(CONFIG_PCI_RCAR_GEN2) += pci-rcar-gen2.o
88
obj-$(CONFIG_PCI_RCAR_GEN2_PCIE) += pcie-rcar.o
99
obj-$(CONFIG_PCI_HOST_GENERIC) += pci-host-generic.o
1010
obj-$(CONFIG_PCIE_SPEAR13XX) += pcie-spear13xx.o
11+
obj-$(CONFIG_PCI_KEYSTONE) += pci-keystone-dw.o pci-keystone.o

0 commit comments

Comments
 (0)