xref: /linux/Documentation/devicetree/bindings/pci/mediatek,mt7621-pcie.yaml (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
127cee7d7SSergio Paracuellos# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
227cee7d7SSergio Paracuellos%YAML 1.2
327cee7d7SSergio Paracuellos---
427cee7d7SSergio Paracuellos$id: http://devicetree.org/schemas/pci/mediatek,mt7621-pcie.yaml#
527cee7d7SSergio Paracuellos$schema: http://devicetree.org/meta-schemas/core.yaml#
627cee7d7SSergio Paracuellos
727cee7d7SSergio Paracuellostitle: MediaTek MT7621 PCIe controller
827cee7d7SSergio Paracuellos
927cee7d7SSergio Paracuellosmaintainers:
1027cee7d7SSergio Paracuellos  - Sergio Paracuellos <sergio.paracuellos@gmail.com>
1127cee7d7SSergio Paracuellos
1227cee7d7SSergio Paracuellosdescription: |+
1327cee7d7SSergio Paracuellos  MediaTek MT7621 PCIe subsys supports a single Root Complex (RC)
1427cee7d7SSergio Paracuellos  with 3 Root Ports. Each Root Port supports a Gen1 1-lane Link
1527cee7d7SSergio Paracuellos
16*bc9792f3SSergio Paracuellos                          MT7621 PCIe HOST Topology
17*bc9792f3SSergio Paracuellos
18*bc9792f3SSergio Paracuellos                                   .-------.
19*bc9792f3SSergio Paracuellos                                   |       |
20*bc9792f3SSergio Paracuellos                                   |  CPU  |
21*bc9792f3SSergio Paracuellos                                   |       |
22*bc9792f3SSergio Paracuellos                                   '-------'
23*bc9792f3SSergio Paracuellos                                       |
24*bc9792f3SSergio Paracuellos                                       |
25*bc9792f3SSergio Paracuellos                                       |
26*bc9792f3SSergio Paracuellos                                       v
27*bc9792f3SSergio Paracuellos                              .------------------.
28*bc9792f3SSergio Paracuellos                  .-----------|  HOST/PCI Bridge |------------.
29*bc9792f3SSergio Paracuellos                  |           '------------------'            | Type1
30*bc9792f3SSergio Paracuellos             BUS0 |                     |                     | Access
31*bc9792f3SSergio Paracuellos                  v                     v                     v On Bus0
32*bc9792f3SSergio Paracuellos          .-------------.        .-------------.       .-------------.
33*bc9792f3SSergio Paracuellos          | VIRTUAL P2P |        | VIRTUAL P2P |       | VIRTUAL P2P |
34*bc9792f3SSergio Paracuellos          |    BUS0     |        |    BUS0     |       |    BUS0     |
35*bc9792f3SSergio Paracuellos          |    DEV0     |        |    DEV1     |       |    DEV2     |
36*bc9792f3SSergio Paracuellos          '-------------'        '-------------'       '-------------'
37*bc9792f3SSergio Paracuellos    Type0        |          Type0       |         Type0       |
38*bc9792f3SSergio Paracuellos   Access   BUS1 |         Access   BUS2|        Access   BUS3|
39*bc9792f3SSergio Paracuellos   On Bus1       v         On Bus2      v        On Bus3      v
40*bc9792f3SSergio Paracuellos           .----------.           .----------.          .----------.
41*bc9792f3SSergio Paracuellos           | Device 0 |           | Device 0 |          | Device 0 |
42*bc9792f3SSergio Paracuellos           |  Func 0  |           |  Func 0  |          |  Func 0  |
43*bc9792f3SSergio Paracuellos           '----------'           '----------'          '----------'
44*bc9792f3SSergio Paracuellos
4527cee7d7SSergio ParacuellosallOf:
46d3fa4be9SKrzysztof Kozlowski  - $ref: /schemas/pci/pci-host-bridge.yaml#
4727cee7d7SSergio Paracuellos
4827cee7d7SSergio Paracuellosproperties:
4927cee7d7SSergio Paracuellos  compatible:
5027cee7d7SSergio Paracuellos    const: mediatek,mt7621-pci
5127cee7d7SSergio Paracuellos
5227cee7d7SSergio Paracuellos  reg:
5327cee7d7SSergio Paracuellos    items:
5427cee7d7SSergio Paracuellos      - description: host-pci bridge registers
5527cee7d7SSergio Paracuellos      - description: pcie port 0 RC control registers
5627cee7d7SSergio Paracuellos      - description: pcie port 1 RC control registers
5727cee7d7SSergio Paracuellos      - description: pcie port 2 RC control registers
5827cee7d7SSergio Paracuellos
5927cee7d7SSergio Paracuellos  ranges:
6027cee7d7SSergio Paracuellos    maxItems: 2
6127cee7d7SSergio Paracuellos
6227cee7d7SSergio ParacuellospatternProperties:
637621aabdSRob Herring  '^pcie@[0-2],0$':
6427cee7d7SSergio Paracuellos    type: object
65d3fa4be9SKrzysztof Kozlowski    $ref: /schemas/pci/pci-pci-bridge.yaml#
6627cee7d7SSergio Paracuellos
6727cee7d7SSergio Paracuellos    properties:
6836fbed38SKrzysztof Kozlowski      reg:
6936fbed38SKrzysztof Kozlowski        maxItems: 1
7036fbed38SKrzysztof Kozlowski
7127cee7d7SSergio Paracuellos      resets:
7227cee7d7SSergio Paracuellos        maxItems: 1
7327cee7d7SSergio Paracuellos
7427cee7d7SSergio Paracuellos      clocks:
7527cee7d7SSergio Paracuellos        maxItems: 1
7627cee7d7SSergio Paracuellos
7727cee7d7SSergio Paracuellos      phys:
7827cee7d7SSergio Paracuellos        maxItems: 1
7927cee7d7SSergio Paracuellos
80dcd49679SRob Herring      phy-names:
81dcd49679SRob Herring        pattern: '^pcie-phy[0-2]$'
82dcd49679SRob Herring
8327cee7d7SSergio Paracuellos    required:
8427cee7d7SSergio Paracuellos      - "#interrupt-cells"
8527cee7d7SSergio Paracuellos      - interrupt-map-mask
8627cee7d7SSergio Paracuellos      - interrupt-map
8727cee7d7SSergio Paracuellos      - resets
8827cee7d7SSergio Paracuellos      - clocks
8927cee7d7SSergio Paracuellos      - phys
9027cee7d7SSergio Paracuellos      - phy-names
9127cee7d7SSergio Paracuellos      - ranges
9227cee7d7SSergio Paracuellos
9327cee7d7SSergio Paracuellos    unevaluatedProperties: false
9427cee7d7SSergio Paracuellos
9527cee7d7SSergio Paracuellosrequired:
9627cee7d7SSergio Paracuellos  - compatible
9727cee7d7SSergio Paracuellos  - reg
9827cee7d7SSergio Paracuellos  - ranges
9927cee7d7SSergio Paracuellos  - "#interrupt-cells"
10027cee7d7SSergio Paracuellos  - interrupt-map-mask
10127cee7d7SSergio Paracuellos  - interrupt-map
10227cee7d7SSergio Paracuellos  - reset-gpios
10327cee7d7SSergio Paracuellos
10427cee7d7SSergio ParacuellosunevaluatedProperties: false
10527cee7d7SSergio Paracuellos
10627cee7d7SSergio Paracuellosexamples:
10727cee7d7SSergio Paracuellos  - |
10827cee7d7SSergio Paracuellos    #include <dt-bindings/gpio/gpio.h>
10927cee7d7SSergio Paracuellos    #include <dt-bindings/interrupt-controller/mips-gic.h>
11027cee7d7SSergio Paracuellos
11127cee7d7SSergio Paracuellos    pcie: pcie@1e140000 {
11227cee7d7SSergio Paracuellos        compatible = "mediatek,mt7621-pci";
11327cee7d7SSergio Paracuellos        reg = <0x1e140000 0x100>,
11427cee7d7SSergio Paracuellos              <0x1e142000 0x100>,
11527cee7d7SSergio Paracuellos              <0x1e143000 0x100>,
11627cee7d7SSergio Paracuellos              <0x1e144000 0x100>;
11727cee7d7SSergio Paracuellos
11827cee7d7SSergio Paracuellos        #address-cells = <3>;
11927cee7d7SSergio Paracuellos        #size-cells = <2>;
12027cee7d7SSergio Paracuellos        pinctrl-names = "default";
12127cee7d7SSergio Paracuellos        pinctrl-0 = <&pcie_pins>;
12227cee7d7SSergio Paracuellos        device_type = "pci";
12327cee7d7SSergio Paracuellos        ranges = <0x02000000 0 0x60000000 0x60000000 0 0x10000000>,  /* pci memory */
12427cee7d7SSergio Paracuellos                 <0x01000000 0 0x1e160000 0x1e160000 0 0x00010000>;  /* io space */
12527cee7d7SSergio Paracuellos        #interrupt-cells = <1>;
12627cee7d7SSergio Paracuellos        interrupt-map-mask = <0xF800 0 0 0>;
12727cee7d7SSergio Paracuellos        interrupt-map = <0x0000 0 0 0 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>,
12827cee7d7SSergio Paracuellos                        <0x0800 0 0 0 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>,
12927cee7d7SSergio Paracuellos                        <0x1000 0 0 0 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
13027cee7d7SSergio Paracuellos        reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
13127cee7d7SSergio Paracuellos
13227cee7d7SSergio Paracuellos        pcie@0,0 {
13327cee7d7SSergio Paracuellos            reg = <0x0000 0 0 0 0>;
13427cee7d7SSergio Paracuellos            #address-cells = <3>;
13527cee7d7SSergio Paracuellos            #size-cells = <2>;
13627cee7d7SSergio Paracuellos            device_type = "pci";
13727cee7d7SSergio Paracuellos            #interrupt-cells = <1>;
13827cee7d7SSergio Paracuellos            interrupt-map-mask = <0 0 0 0>;
13927cee7d7SSergio Paracuellos            interrupt-map = <0 0 0 0 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>;
14027cee7d7SSergio Paracuellos            resets = <&rstctrl 24>;
14127cee7d7SSergio Paracuellos            clocks = <&clkctrl 24>;
14227cee7d7SSergio Paracuellos            phys = <&pcie0_phy 1>;
14327cee7d7SSergio Paracuellos            phy-names = "pcie-phy0";
14427cee7d7SSergio Paracuellos            ranges;
14527cee7d7SSergio Paracuellos        };
14627cee7d7SSergio Paracuellos
14727cee7d7SSergio Paracuellos        pcie@1,0 {
14827cee7d7SSergio Paracuellos            reg = <0x0800 0 0 0 0>;
14927cee7d7SSergio Paracuellos            #address-cells = <3>;
15027cee7d7SSergio Paracuellos            #size-cells = <2>;
15127cee7d7SSergio Paracuellos            device_type = "pci";
15227cee7d7SSergio Paracuellos            #interrupt-cells = <1>;
15327cee7d7SSergio Paracuellos            interrupt-map-mask = <0 0 0 0>;
15427cee7d7SSergio Paracuellos            interrupt-map = <0 0 0 0 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>;
15527cee7d7SSergio Paracuellos            resets = <&rstctrl 25>;
15627cee7d7SSergio Paracuellos            clocks = <&clkctrl 25>;
15727cee7d7SSergio Paracuellos            phys = <&pcie0_phy 1>;
15827cee7d7SSergio Paracuellos            phy-names = "pcie-phy1";
15927cee7d7SSergio Paracuellos            ranges;
16027cee7d7SSergio Paracuellos        };
16127cee7d7SSergio Paracuellos
16227cee7d7SSergio Paracuellos        pcie@2,0 {
16327cee7d7SSergio Paracuellos            reg = <0x1000 0 0 0 0>;
16427cee7d7SSergio Paracuellos            #address-cells = <3>;
16527cee7d7SSergio Paracuellos            #size-cells = <2>;
16627cee7d7SSergio Paracuellos            device_type = "pci";
16727cee7d7SSergio Paracuellos            #interrupt-cells = <1>;
16827cee7d7SSergio Paracuellos            interrupt-map-mask = <0 0 0 0>;
16927cee7d7SSergio Paracuellos            interrupt-map = <0 0 0 0 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
17027cee7d7SSergio Paracuellos            resets = <&rstctrl 26>;
17127cee7d7SSergio Paracuellos            clocks = <&clkctrl 26>;
17227cee7d7SSergio Paracuellos            phys = <&pcie2_phy 0>;
17327cee7d7SSergio Paracuellos            phy-names = "pcie-phy2";
17427cee7d7SSergio Paracuellos            ranges;
17527cee7d7SSergio Paracuellos        };
17627cee7d7SSergio Paracuellos    };
17727cee7d7SSergio Paracuellos...
178