xref: /freebsd/sys/contrib/device-tree/Bindings/pci/mediatek-pcie-gen3.yaml (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
12eb4d8dcSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
22eb4d8dcSEmmanuel Vadot%YAML 1.2
32eb4d8dcSEmmanuel Vadot---
42eb4d8dcSEmmanuel Vadot$id: http://devicetree.org/schemas/pci/mediatek-pcie-gen3.yaml#
52eb4d8dcSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
62eb4d8dcSEmmanuel Vadot
72eb4d8dcSEmmanuel Vadottitle: Gen3 PCIe controller on MediaTek SoCs
82eb4d8dcSEmmanuel Vadot
92eb4d8dcSEmmanuel Vadotmaintainers:
102eb4d8dcSEmmanuel Vadot  - Jianjun Wang <jianjun.wang@mediatek.com>
112eb4d8dcSEmmanuel Vadot
122eb4d8dcSEmmanuel Vadotdescription: |+
132eb4d8dcSEmmanuel Vadot  PCIe Gen3 MAC controller for MediaTek SoCs, it supports Gen3 speed
142eb4d8dcSEmmanuel Vadot  and compatible with Gen2, Gen1 speed.
152eb4d8dcSEmmanuel Vadot
162eb4d8dcSEmmanuel Vadot  This PCIe controller supports up to 256 MSI vectors, the MSI hardware
172eb4d8dcSEmmanuel Vadot  block diagram is as follows:
182eb4d8dcSEmmanuel Vadot
192eb4d8dcSEmmanuel Vadot                    +-----+
202eb4d8dcSEmmanuel Vadot                    | GIC |
212eb4d8dcSEmmanuel Vadot                    +-----+
222eb4d8dcSEmmanuel Vadot                       ^
232eb4d8dcSEmmanuel Vadot                       |
242eb4d8dcSEmmanuel Vadot                   port->irq
252eb4d8dcSEmmanuel Vadot                       |
262eb4d8dcSEmmanuel Vadot               +-+-+-+-+-+-+-+-+
272eb4d8dcSEmmanuel Vadot               |0|1|2|3|4|5|6|7| (PCIe intc)
282eb4d8dcSEmmanuel Vadot               +-+-+-+-+-+-+-+-+
292eb4d8dcSEmmanuel Vadot                ^ ^           ^
302eb4d8dcSEmmanuel Vadot                | |    ...    |
312eb4d8dcSEmmanuel Vadot        +-------+ +------+    +-----------+
322eb4d8dcSEmmanuel Vadot        |                |                |
332eb4d8dcSEmmanuel Vadot  +-+-+---+--+--+  +-+-+---+--+--+  +-+-+---+--+--+
342eb4d8dcSEmmanuel Vadot  |0|1|...|30|31|  |0|1|...|30|31|  |0|1|...|30|31| (MSI sets)
352eb4d8dcSEmmanuel Vadot  +-+-+---+--+--+  +-+-+---+--+--+  +-+-+---+--+--+
362eb4d8dcSEmmanuel Vadot   ^ ^      ^  ^    ^ ^      ^  ^    ^ ^      ^  ^
372eb4d8dcSEmmanuel Vadot   | |      |  |    | |      |  |    | |      |  |  (MSI vectors)
382eb4d8dcSEmmanuel Vadot   | |      |  |    | |      |  |    | |      |  |
392eb4d8dcSEmmanuel Vadot
402eb4d8dcSEmmanuel Vadot    (MSI SET0)       (MSI SET1)  ...   (MSI SET7)
412eb4d8dcSEmmanuel Vadot
422eb4d8dcSEmmanuel Vadot  With 256 MSI vectors supported, the MSI vectors are composed of 8 sets,
432eb4d8dcSEmmanuel Vadot  each set has its own address for MSI message, and supports 32 MSI vectors
442eb4d8dcSEmmanuel Vadot  to generate interrupt.
452eb4d8dcSEmmanuel Vadot
462eb4d8dcSEmmanuel Vadotproperties:
472eb4d8dcSEmmanuel Vadot  compatible:
487ef62cebSEmmanuel Vadot    oneOf:
497ef62cebSEmmanuel Vadot      - items:
507ef62cebSEmmanuel Vadot          - enum:
518bab661aSEmmanuel Vadot              - mediatek,mt7986-pcie
527ef62cebSEmmanuel Vadot              - mediatek,mt8188-pcie
537ef62cebSEmmanuel Vadot              - mediatek,mt8195-pcie
547ef62cebSEmmanuel Vadot          - const: mediatek,mt8192-pcie
557ef62cebSEmmanuel Vadot      - const: mediatek,mt8192-pcie
56*b2d2a78aSEmmanuel Vadot      - const: airoha,en7581-pcie
572eb4d8dcSEmmanuel Vadot
582eb4d8dcSEmmanuel Vadot  reg:
592eb4d8dcSEmmanuel Vadot    maxItems: 1
602eb4d8dcSEmmanuel Vadot
612eb4d8dcSEmmanuel Vadot  reg-names:
622eb4d8dcSEmmanuel Vadot    items:
632eb4d8dcSEmmanuel Vadot      - const: pcie-mac
642eb4d8dcSEmmanuel Vadot
652eb4d8dcSEmmanuel Vadot  interrupts:
662eb4d8dcSEmmanuel Vadot    maxItems: 1
672eb4d8dcSEmmanuel Vadot
682eb4d8dcSEmmanuel Vadot  ranges:
692eb4d8dcSEmmanuel Vadot    minItems: 1
702eb4d8dcSEmmanuel Vadot    maxItems: 8
712eb4d8dcSEmmanuel Vadot
728bab661aSEmmanuel Vadot  iommu-map:
738bab661aSEmmanuel Vadot    maxItems: 1
748bab661aSEmmanuel Vadot
758bab661aSEmmanuel Vadot  iommu-map-mask:
768bab661aSEmmanuel Vadot    const: 0
778bab661aSEmmanuel Vadot
782eb4d8dcSEmmanuel Vadot  resets:
792eb4d8dcSEmmanuel Vadot    minItems: 1
80*b2d2a78aSEmmanuel Vadot    maxItems: 3
812eb4d8dcSEmmanuel Vadot
822eb4d8dcSEmmanuel Vadot  reset-names:
832eb4d8dcSEmmanuel Vadot    minItems: 1
84*b2d2a78aSEmmanuel Vadot    maxItems: 3
852eb4d8dcSEmmanuel Vadot    items:
86*b2d2a78aSEmmanuel Vadot      enum: [ phy, mac, phy-lane0, phy-lane1, phy-lane2 ]
872eb4d8dcSEmmanuel Vadot
882eb4d8dcSEmmanuel Vadot  clocks:
89*b2d2a78aSEmmanuel Vadot    minItems: 1
902eb4d8dcSEmmanuel Vadot    maxItems: 6
912eb4d8dcSEmmanuel Vadot
922eb4d8dcSEmmanuel Vadot  clock-names:
93*b2d2a78aSEmmanuel Vadot    minItems: 1
948bab661aSEmmanuel Vadot    maxItems: 6
952eb4d8dcSEmmanuel Vadot
962eb4d8dcSEmmanuel Vadot  assigned-clocks:
972eb4d8dcSEmmanuel Vadot    maxItems: 1
982eb4d8dcSEmmanuel Vadot
992eb4d8dcSEmmanuel Vadot  assigned-clock-parents:
1002eb4d8dcSEmmanuel Vadot    maxItems: 1
1012eb4d8dcSEmmanuel Vadot
1022eb4d8dcSEmmanuel Vadot  phys:
1032eb4d8dcSEmmanuel Vadot    maxItems: 1
1042eb4d8dcSEmmanuel Vadot
105e67e8565SEmmanuel Vadot  phy-names:
106e67e8565SEmmanuel Vadot    items:
107e67e8565SEmmanuel Vadot      - const: pcie-phy
108e67e8565SEmmanuel Vadot
1098bab661aSEmmanuel Vadot  power-domains:
1108bab661aSEmmanuel Vadot    maxItems: 1
1118bab661aSEmmanuel Vadot
1122eb4d8dcSEmmanuel Vadot  '#interrupt-cells':
1132eb4d8dcSEmmanuel Vadot    const: 1
1142eb4d8dcSEmmanuel Vadot
1152eb4d8dcSEmmanuel Vadot  interrupt-controller:
1162eb4d8dcSEmmanuel Vadot    description: Interrupt controller node for handling legacy PCI interrupts.
1172eb4d8dcSEmmanuel Vadot    type: object
1182eb4d8dcSEmmanuel Vadot    properties:
1192eb4d8dcSEmmanuel Vadot      '#address-cells':
1202eb4d8dcSEmmanuel Vadot        const: 0
1212eb4d8dcSEmmanuel Vadot      '#interrupt-cells':
1222eb4d8dcSEmmanuel Vadot        const: 1
1232eb4d8dcSEmmanuel Vadot      interrupt-controller: true
1242eb4d8dcSEmmanuel Vadot
1252eb4d8dcSEmmanuel Vadot    required:
1262eb4d8dcSEmmanuel Vadot      - '#address-cells'
1272eb4d8dcSEmmanuel Vadot      - '#interrupt-cells'
1282eb4d8dcSEmmanuel Vadot      - interrupt-controller
1292eb4d8dcSEmmanuel Vadot
1302eb4d8dcSEmmanuel Vadot    additionalProperties: false
1312eb4d8dcSEmmanuel Vadot
1322eb4d8dcSEmmanuel Vadotrequired:
1332eb4d8dcSEmmanuel Vadot  - compatible
1342eb4d8dcSEmmanuel Vadot  - reg
1352eb4d8dcSEmmanuel Vadot  - reg-names
1362eb4d8dcSEmmanuel Vadot  - interrupts
1372eb4d8dcSEmmanuel Vadot  - ranges
1382eb4d8dcSEmmanuel Vadot  - clocks
1397ef62cebSEmmanuel Vadot  - clock-names
1402eb4d8dcSEmmanuel Vadot  - '#interrupt-cells'
1412eb4d8dcSEmmanuel Vadot  - interrupt-controller
1422eb4d8dcSEmmanuel Vadot
1438bab661aSEmmanuel VadotallOf:
1447d0873ebSEmmanuel Vadot  - $ref: /schemas/pci/pci-host-bridge.yaml#
1458bab661aSEmmanuel Vadot  - if:
1468bab661aSEmmanuel Vadot      properties:
1478bab661aSEmmanuel Vadot        compatible:
1488bab661aSEmmanuel Vadot          const: mediatek,mt8192-pcie
1498bab661aSEmmanuel Vadot    then:
1508bab661aSEmmanuel Vadot      properties:
151*b2d2a78aSEmmanuel Vadot        clocks:
152*b2d2a78aSEmmanuel Vadot          minItems: 4
153*b2d2a78aSEmmanuel Vadot
1548bab661aSEmmanuel Vadot        clock-names:
1558bab661aSEmmanuel Vadot          items:
1568bab661aSEmmanuel Vadot            - const: pl_250m
1578bab661aSEmmanuel Vadot            - const: tl_26m
1588bab661aSEmmanuel Vadot            - const: tl_96m
1598bab661aSEmmanuel Vadot            - const: tl_32k
1608bab661aSEmmanuel Vadot            - const: peri_26m
1618bab661aSEmmanuel Vadot            - const: top_133m
162*b2d2a78aSEmmanuel Vadot
163*b2d2a78aSEmmanuel Vadot        resets:
164*b2d2a78aSEmmanuel Vadot          minItems: 1
165*b2d2a78aSEmmanuel Vadot          maxItems: 2
166*b2d2a78aSEmmanuel Vadot
167*b2d2a78aSEmmanuel Vadot        reset-names:
168*b2d2a78aSEmmanuel Vadot          minItems: 1
169*b2d2a78aSEmmanuel Vadot          maxItems: 2
170*b2d2a78aSEmmanuel Vadot
1718bab661aSEmmanuel Vadot  - if:
1728bab661aSEmmanuel Vadot      properties:
1738bab661aSEmmanuel Vadot        compatible:
1748bab661aSEmmanuel Vadot          contains:
1758bab661aSEmmanuel Vadot            enum:
1768bab661aSEmmanuel Vadot              - mediatek,mt8188-pcie
1778bab661aSEmmanuel Vadot              - mediatek,mt8195-pcie
1788bab661aSEmmanuel Vadot    then:
1798bab661aSEmmanuel Vadot      properties:
180*b2d2a78aSEmmanuel Vadot        clocks:
181*b2d2a78aSEmmanuel Vadot          minItems: 4
182*b2d2a78aSEmmanuel Vadot
1838bab661aSEmmanuel Vadot        clock-names:
1848bab661aSEmmanuel Vadot          items:
1858bab661aSEmmanuel Vadot            - const: pl_250m
1868bab661aSEmmanuel Vadot            - const: tl_26m
1878bab661aSEmmanuel Vadot            - const: tl_96m
1888bab661aSEmmanuel Vadot            - const: tl_32k
1898bab661aSEmmanuel Vadot            - const: peri_26m
1908bab661aSEmmanuel Vadot            - const: peri_mem
191*b2d2a78aSEmmanuel Vadot
192*b2d2a78aSEmmanuel Vadot        resets:
193*b2d2a78aSEmmanuel Vadot          minItems: 1
194*b2d2a78aSEmmanuel Vadot          maxItems: 2
195*b2d2a78aSEmmanuel Vadot
196*b2d2a78aSEmmanuel Vadot        reset-names:
197*b2d2a78aSEmmanuel Vadot          minItems: 1
198*b2d2a78aSEmmanuel Vadot          maxItems: 2
199*b2d2a78aSEmmanuel Vadot
2008bab661aSEmmanuel Vadot  - if:
2018bab661aSEmmanuel Vadot      properties:
2028bab661aSEmmanuel Vadot        compatible:
2038bab661aSEmmanuel Vadot          contains:
2048bab661aSEmmanuel Vadot            enum:
2058bab661aSEmmanuel Vadot              - mediatek,mt7986-pcie
2068bab661aSEmmanuel Vadot    then:
2078bab661aSEmmanuel Vadot      properties:
208*b2d2a78aSEmmanuel Vadot        clocks:
209*b2d2a78aSEmmanuel Vadot          minItems: 4
210*b2d2a78aSEmmanuel Vadot
2118bab661aSEmmanuel Vadot        clock-names:
2128bab661aSEmmanuel Vadot          items:
2138bab661aSEmmanuel Vadot            - const: pl_250m
2148bab661aSEmmanuel Vadot            - const: tl_26m
2158bab661aSEmmanuel Vadot            - const: peri_26m
2168bab661aSEmmanuel Vadot            - const: top_133m
2178bab661aSEmmanuel Vadot
218*b2d2a78aSEmmanuel Vadot        resets:
219*b2d2a78aSEmmanuel Vadot          minItems: 1
220*b2d2a78aSEmmanuel Vadot          maxItems: 2
221*b2d2a78aSEmmanuel Vadot
222*b2d2a78aSEmmanuel Vadot        reset-names:
223*b2d2a78aSEmmanuel Vadot          minItems: 1
224*b2d2a78aSEmmanuel Vadot          maxItems: 2
225*b2d2a78aSEmmanuel Vadot
226*b2d2a78aSEmmanuel Vadot  - if:
227*b2d2a78aSEmmanuel Vadot      properties:
228*b2d2a78aSEmmanuel Vadot        compatible:
229*b2d2a78aSEmmanuel Vadot          const: airoha,en7581-pcie
230*b2d2a78aSEmmanuel Vadot    then:
231*b2d2a78aSEmmanuel Vadot      properties:
232*b2d2a78aSEmmanuel Vadot        clocks:
233*b2d2a78aSEmmanuel Vadot          maxItems: 1
234*b2d2a78aSEmmanuel Vadot
235*b2d2a78aSEmmanuel Vadot        clock-names:
236*b2d2a78aSEmmanuel Vadot          items:
237*b2d2a78aSEmmanuel Vadot            - const: sys-ck
238*b2d2a78aSEmmanuel Vadot
239*b2d2a78aSEmmanuel Vadot        resets:
240*b2d2a78aSEmmanuel Vadot          minItems: 3
241*b2d2a78aSEmmanuel Vadot
242*b2d2a78aSEmmanuel Vadot        reset-names:
243*b2d2a78aSEmmanuel Vadot          items:
244*b2d2a78aSEmmanuel Vadot            - const: phy-lane0
245*b2d2a78aSEmmanuel Vadot            - const: phy-lane1
246*b2d2a78aSEmmanuel Vadot            - const: phy-lane2
247*b2d2a78aSEmmanuel Vadot
2482eb4d8dcSEmmanuel VadotunevaluatedProperties: false
2492eb4d8dcSEmmanuel Vadot
2502eb4d8dcSEmmanuel Vadotexamples:
2512eb4d8dcSEmmanuel Vadot  - |
2522eb4d8dcSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
2532eb4d8dcSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
2542eb4d8dcSEmmanuel Vadot
2552eb4d8dcSEmmanuel Vadot    bus {
2562eb4d8dcSEmmanuel Vadot        #address-cells = <2>;
2572eb4d8dcSEmmanuel Vadot        #size-cells = <2>;
2582eb4d8dcSEmmanuel Vadot
2592eb4d8dcSEmmanuel Vadot        pcie: pcie@11230000 {
2602eb4d8dcSEmmanuel Vadot            compatible = "mediatek,mt8192-pcie";
2612eb4d8dcSEmmanuel Vadot            device_type = "pci";
2622eb4d8dcSEmmanuel Vadot            #address-cells = <3>;
2632eb4d8dcSEmmanuel Vadot            #size-cells = <2>;
2642eb4d8dcSEmmanuel Vadot            reg = <0x00 0x11230000 0x00 0x4000>;
2652eb4d8dcSEmmanuel Vadot            reg-names = "pcie-mac";
2662eb4d8dcSEmmanuel Vadot            interrupts = <GIC_SPI 251 IRQ_TYPE_LEVEL_HIGH 0>;
2672eb4d8dcSEmmanuel Vadot            bus-range = <0x00 0xff>;
2682eb4d8dcSEmmanuel Vadot            ranges = <0x82000000 0x00 0x12000000 0x00
2692eb4d8dcSEmmanuel Vadot                      0x12000000 0x00 0x1000000>;
2702eb4d8dcSEmmanuel Vadot            clocks = <&infracfg 44>,
2712eb4d8dcSEmmanuel Vadot                     <&infracfg 40>,
2722eb4d8dcSEmmanuel Vadot                     <&infracfg 43>,
2732eb4d8dcSEmmanuel Vadot                     <&infracfg 97>,
2742eb4d8dcSEmmanuel Vadot                     <&infracfg 99>,
2752eb4d8dcSEmmanuel Vadot                     <&infracfg 111>;
2762eb4d8dcSEmmanuel Vadot            clock-names = "pl_250m", "tl_26m", "tl_96m",
2772eb4d8dcSEmmanuel Vadot                          "tl_32k", "peri_26m", "top_133m";
2782eb4d8dcSEmmanuel Vadot            assigned-clocks = <&topckgen 50>;
2792eb4d8dcSEmmanuel Vadot            assigned-clock-parents = <&topckgen 91>;
2802eb4d8dcSEmmanuel Vadot
2812eb4d8dcSEmmanuel Vadot            phys = <&pciephy>;
2822eb4d8dcSEmmanuel Vadot            phy-names = "pcie-phy";
2832eb4d8dcSEmmanuel Vadot
2842eb4d8dcSEmmanuel Vadot            resets = <&infracfg_rst 2>,
2852eb4d8dcSEmmanuel Vadot                     <&infracfg_rst 3>;
2862eb4d8dcSEmmanuel Vadot            reset-names = "phy", "mac";
2872eb4d8dcSEmmanuel Vadot
2882eb4d8dcSEmmanuel Vadot            #interrupt-cells = <1>;
2892eb4d8dcSEmmanuel Vadot            interrupt-map-mask = <0 0 0 0x7>;
2902eb4d8dcSEmmanuel Vadot            interrupt-map = <0 0 0 1 &pcie_intc 0>,
2912eb4d8dcSEmmanuel Vadot                            <0 0 0 2 &pcie_intc 1>,
2922eb4d8dcSEmmanuel Vadot                            <0 0 0 3 &pcie_intc 2>,
2932eb4d8dcSEmmanuel Vadot                            <0 0 0 4 &pcie_intc 3>;
2942eb4d8dcSEmmanuel Vadot            pcie_intc: interrupt-controller {
2952eb4d8dcSEmmanuel Vadot                      #address-cells = <0>;
2962eb4d8dcSEmmanuel Vadot                      #interrupt-cells = <1>;
2972eb4d8dcSEmmanuel Vadot                      interrupt-controller;
2982eb4d8dcSEmmanuel Vadot            };
2992eb4d8dcSEmmanuel Vadot        };
3002eb4d8dcSEmmanuel Vadot    };
301