xref: /freebsd/sys/contrib/device-tree/Bindings/pci/mediatek,mt7621-pcie.yaml (revision 0e8011faf58b743cc652e3b2ad0f7671227610df)
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/mediatek,mt7621-pcie.yaml#
58cc087a1SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
68cc087a1SEmmanuel Vadot
78cc087a1SEmmanuel Vadottitle: MediaTek MT7621 PCIe controller
88cc087a1SEmmanuel Vadot
98cc087a1SEmmanuel Vadotmaintainers:
108cc087a1SEmmanuel Vadot  - Sergio Paracuellos <sergio.paracuellos@gmail.com>
118cc087a1SEmmanuel Vadot
128cc087a1SEmmanuel Vadotdescription: |+
138cc087a1SEmmanuel Vadot  MediaTek MT7621 PCIe subsys supports a single Root Complex (RC)
148cc087a1SEmmanuel Vadot  with 3 Root Ports. Each Root Port supports a Gen1 1-lane Link
158cc087a1SEmmanuel Vadot
16*0e8011faSEmmanuel Vadot                          MT7621 PCIe HOST Topology
17*0e8011faSEmmanuel Vadot
18*0e8011faSEmmanuel Vadot                                   .-------.
19*0e8011faSEmmanuel Vadot                                   |       |
20*0e8011faSEmmanuel Vadot                                   |  CPU  |
21*0e8011faSEmmanuel Vadot                                   |       |
22*0e8011faSEmmanuel Vadot                                   '-------'
23*0e8011faSEmmanuel Vadot                                       |
24*0e8011faSEmmanuel Vadot                                       |
25*0e8011faSEmmanuel Vadot                                       |
26*0e8011faSEmmanuel Vadot                                       v
27*0e8011faSEmmanuel Vadot                              .------------------.
28*0e8011faSEmmanuel Vadot                  .-----------|  HOST/PCI Bridge |------------.
29*0e8011faSEmmanuel Vadot                  |           '------------------'            | Type1
30*0e8011faSEmmanuel Vadot             BUS0 |                     |                     | Access
31*0e8011faSEmmanuel Vadot                  v                     v                     v On Bus0
32*0e8011faSEmmanuel Vadot          .-------------.        .-------------.       .-------------.
33*0e8011faSEmmanuel Vadot          | VIRTUAL P2P |        | VIRTUAL P2P |       | VIRTUAL P2P |
34*0e8011faSEmmanuel Vadot          |    BUS0     |        |    BUS0     |       |    BUS0     |
35*0e8011faSEmmanuel Vadot          |    DEV0     |        |    DEV1     |       |    DEV2     |
36*0e8011faSEmmanuel Vadot          '-------------'        '-------------'       '-------------'
37*0e8011faSEmmanuel Vadot    Type0        |          Type0       |         Type0       |
38*0e8011faSEmmanuel Vadot   Access   BUS1 |         Access   BUS2|        Access   BUS3|
39*0e8011faSEmmanuel Vadot   On Bus1       v         On Bus2      v        On Bus3      v
40*0e8011faSEmmanuel Vadot           .----------.           .----------.          .----------.
41*0e8011faSEmmanuel Vadot           | Device 0 |           | Device 0 |          | Device 0 |
42*0e8011faSEmmanuel Vadot           |  Func 0  |           |  Func 0  |          |  Func 0  |
43*0e8011faSEmmanuel Vadot           '----------'           '----------'          '----------'
44*0e8011faSEmmanuel Vadot
458cc087a1SEmmanuel VadotallOf:
467d0873ebSEmmanuel Vadot  - $ref: /schemas/pci/pci-host-bridge.yaml#
478cc087a1SEmmanuel Vadot
488cc087a1SEmmanuel Vadotproperties:
498cc087a1SEmmanuel Vadot  compatible:
508cc087a1SEmmanuel Vadot    const: mediatek,mt7621-pci
518cc087a1SEmmanuel Vadot
528cc087a1SEmmanuel Vadot  reg:
538cc087a1SEmmanuel Vadot    items:
548cc087a1SEmmanuel Vadot      - description: host-pci bridge registers
558cc087a1SEmmanuel Vadot      - description: pcie port 0 RC control registers
568cc087a1SEmmanuel Vadot      - description: pcie port 1 RC control registers
578cc087a1SEmmanuel Vadot      - description: pcie port 2 RC control registers
588cc087a1SEmmanuel Vadot
598cc087a1SEmmanuel Vadot  ranges:
608cc087a1SEmmanuel Vadot    maxItems: 2
618cc087a1SEmmanuel Vadot
628cc087a1SEmmanuel VadotpatternProperties:
638bab661aSEmmanuel Vadot  '^pcie@[0-2],0$':
648cc087a1SEmmanuel Vadot    type: object
657d0873ebSEmmanuel Vadot    $ref: /schemas/pci/pci-pci-bridge.yaml#
668cc087a1SEmmanuel Vadot
678cc087a1SEmmanuel Vadot    properties:
687d0873ebSEmmanuel Vadot      reg:
697d0873ebSEmmanuel Vadot        maxItems: 1
707d0873ebSEmmanuel Vadot
718cc087a1SEmmanuel Vadot      resets:
728cc087a1SEmmanuel Vadot        maxItems: 1
738cc087a1SEmmanuel Vadot
748cc087a1SEmmanuel Vadot      clocks:
758cc087a1SEmmanuel Vadot        maxItems: 1
768cc087a1SEmmanuel Vadot
778cc087a1SEmmanuel Vadot      phys:
788cc087a1SEmmanuel Vadot        maxItems: 1
798cc087a1SEmmanuel Vadot
80e67e8565SEmmanuel Vadot      phy-names:
81e67e8565SEmmanuel Vadot        pattern: '^pcie-phy[0-2]$'
82e67e8565SEmmanuel Vadot
838cc087a1SEmmanuel Vadot    required:
848cc087a1SEmmanuel Vadot      - "#interrupt-cells"
858cc087a1SEmmanuel Vadot      - interrupt-map-mask
868cc087a1SEmmanuel Vadot      - interrupt-map
878cc087a1SEmmanuel Vadot      - resets
888cc087a1SEmmanuel Vadot      - clocks
898cc087a1SEmmanuel Vadot      - phys
908cc087a1SEmmanuel Vadot      - phy-names
918cc087a1SEmmanuel Vadot      - ranges
928cc087a1SEmmanuel Vadot
938cc087a1SEmmanuel Vadot    unevaluatedProperties: false
948cc087a1SEmmanuel Vadot
958cc087a1SEmmanuel Vadotrequired:
968cc087a1SEmmanuel Vadot  - compatible
978cc087a1SEmmanuel Vadot  - reg
988cc087a1SEmmanuel Vadot  - ranges
998cc087a1SEmmanuel Vadot  - "#interrupt-cells"
1008cc087a1SEmmanuel Vadot  - interrupt-map-mask
1018cc087a1SEmmanuel Vadot  - interrupt-map
1028cc087a1SEmmanuel Vadot  - reset-gpios
1038cc087a1SEmmanuel Vadot
1048cc087a1SEmmanuel VadotunevaluatedProperties: false
1058cc087a1SEmmanuel Vadot
1068cc087a1SEmmanuel Vadotexamples:
1078cc087a1SEmmanuel Vadot  - |
1088cc087a1SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
1098cc087a1SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/mips-gic.h>
1108cc087a1SEmmanuel Vadot
1118cc087a1SEmmanuel Vadot    pcie: pcie@1e140000 {
1128cc087a1SEmmanuel Vadot        compatible = "mediatek,mt7621-pci";
1138cc087a1SEmmanuel Vadot        reg = <0x1e140000 0x100>,
1148cc087a1SEmmanuel Vadot              <0x1e142000 0x100>,
1158cc087a1SEmmanuel Vadot              <0x1e143000 0x100>,
1168cc087a1SEmmanuel Vadot              <0x1e144000 0x100>;
1178cc087a1SEmmanuel Vadot
1188cc087a1SEmmanuel Vadot        #address-cells = <3>;
1198cc087a1SEmmanuel Vadot        #size-cells = <2>;
1208cc087a1SEmmanuel Vadot        pinctrl-names = "default";
1218cc087a1SEmmanuel Vadot        pinctrl-0 = <&pcie_pins>;
1228cc087a1SEmmanuel Vadot        device_type = "pci";
1238cc087a1SEmmanuel Vadot        ranges = <0x02000000 0 0x60000000 0x60000000 0 0x10000000>,  /* pci memory */
1248cc087a1SEmmanuel Vadot                 <0x01000000 0 0x1e160000 0x1e160000 0 0x00010000>;  /* io space */
1258cc087a1SEmmanuel Vadot        #interrupt-cells = <1>;
1268cc087a1SEmmanuel Vadot        interrupt-map-mask = <0xF800 0 0 0>;
1278cc087a1SEmmanuel Vadot        interrupt-map = <0x0000 0 0 0 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>,
1288cc087a1SEmmanuel Vadot                        <0x0800 0 0 0 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>,
1298cc087a1SEmmanuel Vadot                        <0x1000 0 0 0 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
1308cc087a1SEmmanuel Vadot        reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
1318cc087a1SEmmanuel Vadot
1328cc087a1SEmmanuel Vadot        pcie@0,0 {
1338cc087a1SEmmanuel Vadot            reg = <0x0000 0 0 0 0>;
1348cc087a1SEmmanuel Vadot            #address-cells = <3>;
1358cc087a1SEmmanuel Vadot            #size-cells = <2>;
1368cc087a1SEmmanuel Vadot            device_type = "pci";
1378cc087a1SEmmanuel Vadot            #interrupt-cells = <1>;
1388cc087a1SEmmanuel Vadot            interrupt-map-mask = <0 0 0 0>;
1398cc087a1SEmmanuel Vadot            interrupt-map = <0 0 0 0 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>;
1408cc087a1SEmmanuel Vadot            resets = <&rstctrl 24>;
1418cc087a1SEmmanuel Vadot            clocks = <&clkctrl 24>;
1428cc087a1SEmmanuel Vadot            phys = <&pcie0_phy 1>;
1438cc087a1SEmmanuel Vadot            phy-names = "pcie-phy0";
1448cc087a1SEmmanuel Vadot            ranges;
1458cc087a1SEmmanuel Vadot        };
1468cc087a1SEmmanuel Vadot
1478cc087a1SEmmanuel Vadot        pcie@1,0 {
1488cc087a1SEmmanuel Vadot            reg = <0x0800 0 0 0 0>;
1498cc087a1SEmmanuel Vadot            #address-cells = <3>;
1508cc087a1SEmmanuel Vadot            #size-cells = <2>;
1518cc087a1SEmmanuel Vadot            device_type = "pci";
1528cc087a1SEmmanuel Vadot            #interrupt-cells = <1>;
1538cc087a1SEmmanuel Vadot            interrupt-map-mask = <0 0 0 0>;
1548cc087a1SEmmanuel Vadot            interrupt-map = <0 0 0 0 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>;
1558cc087a1SEmmanuel Vadot            resets = <&rstctrl 25>;
1568cc087a1SEmmanuel Vadot            clocks = <&clkctrl 25>;
1578cc087a1SEmmanuel Vadot            phys = <&pcie0_phy 1>;
1588cc087a1SEmmanuel Vadot            phy-names = "pcie-phy1";
1598cc087a1SEmmanuel Vadot            ranges;
1608cc087a1SEmmanuel Vadot        };
1618cc087a1SEmmanuel Vadot
1628cc087a1SEmmanuel Vadot        pcie@2,0 {
1638cc087a1SEmmanuel Vadot            reg = <0x1000 0 0 0 0>;
1648cc087a1SEmmanuel Vadot            #address-cells = <3>;
1658cc087a1SEmmanuel Vadot            #size-cells = <2>;
1668cc087a1SEmmanuel Vadot            device_type = "pci";
1678cc087a1SEmmanuel Vadot            #interrupt-cells = <1>;
1688cc087a1SEmmanuel Vadot            interrupt-map-mask = <0 0 0 0>;
1698cc087a1SEmmanuel Vadot            interrupt-map = <0 0 0 0 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
1708cc087a1SEmmanuel Vadot            resets = <&rstctrl 26>;
1718cc087a1SEmmanuel Vadot            clocks = <&clkctrl 26>;
1728cc087a1SEmmanuel Vadot            phys = <&pcie2_phy 0>;
1738cc087a1SEmmanuel Vadot            phy-names = "pcie-phy2";
1748cc087a1SEmmanuel Vadot            ranges;
1758cc087a1SEmmanuel Vadot        };
1768cc087a1SEmmanuel Vadot    };
1778cc087a1SEmmanuel Vadot...
178