Skip to content

Commit f92d9ee

Browse files
committed
Merge branch 'pci/host-xgene' into next
* pci/host-xgene: arm64: dts: Add APM X-Gene PCIe device tree nodes PCI: xgene: Add APM X-Gene PCIe driver Conflicts: drivers/pci/host/Kconfig drivers/pci/host/Makefile
2 parents 55dd417 + 767ebaf commit f92d9ee

7 files changed

Lines changed: 908 additions & 1 deletion

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
* AppliedMicro X-Gene PCIe interface
2+
3+
Required properties:
4+
- device_type: set to "pci"
5+
- compatible: should contain "apm,xgene-pcie" to identify the core.
6+
- reg: A list of physical base address and length for each set of controller
7+
registers. Must contain an entry for each entry in the reg-names
8+
property.
9+
- reg-names: Must include the following entries:
10+
"csr": controller configuration registers.
11+
"cfg": pcie configuration space registers.
12+
- #address-cells: set to <3>
13+
- #size-cells: set to <2>
14+
- ranges: ranges for the outbound memory, I/O regions.
15+
- dma-ranges: ranges for the inbound memory regions.
16+
- #interrupt-cells: set to <1>
17+
- interrupt-map-mask and interrupt-map: standard PCI properties
18+
to define the mapping of the PCIe interface to interrupt
19+
numbers.
20+
- clocks: from common clock binding: handle to pci clock.
21+
22+
Optional properties:
23+
- status: Either "ok" or "disabled".
24+
- dma-coherent: Present if dma operations are coherent
25+
26+
Example:
27+
28+
SoC specific DT Entry:
29+
30+
pcie0: pcie@1f2b0000 {
31+
status = "disabled";
32+
device_type = "pci";
33+
compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie";
34+
#interrupt-cells = <1>;
35+
#size-cells = <2>;
36+
#address-cells = <3>;
37+
reg = < 0x00 0x1f2b0000 0x0 0x00010000 /* Controller registers */
38+
0xe0 0xd0000000 0x0 0x00040000>; /* PCI config space */
39+
reg-names = "csr", "cfg";
40+
ranges = <0x01000000 0x00 0x00000000 0xe0 0x10000000 0x00 0x00010000 /* io */
41+
0x02000000 0x00 0x80000000 0xe1 0x80000000 0x00 0x80000000>; /* mem */
42+
dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000
43+
0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>;
44+
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
45+
interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xc2 0x1
46+
0x0 0x0 0x0 0x2 &gic 0x0 0xc3 0x1
47+
0x0 0x0 0x0 0x3 &gic 0x0 0xc4 0x1
48+
0x0 0x0 0x0 0x4 &gic 0x0 0xc5 0x1>;
49+
dma-coherent;
50+
clocks = <&pcie0clk 0>;
51+
};
52+
53+
54+
Board specific DT Entry:
55+
&pcie0 {
56+
status = "ok";
57+
};

‎MAINTAINERS‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6868,6 +6868,14 @@ F: include/linux/pci*
68686868
F: arch/x86/pci/
68696869
F: arch/x86/kernel/quirks.c
68706870

6871+
PCI DRIVER FOR APPLIEDMICRO XGENE
6872+
M: Tanmay Inamdar <tinamdar@apm.com>
6873+
L: linux-pci@vger.kernel.org
6874+
L: linux-arm-kernel@lists.infradead.org
6875+
S: Maintained
6876+
F: Documentation/devicetree/bindings/pci/xgene-pci.txt
6877+
F: drivers/pci/host/pci-xgene.c
6878+
68716879
PCI DRIVER FOR IMX6
68726880
M: Richard Zhu <r65037@freescale.com>
68736881
M: Lucas Stach <l.stach@pengutronix.de>

‎arch/arm64/boot/dts/apm-mustang.dts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
};
2626
};
2727

28+
&pcie0clk {
29+
status = "ok";
30+
};
31+
32+
&pcie0 {
33+
status = "ok";
34+
};
35+
2836
&serial0 {
2937
status = "ok";
3038
};

