xref: /linux/Documentation/devicetree/bindings/pci/apple,pcie.yaml (revision a3b539fedc0910e8113d4b7e6639a70e068c41c0)
1*a3b539feSMark Kettenis# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*a3b539feSMark Kettenis%YAML 1.2
3*a3b539feSMark Kettenis---
4*a3b539feSMark Kettenis$id: http://devicetree.org/schemas/pci/apple,pcie.yaml#
5*a3b539feSMark Kettenis$schema: http://devicetree.org/meta-schemas/core.yaml#
6*a3b539feSMark Kettenis
7*a3b539feSMark Kettenistitle: Apple PCIe host controller
8*a3b539feSMark Kettenis
9*a3b539feSMark Kettenismaintainers:
10*a3b539feSMark Kettenis  - Mark Kettenis <kettenis@openbsd.org>
11*a3b539feSMark Kettenis
12*a3b539feSMark Kettenisdescription: |
13*a3b539feSMark Kettenis  The Apple PCIe host controller is a PCIe host controller with
14*a3b539feSMark Kettenis  multiple root ports present in Apple ARM SoC platforms, including
15*a3b539feSMark Kettenis  various iPhone and iPad devices and the "Apple Silicon" Macs.
16*a3b539feSMark Kettenis  The controller incorporates Synopsys DesigWare PCIe logic to
17*a3b539feSMark Kettenis  implements its root ports.  But the ATU found on most DesignWare
18*a3b539feSMark Kettenis  PCIe host bridges is absent.
19*a3b539feSMark Kettenis
20*a3b539feSMark Kettenis  All root ports share a single ECAM space, but separate GPIOs are
21*a3b539feSMark Kettenis  used to take the PCI devices on those ports out of reset.  Therefore
22*a3b539feSMark Kettenis  the standard "reset-gpios" and "max-link-speed" properties appear on
23*a3b539feSMark Kettenis  the child nodes that represent the PCI bridges that correspond to
24*a3b539feSMark Kettenis  the individual root ports.
25*a3b539feSMark Kettenis
26*a3b539feSMark Kettenis  MSIs are handled by the PCIe controller and translated into regular
27*a3b539feSMark Kettenis  interrupts.  A range of 32 MSIs is provided.  These 32 MSIs can be
28*a3b539feSMark Kettenis  distributed over the root ports as the OS sees fit by programming
29*a3b539feSMark Kettenis  the PCIe controller's port registers.
30*a3b539feSMark Kettenis
31*a3b539feSMark KettenisallOf:
32*a3b539feSMark Kettenis  - $ref: /schemas/pci/pci-bus.yaml#
33*a3b539feSMark Kettenis  - $ref: /schemas/interrupt-controller/msi-controller.yaml#
34*a3b539feSMark Kettenis
35*a3b539feSMark Kettenisproperties:
36*a3b539feSMark Kettenis  compatible:
37*a3b539feSMark Kettenis    items:
38*a3b539feSMark Kettenis      - const: apple,t8103-pcie
39*a3b539feSMark Kettenis      - const: apple,pcie
40*a3b539feSMark Kettenis
41*a3b539feSMark Kettenis  reg:
42*a3b539feSMark Kettenis    minItems: 3
43*a3b539feSMark Kettenis    maxItems: 5
44*a3b539feSMark Kettenis
45*a3b539feSMark Kettenis  reg-names:
46*a3b539feSMark Kettenis    minItems: 3
47*a3b539feSMark Kettenis    items:
48*a3b539feSMark Kettenis      - const: config
49*a3b539feSMark Kettenis      - const: rc
50*a3b539feSMark Kettenis      - const: port0
51*a3b539feSMark Kettenis      - const: port1
52*a3b539feSMark Kettenis      - const: port2
53*a3b539feSMark Kettenis
54*a3b539feSMark Kettenis  ranges:
55*a3b539feSMark Kettenis    minItems: 2
56*a3b539feSMark Kettenis    maxItems: 2
57*a3b539feSMark Kettenis
58*a3b539feSMark Kettenis  interrupts:
59*a3b539feSMark Kettenis    description:
60*a3b539feSMark Kettenis      Interrupt specifiers, one for each root port.
61*a3b539feSMark Kettenis    minItems: 1
62*a3b539feSMark Kettenis    maxItems: 3
63*a3b539feSMark Kettenis
64*a3b539feSMark Kettenis  msi-parent: true
65*a3b539feSMark Kettenis
66*a3b539feSMark Kettenis  msi-ranges:
67*a3b539feSMark Kettenis    maxItems: 1
68*a3b539feSMark Kettenis
69*a3b539feSMark Kettenis  iommu-map: true
70*a3b539feSMark Kettenis  iommu-map-mask: true
71*a3b539feSMark Kettenis
72*a3b539feSMark Kettenisrequired:
73*a3b539feSMark Kettenis  - compatible
74*a3b539feSMark Kettenis  - reg
75*a3b539feSMark Kettenis  - reg-names
76*a3b539feSMark Kettenis  - bus-range
77*a3b539feSMark Kettenis  - interrupts
78*a3b539feSMark Kettenis  - msi-controller
79*a3b539feSMark Kettenis  - msi-parent
80*a3b539feSMark Kettenis  - msi-ranges
81*a3b539feSMark Kettenis
82*a3b539feSMark KettenisunevaluatedProperties: false
83*a3b539feSMark Kettenis
84*a3b539feSMark Kettenisexamples:
85*a3b539feSMark Kettenis  - |
86*a3b539feSMark Kettenis    #include <dt-bindings/interrupt-controller/apple-aic.h>
87*a3b539feSMark Kettenis
88*a3b539feSMark Kettenis    soc {
89*a3b539feSMark Kettenis      #address-cells = <2>;
90*a3b539feSMark Kettenis      #size-cells = <2>;
91*a3b539feSMark Kettenis
92*a3b539feSMark Kettenis      pcie0: pcie@690000000 {
93*a3b539feSMark Kettenis        compatible = "apple,t8103-pcie", "apple,pcie";
94*a3b539feSMark Kettenis        device_type = "pci";
95*a3b539feSMark Kettenis
96*a3b539feSMark Kettenis        reg = <0x6 0x90000000 0x0 0x1000000>,
97*a3b539feSMark Kettenis              <0x6 0x80000000 0x0 0x100000>,
98*a3b539feSMark Kettenis              <0x6 0x81000000 0x0 0x4000>,
99*a3b539feSMark Kettenis              <0x6 0x82000000 0x0 0x4000>,
100*a3b539feSMark Kettenis              <0x6 0x83000000 0x0 0x4000>;
101*a3b539feSMark Kettenis        reg-names = "config", "rc", "port0", "port1", "port2";
102*a3b539feSMark Kettenis
103*a3b539feSMark Kettenis        interrupt-parent = <&aic>;
104*a3b539feSMark Kettenis        interrupts = <AIC_IRQ 695 IRQ_TYPE_LEVEL_HIGH>,
105*a3b539feSMark Kettenis                     <AIC_IRQ 698 IRQ_TYPE_LEVEL_HIGH>,
106*a3b539feSMark Kettenis                     <AIC_IRQ 701 IRQ_TYPE_LEVEL_HIGH>;
107*a3b539feSMark Kettenis
108*a3b539feSMark Kettenis        msi-controller;
109*a3b539feSMark Kettenis        msi-parent = <&pcie0>;
110*a3b539feSMark Kettenis        msi-ranges = <&aic AIC_IRQ 704 IRQ_TYPE_EDGE_RISING 32>;
111*a3b539feSMark Kettenis
112*a3b539feSMark Kettenis        iommu-map = <0x100 &dart0 1 1>,
113*a3b539feSMark Kettenis                    <0x200 &dart1 1 1>,
114*a3b539feSMark Kettenis                    <0x300 &dart2 1 1>;
115*a3b539feSMark Kettenis        iommu-map-mask = <0xff00>;
116*a3b539feSMark Kettenis
117*a3b539feSMark Kettenis        bus-range = <0 3>;
118*a3b539feSMark Kettenis        #address-cells = <3>;
119*a3b539feSMark Kettenis        #size-cells = <2>;
120*a3b539feSMark Kettenis        ranges = <0x43000000 0x6 0xa0000000 0x6 0xa0000000 0x0 0x20000000>,
121*a3b539feSMark Kettenis                 <0x02000000 0x0 0xc0000000 0x6 0xc0000000 0x0 0x40000000>;
122*a3b539feSMark Kettenis
123*a3b539feSMark Kettenis        power-domains = <&ps_apcie>, <&ps_apcie_gp>, <&ps_pcie_ref>;
124*a3b539feSMark Kettenis        pinctrl-0 = <&pcie_pins>;
125*a3b539feSMark Kettenis        pinctrl-names = "default";
126*a3b539feSMark Kettenis
127*a3b539feSMark Kettenis        pci@0,0 {
128*a3b539feSMark Kettenis          device_type = "pci";
129*a3b539feSMark Kettenis          reg = <0x0 0x0 0x0 0x0 0x0>;
130*a3b539feSMark Kettenis          reset-gpios = <&pinctrl_ap 152 0>;
131*a3b539feSMark Kettenis          max-link-speed = <2>;
132*a3b539feSMark Kettenis
133*a3b539feSMark Kettenis          #address-cells = <3>;
134*a3b539feSMark Kettenis          #size-cells = <2>;
135*a3b539feSMark Kettenis          ranges;
136*a3b539feSMark Kettenis        };
137*a3b539feSMark Kettenis
138*a3b539feSMark Kettenis        pci@1,0 {
139*a3b539feSMark Kettenis          device_type = "pci";
140*a3b539feSMark Kettenis          reg = <0x800 0x0 0x0 0x0 0x0>;
141*a3b539feSMark Kettenis          reset-gpios = <&pinctrl_ap 153 0>;
142*a3b539feSMark Kettenis          max-link-speed = <2>;
143*a3b539feSMark Kettenis
144*a3b539feSMark Kettenis          #address-cells = <3>;
145*a3b539feSMark Kettenis          #size-cells = <2>;
146*a3b539feSMark Kettenis          ranges;
147*a3b539feSMark Kettenis        };
148*a3b539feSMark Kettenis
149*a3b539feSMark Kettenis        pci@2,0 {
150*a3b539feSMark Kettenis          device_type = "pci";
151*a3b539feSMark Kettenis          reg = <0x1000 0x0 0x0 0x0 0x0>;
152*a3b539feSMark Kettenis          reset-gpios = <&pinctrl_ap 33 0>;
153*a3b539feSMark Kettenis          max-link-speed = <1>;
154*a3b539feSMark Kettenis
155*a3b539feSMark Kettenis          #address-cells = <3>;
156*a3b539feSMark Kettenis          #size-cells = <2>;
157*a3b539feSMark Kettenis          ranges;
158*a3b539feSMark Kettenis        };
159*a3b539feSMark Kettenis      };
160*a3b539feSMark Kettenis    };
161