1*27cee7d7SSergio Paracuellos# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*27cee7d7SSergio Paracuellos%YAML 1.2
3*27cee7d7SSergio Paracuellos---
4*27cee7d7SSergio Paracuellos$id: http://devicetree.org/schemas/pci/mediatek,mt7621-pcie.yaml#
5*27cee7d7SSergio Paracuellos$schema: http://devicetree.org/meta-schemas/core.yaml#
6*27cee7d7SSergio Paracuellos
7*27cee7d7SSergio Paracuellostitle: MediaTek MT7621 PCIe controller
8*27cee7d7SSergio Paracuellos
9*27cee7d7SSergio Paracuellosmaintainers:
10*27cee7d7SSergio Paracuellos  - Sergio Paracuellos <sergio.paracuellos@gmail.com>
11*27cee7d7SSergio Paracuellos
12*27cee7d7SSergio Paracuellosdescription: |+
13*27cee7d7SSergio Paracuellos  MediaTek MT7621 PCIe subsys supports a single Root Complex (RC)
14*27cee7d7SSergio Paracuellos  with 3 Root Ports. Each Root Port supports a Gen1 1-lane Link
15*27cee7d7SSergio Paracuellos
16*27cee7d7SSergio ParacuellosallOf:
17*27cee7d7SSergio Paracuellos  - $ref: /schemas/pci/pci-bus.yaml#
18*27cee7d7SSergio Paracuellos
19*27cee7d7SSergio Paracuellosproperties:
20*27cee7d7SSergio Paracuellos  compatible:
21*27cee7d7SSergio Paracuellos    const: mediatek,mt7621-pci
22*27cee7d7SSergio Paracuellos
23*27cee7d7SSergio Paracuellos  reg:
24*27cee7d7SSergio Paracuellos    items:
25*27cee7d7SSergio Paracuellos      - description: host-pci bridge registers
26*27cee7d7SSergio Paracuellos      - description: pcie port 0 RC control registers
27*27cee7d7SSergio Paracuellos      - description: pcie port 1 RC control registers
28*27cee7d7SSergio Paracuellos      - description: pcie port 2 RC control registers
29*27cee7d7SSergio Paracuellos
30*27cee7d7SSergio Paracuellos  ranges:
31*27cee7d7SSergio Paracuellos    maxItems: 2
32*27cee7d7SSergio Paracuellos
33*27cee7d7SSergio ParacuellospatternProperties:
34*27cee7d7SSergio Paracuellos  'pcie@[0-2],0':
35*27cee7d7SSergio Paracuellos    type: object
36*27cee7d7SSergio Paracuellos    $ref: /schemas/pci/pci-bus.yaml#
37*27cee7d7SSergio Paracuellos
38*27cee7d7SSergio Paracuellos    properties:
39*27cee7d7SSergio Paracuellos      resets:
40*27cee7d7SSergio Paracuellos        maxItems: 1
41*27cee7d7SSergio Paracuellos
42*27cee7d7SSergio Paracuellos      clocks:
43*27cee7d7SSergio Paracuellos        maxItems: 1
44*27cee7d7SSergio Paracuellos
45*27cee7d7SSergio Paracuellos      phys:
46*27cee7d7SSergio Paracuellos        maxItems: 1
47*27cee7d7SSergio Paracuellos
48*27cee7d7SSergio Paracuellos    required:
49*27cee7d7SSergio Paracuellos      - "#interrupt-cells"
50*27cee7d7SSergio Paracuellos      - interrupt-map-mask
51*27cee7d7SSergio Paracuellos      - interrupt-map
52*27cee7d7SSergio Paracuellos      - resets
53*27cee7d7SSergio Paracuellos      - clocks
54*27cee7d7SSergio Paracuellos      - phys
55*27cee7d7SSergio Paracuellos      - phy-names
56*27cee7d7SSergio Paracuellos      - ranges
57*27cee7d7SSergio Paracuellos
58*27cee7d7SSergio Paracuellos    unevaluatedProperties: false
59*27cee7d7SSergio Paracuellos
60*27cee7d7SSergio Paracuellosrequired:
61*27cee7d7SSergio Paracuellos  - compatible
62*27cee7d7SSergio Paracuellos  - reg
63*27cee7d7SSergio Paracuellos  - ranges
64*27cee7d7SSergio Paracuellos  - "#interrupt-cells"
65*27cee7d7SSergio Paracuellos  - interrupt-map-mask
66*27cee7d7SSergio Paracuellos  - interrupt-map
67*27cee7d7SSergio Paracuellos  - reset-gpios
68*27cee7d7SSergio Paracuellos
69*27cee7d7SSergio ParacuellosunevaluatedProperties: false
70*27cee7d7SSergio Paracuellos
71*27cee7d7SSergio Paracuellosexamples:
72*27cee7d7SSergio Paracuellos  - |
73*27cee7d7SSergio Paracuellos    #include <dt-bindings/gpio/gpio.h>
74*27cee7d7SSergio Paracuellos    #include <dt-bindings/interrupt-controller/mips-gic.h>
75*27cee7d7SSergio Paracuellos
76*27cee7d7SSergio Paracuellos    pcie: pcie@1e140000 {
77*27cee7d7SSergio Paracuellos        compatible = "mediatek,mt7621-pci";
78*27cee7d7SSergio Paracuellos        reg = <0x1e140000 0x100>,
79*27cee7d7SSergio Paracuellos              <0x1e142000 0x100>,
80*27cee7d7SSergio Paracuellos              <0x1e143000 0x100>,
81*27cee7d7SSergio Paracuellos              <0x1e144000 0x100>;
82*27cee7d7SSergio Paracuellos
83*27cee7d7SSergio Paracuellos        #address-cells = <3>;
84*27cee7d7SSergio Paracuellos        #size-cells = <2>;
85*27cee7d7SSergio Paracuellos        pinctrl-names = "default";
86*27cee7d7SSergio Paracuellos        pinctrl-0 = <&pcie_pins>;
87*27cee7d7SSergio Paracuellos        device_type = "pci";
88*27cee7d7SSergio Paracuellos        ranges = <0x02000000 0 0x60000000 0x60000000 0 0x10000000>,  /* pci memory */
89*27cee7d7SSergio Paracuellos                 <0x01000000 0 0x1e160000 0x1e160000 0 0x00010000>;  /* io space */
90*27cee7d7SSergio Paracuellos        #interrupt-cells = <1>;
91*27cee7d7SSergio Paracuellos        interrupt-map-mask = <0xF800 0 0 0>;
92*27cee7d7SSergio Paracuellos        interrupt-map = <0x0000 0 0 0 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>,
93*27cee7d7SSergio Paracuellos                        <0x0800 0 0 0 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>,
94*27cee7d7SSergio Paracuellos                        <0x1000 0 0 0 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
95*27cee7d7SSergio Paracuellos        reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
96*27cee7d7SSergio Paracuellos
97*27cee7d7SSergio Paracuellos        pcie@0,0 {
98*27cee7d7SSergio Paracuellos            reg = <0x0000 0 0 0 0>;
99*27cee7d7SSergio Paracuellos            #address-cells = <3>;
100*27cee7d7SSergio Paracuellos            #size-cells = <2>;
101*27cee7d7SSergio Paracuellos            device_type = "pci";
102*27cee7d7SSergio Paracuellos            #interrupt-cells = <1>;
103*27cee7d7SSergio Paracuellos            interrupt-map-mask = <0 0 0 0>;
104*27cee7d7SSergio Paracuellos            interrupt-map = <0 0 0 0 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>;
105*27cee7d7SSergio Paracuellos            resets = <&rstctrl 24>;
106*27cee7d7SSergio Paracuellos            clocks = <&clkctrl 24>;
107*27cee7d7SSergio Paracuellos            phys = <&pcie0_phy 1>;
108*27cee7d7SSergio Paracuellos            phy-names = "pcie-phy0";
109*27cee7d7SSergio Paracuellos            ranges;
110*27cee7d7SSergio Paracuellos        };
111*27cee7d7SSergio Paracuellos
112*27cee7d7SSergio Paracuellos        pcie@1,0 {
113*27cee7d7SSergio Paracuellos            reg = <0x0800 0 0 0 0>;
114*27cee7d7SSergio Paracuellos            #address-cells = <3>;
115*27cee7d7SSergio Paracuellos            #size-cells = <2>;
116*27cee7d7SSergio Paracuellos            device_type = "pci";
117*27cee7d7SSergio Paracuellos            #interrupt-cells = <1>;
118*27cee7d7SSergio Paracuellos            interrupt-map-mask = <0 0 0 0>;
119*27cee7d7SSergio Paracuellos            interrupt-map = <0 0 0 0 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>;
120*27cee7d7SSergio Paracuellos            resets = <&rstctrl 25>;
121*27cee7d7SSergio Paracuellos            clocks = <&clkctrl 25>;
122*27cee7d7SSergio Paracuellos            phys = <&pcie0_phy 1>;
123*27cee7d7SSergio Paracuellos            phy-names = "pcie-phy1";
124*27cee7d7SSergio Paracuellos            ranges;
125*27cee7d7SSergio Paracuellos        };
126*27cee7d7SSergio Paracuellos
127*27cee7d7SSergio Paracuellos        pcie@2,0 {
128*27cee7d7SSergio Paracuellos            reg = <0x1000 0 0 0 0>;
129*27cee7d7SSergio Paracuellos            #address-cells = <3>;
130*27cee7d7SSergio Paracuellos            #size-cells = <2>;
131*27cee7d7SSergio Paracuellos            device_type = "pci";
132*27cee7d7SSergio Paracuellos            #interrupt-cells = <1>;
133*27cee7d7SSergio Paracuellos            interrupt-map-mask = <0 0 0 0>;
134*27cee7d7SSergio Paracuellos            interrupt-map = <0 0 0 0 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
135*27cee7d7SSergio Paracuellos            resets = <&rstctrl 26>;
136*27cee7d7SSergio Paracuellos            clocks = <&clkctrl 26>;
137*27cee7d7SSergio Paracuellos            phys = <&pcie2_phy 0>;
138*27cee7d7SSergio Paracuellos            phy-names = "pcie-phy2";
139*27cee7d7SSergio Paracuellos            ranges;
140*27cee7d7SSergio Paracuellos        };
141*27cee7d7SSergio Paracuellos    };
142*27cee7d7SSergio Paracuellos...
143