‎arch/arm64/boot/dts/apm-storm.dtsi‎

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,171 @@
269269
enable-mask = <0x2>;
270270
clock-output-names = "rtcclk";
271271
};
272+
273+
pcie0clk: pcie0clk@1f2bc000 {
274+
status = "disabled";
275+
compatible = "apm,xgene-device-clock";
276+
#clock-cells = <1>;
277+
clocks = <&socplldiv2 0>;
278+
reg = <0x0 0x1f2bc000 0x0 0x1000>;
279+
reg-names = "csr-reg";
280+
clock-output-names = "pcie0clk";
281+
};
282+
283+
pcie1clk: pcie1clk@1f2cc000 {
284+
status = "disabled";
285+
compatible = "apm,xgene-device-clock";
286+
#clock-cells = <1>;
287+
clocks = <&socplldiv2 0>;
288+
reg = <0x0 0x1f2cc000 0x0 0x1000>;
289+
reg-names = "csr-reg";
290+
clock-output-names = "pcie1clk";
291+
};
292+
293+
pcie2clk: pcie2clk@1f2dc000 {
294+
status = "disabled";
295+
compatible = "apm,xgene-device-clock";
296+
#clock-cells = <1>;
297+
clocks = <&socplldiv2 0>;
298+
reg = <0x0 0x1f2dc000 0x0 0x1000>;
299+
reg-names = "csr-reg";
300+
clock-output-names = "pcie2clk";
301+
};
302+
303+
pcie3clk: pcie3clk@1f50c000 {
304+
status = "disabled";
305+
compatible = "apm,xgene-device-clock";
306+
#clock-cells = <1>;
307+
clocks = <&socplldiv2 0>;
308+
reg = <0x0 0x1f50c000 0x0 0x1000>;
309+
reg-names = "csr-reg";
310+
clock-output-names = "pcie3clk";
311+
};
312+
313+
pcie4clk: pcie4clk@1f51c000 {
314+
status = "disabled";
315+
compatible = "apm,xgene-device-clock";
316+
#clock-cells = <1>;
317+
clocks = <&socplldiv2 0>;
318+
reg = <0x0 0x1f51c000 0x0 0x1000>;
319+
reg-names = "csr-reg";
320+
clock-output-names = "pcie4clk";
321+
};
322+
};
323+
324+
pcie0: pcie@1f2b0000 {
325+
status = "disabled";
326+
device_type = "pci";
327+
compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie";
328+
#interrupt-cells = <1>;
329+
#size-cells = <2>;
330+
#address-cells = <3>;
331+
reg = < 0x00 0x1f2b0000 0x0 0x00010000 /* Controller registers */
332+
0xe0 0xd0000000 0x0 0x00040000>; /* PCI config space */
333+
reg-names = "csr", "cfg";
334+
ranges = <0x01000000 0x00 0x00000000 0xe0 0x10000000 0x00 0x00010000 /* io */
335+
0x02000000 0x00 0x80000000 0xe1 0x80000000 0x00 0x80000000>; /* mem */
336+
dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000
337+
0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>;
338+
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
339+
interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xc2 0x1
340+
0x0 0x0 0x0 0x2 &gic 0x0 0xc3 0x1
341+
0x0 0x0 0x0 0x3 &gic 0x0 0xc4 0x1
342+
0x0 0x0 0x0 0x4 &gic 0x0 0xc5 0x1>;
343+
dma-coherent;
344+
clocks = <&pcie0clk 0>;
345+
};
346+
347+
pcie1: pcie@1f2c0000 {
348+
status = "disabled";
349+
device_type = "pci";
350+
compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie";
351+
#interrupt-cells = <1>;
352+
#size-cells = <2>;
353+
#address-cells = <3>;
354+
reg = < 0x00 0x1f2c0000 0x0 0x00010000 /* Controller registers */
355+
0xd0 0xd0000000 0x0 0x00040000>; /* PCI config space */
356+
reg-names = "csr", "cfg";
357+
ranges = <0x01000000 0x0 0x00000000 0xd0 0x10000000 0x00 0x00010000 /* io */
358+
0x02000000 0x0 0x80000000 0xd1 0x80000000 0x00 0x80000000>; /* mem */
359+
dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000
360+
0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>;
361+
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
362+
interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xc8 0x1
363+
0x0 0x0 0x0 0x2 &gic 0x0 0xc9 0x1
364+
0x0 0x0 0x0 0x3 &gic 0x0 0xca 0x1
365+
0x0 0x0 0x0 0x4 &gic 0x0 0xcb 0x1>;
366+
dma-coherent;
367+
clocks = <&pcie1clk 0>;
368+
};
369+
370+
pcie2: pcie@1f2d0000 {
371+
status = "disabled";
372+
device_type = "pci";
373+
compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie";
374+
#interrupt-cells = <1>;
375+
#size-cells = <2>;
376+
#address-cells = <3>;
377+
reg = < 0x00 0x1f2d0000 0x0 0x00010000 /* Controller registers */
378+
0x90 0xd0000000 0x0 0x00040000>; /* PCI config space */
379+
reg-names = "csr", "cfg";
380+
ranges = <0x01000000 0x0 0x00000000 0x90 0x10000000 0x0 0x00010000 /* io */
381+
0x02000000 0x0 0x80000000 0x91 0x80000000 0x0 0x80000000>; /* mem */
382+
dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000
383+
0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>;
384+
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
385+
interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xce 0x1
386+
0x0 0x0 0x0 0x2 &gic 0x0 0xcf 0x1
387+
0x0 0x0 0x0 0x3 &gic 0x0 0xd0 0x1
388+
0x0 0x0 0x0 0x4 &gic 0x0 0xd1 0x1>;
389+
dma-coherent;
390+
clocks = <&pcie2clk 0>;
391+
};
392+
393+
pcie3: pcie@1f500000 {
394+
status = "disabled";
395+
device_type = "pci";
396+
compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie";
397+
#interrupt-cells = <1>;
398+
#size-cells = <2>;
399+
#address-cells = <3>;
400+
reg = < 0x00 0x1f500000 0x0 0x00010000 /* Controller registers */
401+
0xa0 0xd0000000 0x0 0x00040000>; /* PCI config space */
402+
reg-names = "csr", "cfg";
403+
ranges = <0x01000000 0x0 0x00000000 0xa0 0x10000000 0x0 0x00010000 /* io */
404+
0x02000000 0x0 0x80000000 0xa1 0x80000000 0x0 0x80000000>; /* mem */
405+
dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000
406+
0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>;
407+
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
408+
interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xd4 0x1
409+
0x0 0x0 0x0 0x2 &gic 0x0 0xd5 0x1
410+
0x0 0x0 0x0 0x3 &gic 0x0 0xd6 0x1
411+
0x0 0x0 0x0 0x4 &gic 0x0 0xd7 0x1>;
412+
dma-coherent;
413+
clocks = <&pcie3clk 0>;
414+
};
415+
416+
pcie4: pcie@1f510000 {
417+
status = "disabled";
418+
device_type = "pci";
419+
compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie";
420+
#interrupt-cells = <1>;
421+
#size-cells = <2>;
422+
#address-cells = <3>;
423+
reg = < 0x00 0x1f510000 0x0 0x00010000 /* Controller registers */
424+
0xc0 0xd0000000 0x0 0x00200000>; /* PCI config space */
425+
reg-names = "csr", "cfg";
426+
ranges = <0x01000000 0x0 0x00000000 0xc0 0x10000000 0x0 0x00010000 /* io */
427+
0x02000000 0x0 0x80000000 0xc1 0x80000000 0x0 0x80000000>; /* mem */
428+
dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000
429+
0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>;
430+
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
431+
interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xda 0x1
432+
0x0 0x0 0x0 0x2 &gic 0x0 0xdb 0x1
433+
0x0 0x0 0x0 0x3 &gic 0x0 0xdc 0x1
434+
0x0 0x0 0x0 0x4 &gic 0x0 0xdd 0x1>;
435+
dma-coherent;
436+
clocks = <&pcie4clk 0>;
272437
};
273438

