xref: /freebsd/sys/contrib/device-tree/Bindings/pci/apple,pcie.yaml (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
18cc087a1SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28cc087a1SEmmanuel Vadot%YAML 1.2
38cc087a1SEmmanuel Vadot---
48cc087a1SEmmanuel Vadot$id: http://devicetree.org/schemas/pci/apple,pcie.yaml#
58cc087a1SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
68cc087a1SEmmanuel Vadot
78cc087a1SEmmanuel Vadottitle: Apple PCIe host controller
88cc087a1SEmmanuel Vadot
98cc087a1SEmmanuel Vadotmaintainers:
108cc087a1SEmmanuel Vadot  - Mark Kettenis <kettenis@openbsd.org>
118cc087a1SEmmanuel Vadot
128cc087a1SEmmanuel Vadotdescription: |
138cc087a1SEmmanuel Vadot  The Apple PCIe host controller is a PCIe host controller with
148cc087a1SEmmanuel Vadot  multiple root ports present in Apple ARM SoC platforms, including
158cc087a1SEmmanuel Vadot  various iPhone and iPad devices and the "Apple Silicon" Macs.
168cc087a1SEmmanuel Vadot  The controller incorporates Synopsys DesigWare PCIe logic to
178cc087a1SEmmanuel Vadot  implements its root ports.  But the ATU found on most DesignWare
188cc087a1SEmmanuel Vadot  PCIe host bridges is absent.
198cc087a1SEmmanuel Vadot
208cc087a1SEmmanuel Vadot  All root ports share a single ECAM space, but separate GPIOs are
218cc087a1SEmmanuel Vadot  used to take the PCI devices on those ports out of reset.  Therefore
228cc087a1SEmmanuel Vadot  the standard "reset-gpios" and "max-link-speed" properties appear on
238cc087a1SEmmanuel Vadot  the child nodes that represent the PCI bridges that correspond to
248cc087a1SEmmanuel Vadot  the individual root ports.
258cc087a1SEmmanuel Vadot
268cc087a1SEmmanuel Vadot  MSIs are handled by the PCIe controller and translated into regular
278cc087a1SEmmanuel Vadot  interrupts.  A range of 32 MSIs is provided.  These 32 MSIs can be
288cc087a1SEmmanuel Vadot  distributed over the root ports as the OS sees fit by programming
298cc087a1SEmmanuel Vadot  the PCIe controller's port registers.
308cc087a1SEmmanuel Vadot
318cc087a1SEmmanuel Vadotproperties:
328cc087a1SEmmanuel Vadot  compatible:
338cc087a1SEmmanuel Vadot    items:
34e67e8565SEmmanuel Vadot      - enum:
35e67e8565SEmmanuel Vadot          - apple,t8103-pcie
36fac71e4eSEmmanuel Vadot          - apple,t8112-pcie
37e67e8565SEmmanuel Vadot          - apple,t6000-pcie
388cc087a1SEmmanuel Vadot      - const: apple,pcie
398cc087a1SEmmanuel Vadot
408cc087a1SEmmanuel Vadot  reg:
418cc087a1SEmmanuel Vadot    minItems: 3
42e67e8565SEmmanuel Vadot    maxItems: 6
438cc087a1SEmmanuel Vadot
448cc087a1SEmmanuel Vadot  reg-names:
458cc087a1SEmmanuel Vadot    minItems: 3
468cc087a1SEmmanuel Vadot    items:
478cc087a1SEmmanuel Vadot      - const: config
488cc087a1SEmmanuel Vadot      - const: rc
498cc087a1SEmmanuel Vadot      - const: port0
508cc087a1SEmmanuel Vadot      - const: port1
518cc087a1SEmmanuel Vadot      - const: port2
52e67e8565SEmmanuel Vadot      - const: port3
538cc087a1SEmmanuel Vadot
548cc087a1SEmmanuel Vadot  ranges:
558cc087a1SEmmanuel Vadot    minItems: 2
568cc087a1SEmmanuel Vadot    maxItems: 2
578cc087a1SEmmanuel Vadot
588cc087a1SEmmanuel Vadot  interrupts:
598cc087a1SEmmanuel Vadot    description:
608cc087a1SEmmanuel Vadot      Interrupt specifiers, one for each root port.
618cc087a1SEmmanuel Vadot    minItems: 1
62e67e8565SEmmanuel Vadot    maxItems: 4
638cc087a1SEmmanuel Vadot
648cc087a1SEmmanuel Vadot  msi-parent: true
658cc087a1SEmmanuel Vadot
668cc087a1SEmmanuel Vadot  msi-ranges:
678cc087a1SEmmanuel Vadot    maxItems: 1
688cc087a1SEmmanuel Vadot
698cc087a1SEmmanuel Vadot  iommu-map: true
708cc087a1SEmmanuel Vadot  iommu-map-mask: true
718cc087a1SEmmanuel Vadot
72d5b0e70fSEmmanuel Vadot  power-domains:
73d5b0e70fSEmmanuel Vadot    maxItems: 1
74d5b0e70fSEmmanuel Vadot
758cc087a1SEmmanuel Vadotrequired:
768cc087a1SEmmanuel Vadot  - compatible
778cc087a1SEmmanuel Vadot  - reg
788cc087a1SEmmanuel Vadot  - reg-names
798cc087a1SEmmanuel Vadot  - bus-range
808cc087a1SEmmanuel Vadot  - interrupts
818cc087a1SEmmanuel Vadot  - msi-controller
828cc087a1SEmmanuel Vadot  - msi-parent
838cc087a1SEmmanuel Vadot  - msi-ranges
848cc087a1SEmmanuel Vadot
858cc087a1SEmmanuel VadotunevaluatedProperties: false
868cc087a1SEmmanuel Vadot
87e67e8565SEmmanuel VadotallOf:
88*7d0873ebSEmmanuel Vadot  - $ref: /schemas/pci/pci-host-bridge.yaml#
89e67e8565SEmmanuel Vadot  - $ref: /schemas/interrupt-controller/msi-controller.yaml#
90e67e8565SEmmanuel Vadot  - if:
91e67e8565SEmmanuel Vadot      properties:
92e67e8565SEmmanuel Vadot        compatible:
93e67e8565SEmmanuel Vadot          contains:
94e67e8565SEmmanuel Vadot            const: apple,t8103-pcie
95e67e8565SEmmanuel Vadot    then:
96e67e8565SEmmanuel Vadot      properties:
97e67e8565SEmmanuel Vadot        reg:
98e67e8565SEmmanuel Vadot          maxItems: 5
99e67e8565SEmmanuel Vadot        interrupts:
100e67e8565SEmmanuel Vadot          maxItems: 3
101e67e8565SEmmanuel Vadot
1028cc087a1SEmmanuel Vadotexamples:
1038cc087a1SEmmanuel Vadot  - |
1048cc087a1SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/apple-aic.h>
1058cc087a1SEmmanuel Vadot
1068cc087a1SEmmanuel Vadot    soc {
1078cc087a1SEmmanuel Vadot      #address-cells = <2>;
1088cc087a1SEmmanuel Vadot      #size-cells = <2>;
1098cc087a1SEmmanuel Vadot
1108cc087a1SEmmanuel Vadot      pcie0: pcie@690000000 {
1118cc087a1SEmmanuel Vadot        compatible = "apple,t8103-pcie", "apple,pcie";
1128cc087a1SEmmanuel Vadot        device_type = "pci";
1138cc087a1SEmmanuel Vadot
1148cc087a1SEmmanuel Vadot        reg = <0x6 0x90000000 0x0 0x1000000>,
1158cc087a1SEmmanuel Vadot              <0x6 0x80000000 0x0 0x100000>,
1168cc087a1SEmmanuel Vadot              <0x6 0x81000000 0x0 0x4000>,
1178cc087a1SEmmanuel Vadot              <0x6 0x82000000 0x0 0x4000>,
1188cc087a1SEmmanuel Vadot              <0x6 0x83000000 0x0 0x4000>;
1198cc087a1SEmmanuel Vadot        reg-names = "config", "rc", "port0", "port1", "port2";
1208cc087a1SEmmanuel Vadot
1218cc087a1SEmmanuel Vadot        interrupt-parent = <&aic>;
1228cc087a1SEmmanuel Vadot        interrupts = <AIC_IRQ 695 IRQ_TYPE_LEVEL_HIGH>,
1238cc087a1SEmmanuel Vadot                     <AIC_IRQ 698 IRQ_TYPE_LEVEL_HIGH>,
1248cc087a1SEmmanuel Vadot                     <AIC_IRQ 701 IRQ_TYPE_LEVEL_HIGH>;
1258cc087a1SEmmanuel Vadot
1268cc087a1SEmmanuel Vadot        msi-controller;
1278cc087a1SEmmanuel Vadot        msi-parent = <&pcie0>;
1288cc087a1SEmmanuel Vadot        msi-ranges = <&aic AIC_IRQ 704 IRQ_TYPE_EDGE_RISING 32>;
1298cc087a1SEmmanuel Vadot
1308cc087a1SEmmanuel Vadot        iommu-map = <0x100 &dart0 1 1>,
1318cc087a1SEmmanuel Vadot                    <0x200 &dart1 1 1>,
1328cc087a1SEmmanuel Vadot                    <0x300 &dart2 1 1>;
1338cc087a1SEmmanuel Vadot        iommu-map-mask = <0xff00>;
1348cc087a1SEmmanuel Vadot
1358cc087a1SEmmanuel Vadot        bus-range = <0 3>;
1368cc087a1SEmmanuel Vadot        #address-cells = <3>;
1378cc087a1SEmmanuel Vadot        #size-cells = <2>;
1388cc087a1SEmmanuel Vadot        ranges = <0x43000000 0x6 0xa0000000 0x6 0xa0000000 0x0 0x20000000>,
1398cc087a1SEmmanuel Vadot                 <0x02000000 0x0 0xc0000000 0x6 0xc0000000 0x0 0x40000000>;
1408cc087a1SEmmanuel Vadot
141d5b0e70fSEmmanuel Vadot        power-domains = <&ps_apcie_gp>;
1428cc087a1SEmmanuel Vadot        pinctrl-0 = <&pcie_pins>;
1438cc087a1SEmmanuel Vadot        pinctrl-names = "default";
1448cc087a1SEmmanuel Vadot
1458cc087a1SEmmanuel Vadot        pci@0,0 {
1468cc087a1SEmmanuel Vadot          device_type = "pci";
1478cc087a1SEmmanuel Vadot          reg = <0x0 0x0 0x0 0x0 0x0>;
1488cc087a1SEmmanuel Vadot          reset-gpios = <&pinctrl_ap 152 0>;
1498cc087a1SEmmanuel Vadot
1508cc087a1SEmmanuel Vadot          #address-cells = <3>;
1518cc087a1SEmmanuel Vadot          #size-cells = <2>;
1528cc087a1SEmmanuel Vadot          ranges;
1538cc087a1SEmmanuel Vadot        };
1548cc087a1SEmmanuel Vadot
1558cc087a1SEmmanuel Vadot        pci@1,0 {
1568cc087a1SEmmanuel Vadot          device_type = "pci";
1578cc087a1SEmmanuel Vadot          reg = <0x800 0x0 0x0 0x0 0x0>;
1588cc087a1SEmmanuel Vadot          reset-gpios = <&pinctrl_ap 153 0>;
1598cc087a1SEmmanuel Vadot
1608cc087a1SEmmanuel Vadot          #address-cells = <3>;
1618cc087a1SEmmanuel Vadot          #size-cells = <2>;
1628cc087a1SEmmanuel Vadot          ranges;
1638cc087a1SEmmanuel Vadot        };
1648cc087a1SEmmanuel Vadot
1658cc087a1SEmmanuel Vadot        pci@2,0 {
1668cc087a1SEmmanuel Vadot          device_type = "pci";
1678cc087a1SEmmanuel Vadot          reg = <0x1000 0x0 0x0 0x0 0x0>;
1688cc087a1SEmmanuel Vadot          reset-gpios = <&pinctrl_ap 33 0>;
1698cc087a1SEmmanuel Vadot
1708cc087a1SEmmanuel Vadot          #address-cells = <3>;
1718cc087a1SEmmanuel Vadot          #size-cells = <2>;
1728cc087a1SEmmanuel Vadot          ranges;
1738cc087a1SEmmanuel Vadot        };
1748cc087a1SEmmanuel Vadot      };
1758cc087a1SEmmanuel Vadot    };
176