MediaTek MT7621 PCIe controller

Schema identifier ($id): "http://devicetree.org/schemas/pci/mediatek,mt7621-pcie.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Sergio Paracuellos <sergio.paracuellos@gmail.com>"

MediaTek MT7621 PCIe subsys supports a single Root Complex (RC) with 3 Root Ports. Each Root Port supports a Gen1 1-lane Link

                        MT7621 PCIe HOST Topology
                                 .-------.
                                 |       |
                                 |  CPU  |
                                 |       |
                                 '-------'
                                     |
                                     |
                                     |
                                     v
                            .------------------.
                .-----------|  HOST/PCI Bridge |------------.
                |           '------------------'            | Type1
           BUS0 |                     |                     | Access
                v                     v                     v On Bus0
        .-------------.        .-------------.       .-------------.
        | VIRTUAL P2P |        | VIRTUAL P2P |       | VIRTUAL P2P |
        |    BUS0     |        |    BUS0     |       |    BUS0     |
        |    DEV0     |        |    DEV1     |       |    DEV2     |
        '-------------'        '-------------'       '-------------'
  Type0        |          Type0       |         Type0       |
 Access   BUS1 |         Access   BUS2|        Access   BUS3|
 On Bus1       v         On Bus2      v        On Bus3      v
         .----------.           .----------.          .----------.
         | Device 0 |           | Device 0 |          | Device 0 |
         |  Func 0  |           |  Func 0  |          |  Func 0  |
         '----------'           '----------'          '----------'

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): /schemas/pci/pci-host-bridge.yaml#

Properties and child nodes (properties) #

compatible — required here #

Exact value (const): "mediatek,mt7621-pci"

reg — required here #

Array item rules (items) #

Item 1

host-pci bridge registers

Item 2

pcie port 0 RC control registers

Item 3

pcie port 1 RC control registers

Item 4

pcie port 2 RC control registers

ranges — required here #

Maximum number of items (maxItems): 2

Properties matching a name pattern (patternProperties) #

^pcie@[0-2],0$ — name matches this regular expression #

Value type (type): "object"

Shared schema rule ($ref): /schemas/pci/pci-pci-bridge.yaml#

Properties and child nodes (properties) #

reg — not listed as required here

Maximum number of items (maxItems): 1

resets — required here

Maximum number of items (maxItems): 1

clocks — required here

Maximum number of items (maxItems): 1

phys — required here

Maximum number of items (maxItems): 1

phy-names — required here

String pattern (pattern): "^pcie-phy[0-2]$"

Required in this object (required): "#interrupt-cells", "interrupt-map-mask", "interrupt-map", "resets", "clocks", "phys", "phy-names", "ranges"

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Required in this object (required): "compatible", "reg", "ranges", "#interrupt-cells", "interrupt-map-mask", "interrupt-map", "reset-gpios"

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/mips-gic.h>

pcie: pcie@1e140000 {
    compatible = "mediatek,mt7621-pci";
    reg = <0x1e140000 0x100>,
          <0x1e142000 0x100>,
          <0x1e143000 0x100>,
          <0x1e144000 0x100>;

    #address-cells = <3>;
    #size-cells = <2>;
    pinctrl-names = "default";
    pinctrl-0 = <&pcie_pins>;
    device_type = "pci";
    ranges = <0x02000000 0 0x60000000 0x60000000 0 0x10000000>,  /* pci memory */
             <0x01000000 0 0x1e160000 0x1e160000 0 0x00010000>;  /* io space */
    #interrupt-cells = <1>;
    interrupt-map-mask = <0xF800 0 0 0>;
    interrupt-map = <0x0000 0 0 0 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>,
                    <0x0800 0 0 0 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>,
                    <0x1000 0 0 0 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
    reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>;

    pcie@0,0 {
        reg = <0x0000 0 0 0 0>;
        #address-cells = <3>;
        #size-cells = <2>;
        device_type = "pci";
        #interrupt-cells = <1>;
        interrupt-map-mask = <0 0 0 0>;
        interrupt-map = <0 0 0 0 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>;
        resets = <&rstctrl 24>;
        clocks = <&clkctrl 24>;
        phys = <&pcie0_phy 1>;
        phy-names = "pcie-phy0";
        ranges;
    };

    pcie@1,0 {
        reg = <0x0800 0 0 0 0>;
        #address-cells = <3>;
        #size-cells = <2>;
        device_type = "pci";
        #interrupt-cells = <1>;
        interrupt-map-mask = <0 0 0 0>;
        interrupt-map = <0 0 0 0 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>;
        resets = <&rstctrl 25>;
        clocks = <&clkctrl 25>;
        phys = <&pcie0_phy 1>;
        phy-names = "pcie-phy1";
        ranges;
    };

    pcie@2,0 {
        reg = <0x1000 0 0 0 0>;
        #address-cells = <3>;
        #size-cells = <2>;
        device_type = "pci";
        #interrupt-cells = <1>;
        interrupt-map-mask = <0 0 0 0>;
        interrupt-map = <0 0 0 0 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
        resets = <&rstctrl 26>;
        clocks = <&clkctrl 26>;
        phys = <&pcie2_phy 0>;
        phy-names = "pcie-phy2";
        ranges;
    };
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Edit this page