274439
serial0: serial@1c020000 {

‎drivers/pci/host/Kconfig‎

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

66-
6766
config PCI_KEYSTONE
6867
bool "TI Keystone PCIe controller"
6968
depends on ARCH_KEYSTONE
@@ -82,4 +81,14 @@ config PCIE_XILINX
8281
Say 'Y' here if you want kernel to support the Xilinx AXI PCIe
8382
Host Bridge driver.
8483

84+
config PCI_XGENE
85+
bool "X-Gene PCIe controller"
86+
depends on ARCH_XGENE
87+
depends on OF
88+
select PCIEPORTBUS
89+
help
90+
Say Y here if you want internal PCI support on APM X-Gene SoC.
91+
There are 5 internal PCIe ports available. Each port is GEN3 capable
92+
and have varied lanes from x1 to x8.
93+
8594
endmenu

‎drivers/pci/host/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ obj-$(CONFIG_PCI_HOST_GENERIC) += pci-host-generic.o
1010
obj-$(CONFIG_PCIE_SPEAR13XX) += pcie-spear13xx.o
1111
obj-$(CONFIG_PCI_KEYSTONE) += pci-keystone-dw.o pci-keystone.o
1212
obj-$(CONFIG_PCIE_XILINX) += pcie-xilinx.o
13+
obj-$(CONFIG_PCI_XGENE) += pci-xgene.o

0 commit comments

Comments
 (0)