MediaTek MT7981 Pin Controller

Schema identifier ($id): "http://devicetree.org/schemas/pinctrl/mediatek,mt7981-pinctrl.yaml#"

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

Maintainers (maintainers): "Daniel Golle <daniel@makrotopia.org>"

The MediaTek's MT7981 Pin controller is used to control SoC pins.

Properties and child nodes (properties) #

compatible — required here #

Allowed values (enum): "mediatek,mt7981-pinctrl"

reg — required here #

Minimum number of items (minItems): 9

Maximum number of items (maxItems): 9

reg-names — required here #

Array item rules (items) #

Item 1

Exact value (const): "gpio"

Item 2

Exact value (const): "iocfg_rt"

Item 3

Exact value (const): "iocfg_rm"

Item 4

Exact value (const): "iocfg_rb"

Item 5

Exact value (const): "iocfg_lb"

Item 6

Exact value (const): "iocfg_bl"

Item 7

Exact value (const): "iocfg_tm"

Item 8

Exact value (const): "iocfg_tl"

Item 9

Exact value (const): "eint"

gpio-controller — required here #

true — No constraints added by this property rule.

#gpio-cells — required here #

Exact value (const): 2

Number of cells in GPIO specifier. Since the generic GPIO binding is used, the amount of cells must be specified as 2. See the below mentioned gpio binding representation for description of particular cells.

gpio-ranges — not listed as required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 5

GPIO valid number range.

interrupt-controller — not listed as required here #

true — No constraints added by this property rule.

interrupts — not listed as required here #

Maximum number of items (maxItems): 1

#interrupt-cells — not listed as required here #

Exact value (const): 2

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): pinctrl.yaml#

Required in this object (required): "compatible", "reg", "reg-names", "gpio-controller", "#gpio-cells"

Properties matching a name pattern (patternProperties) #

-pins$ — name matches this regular expression #

Value type (type): "object"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Properties matching a name pattern (patternProperties) #

^.*mux.*$ — name matches this regular expression

Value type (type): "object"

Properties not matched by properties or patternProperties in this schema (additionalProperties)

false

Not allowed by this rule.

pinmux configuration nodes.

The following table shows the effective values of "group", "function" properties and chip pinout pins

groups                 function    pins (in pin#)
---------------------------------------------------------------------
"wa_aice1"             "wa_aice"   0, 1
"wa_aice2"             "wa_aice"   0, 1
"wm_uart_0"            "uart"      0, 1
"dfd"                  "dfd"       0, 1, 4, 5
"watchdog"             "watchdog"  2
"pcie_pereset"         "pcie"      3
"jtag"                 "jtag"      4, 5, 6, 7, 8
"wm_jtag_0"            "jtag"      4, 5, 6, 7, 8
"wo0_jtag_0"           "jtag"      9, 10, 11, 12, 13
"uart2_0"              "uart"      4, 5, 6, 7
"gbe_led0"             "led"       8
"pta_ext_0"            "pta"       4, 5, 6
"pwm2"                 "pwm"       7
"net_wo0_uart_txd_0"   "uart"      8
"spi1_0"               "spi"       4, 5, 6, 7
"i2c0_0"               "i2c"       6, 7
"dfd_ntrst"            "dfd"       8
"wm_aice1"             "wa_aice"   9, 10
"pwm0_0"               "pwm"       13
"pwm0_1"               "pwm"       15
"pwm1_0"               "pwm"       14
"pwm1_1"               "pwm"       15
"net_wo0_uart_txd_1"   "uart"      14
"net_wo0_uart_txd_2"   "uart"      15
"gbe_led1"             "led"       13
"pcm"                  "pcm"       9, 10, 11, 12, 13, 25
"watchdog1"            "watchdog"  13
"udi"                  "udi"       9, 10, 11, 12, 13
"drv_vbus"             "usb"       14
"emmc_45"              "flash"     15, 16, 17, 18, 19, 20, 21, 22, 23,
                                   24, 25
"snfi"                 "flash"     16, 17, 18, 19, 20, 21
"spi0"                 "spi"       16, 17, 18, 19
"spi0_wp_hold"         "spi"       20, 21
"spi1_1"               "spi"       22, 23, 24, 25
"spi2"                 "spi"       26, 27, 28, 29
"spi2_wp_hold"         "spi"       30, 31
"uart1_0"              "uart"      16, 17, 18, 19
"uart1_1"              "uart"      26, 27, 28, 29
"uart2_1"              "uart"      22, 23, 24, 25
"pta_ext_1"            "pta"       22, 23, 24
"wm_aurt_1"            "uart"      20, 21
"wm_aurt_2"            "uart"      30, 31
"wm_jtag_1"            "jtag"      20, 21, 22, 23, 24
"wo0_jtag_1"           "jtag"      25, 26, 27, 28, 29
"wa_aice3"             "wa_aice"   28, 20
"wm_aice2"             "wa_aice"   30, 31
"i2c0_1"               "i2c"       30, 31
"u2_phy_i2c"           "i2c"       30, 31
"uart0"                "uart"      32, 33
"sgmii1_phy_i2c"       "i2c"       32, 33
"u3_phy_i2c"           "i2c"       32, 33
"sgmii0_phy_i2c"       "i2c"       32, 33
"pcie_clk"             "pcie"      34
"pcie_wake"            "pcie"      35
"i2c0_2"               "i2c"       36, 37
"smi_mdc_mdio"         "eth"       36, 37
"gbe_ext_mdc_mdio"     "eth"       36, 37
"wf0_mode1"            "eth"       40, 41, 42, 43, 44, 45, 46, 47, 48,
                                   49, 50, 51, 52, 53, 54, 55, 56
"wf0_mode3"            "eth"       45, 46, 47, 48, 49, 51
"wf2g_led0"            "led"       30
"wf2g_led1"            "led"       34
"wf5g_led0"            "led"       31
"wf5g_led1"            "led"       35
"mt7531_int"           "eth"       38
"ant_sel"              "ant"       14, 15, 16, 17, 18, 19, 20, 21, 22,
                                   23, 24, 25, 34, 35

Shared schema rule ($ref): /schemas/pinctrl/pinmux-node.yaml

Properties and child nodes (properties)

function — required here

A string containing the name of the function to mux to the group.

Allowed values (enum): "wa_aice", "dfd", "jtag", "pta", "pcm", "udi", "usb", "ant", "eth", "i2c", "led", "pwm", "spi", "uart", "watchdog", "flash", "pcie"

groups — required here

An array of strings. Each string contains the name of a group.

Required in this object (required): "function", "groups"

All of these rules must match (allOf)

Rule 1

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "wa_aice"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "wa_aice1", "wa_aice2", "wm_aice1_1", "wa_aice3", "wm_aice1_2"

Rule 2

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "dfd"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "dfd", "dfd_ntrst"

Rule 3

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "jtag"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "jtag", "wm_jtag_0", "wo0_jtag_0", "wo0_jtag_1", "wm_jtag_1"

Rule 4

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "pta"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "pta_ext_0", "pta_ext_1"

Rule 5

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "pcm"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "pcm"

Rule 6

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "udi"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "udi"

Rule 7

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "usb"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "drv_vbus"

Rule 8

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "ant"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "ant_sel"

Rule 9

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "eth"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "smi_mdc_mdio", "gbe_ext_mdc_mdio", "wf0_mode1", "wf0_mode3", "mt7531_int"

Rule 10

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "i2c"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "i2c0_0", "i2c0_1", "u2_phy_i2c", "sgmii1_phy_i2c", "u3_phy_i2c", "sgmii0_phy_i2c", "i2c0_2"

Rule 11

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "led"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "gbe_led0", "gbe_led1", "wf2g_led0", "wf2g_led1", "wf5g_led0", "wf5g_led1"

Rule 12

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "pwm"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Array item rules (items)

Allowed values (enum): "pwm2", "pwm0_0", "pwm0_1", "pwm1_0", "pwm1_1"

Maximum number of items (maxItems): 3

Rule 13

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "spi"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Array item rules (items)

Allowed values (enum): "spi1_0", "spi0", "spi0_wp_hold", "spi1_1", "spi2", "spi2_wp_hold"

Maximum number of items (maxItems): 4

Rule 14

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "uart"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Array item rules (items)

Allowed values (enum): "wm_uart_0", "uart2_0", "net_wo0_uart_txd_0", "net_wo0_uart_txd_1", "net_wo0_uart_txd_2", "uart1_0", "uart1_1", "uart2_1", "wm_aurt_1", "wm_aurt_2", "uart0"

Rule 15

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "watchdog"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "watchdog"

Rule 16

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "flash"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Array item rules (items)

Allowed values (enum): "emmc_45", "snfi"

Maximum number of items (maxItems): 1

Rule 17

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "pcie"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Array item rules (items)

Allowed values (enum): "pcie_clk", "pcie_wake", "pcie_pereset"

Maximum number of items (maxItems): 3

^.*conf.*$ — name matches this regular expression

Value type (type): "object"

Properties not matched by properties or patternProperties in this schema (additionalProperties)

false

Not allowed by this rule.

pinconf configuration nodes.

Shared schema rule ($ref): /schemas/pinctrl/pincfg-node.yaml

Properties and child nodes (properties)

pins — required here

An array of strings. Each string contains the name of a pin.

Array item rules (items)

Allowed values (enum): "GPIO_WPS", "GPIO_RESET", "SYS_WATCHDOG", "PCIE_PERESET_N", "JTAG_JTDO", "JTAG_JTDI", "JTAG_JTMS", "JTAG_JTCLK", "JTAG_JTRST_N", "WO_JTAG_JTDO", "WO_JTAG_JTDI", "WO_JTAG_JTMS", "WO_JTAG_JTCLK", "WO_JTAG_JTRST_N", "USB_VBUS", "PWM0", "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO", "SPI0_CS", "SPI0_HOLD", "SPI0_WP", "SPI1_CLK", "SPI1_MOSI", "SPI1_MISO", "SPI1_CS", "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO", "SPI2_CS", "SPI2_HOLD", "SPI2_WP", "UART0_RXD", "UART0_TXD", "PCIE_CLK_REQ", "PCIE_WAKE_N", "SMI_MDC", "SMI_MDIO", "GBE_INT", "GBE_RESET", "WF_DIG_RESETB", "WF_CBA_RESETB", "WF_XO_REQ", "WF_TOP_CLK", "WF_TOP_DATA", "WF_HB1", "WF_HB2", "WF_HB3", "WF_HB4", "WF_HB0", "WF_HB0_B", "WF_HB5", "WF_HB6", "WF_HB7", "WF_HB8", "WF_HB9", "WF_HB10"

Maximum number of items (maxItems): 57

bias-disable — not listed as required here

true — No constraints added by this property rule.

bias-pull-up — not listed as required here

Exactly one of these rules must match (oneOf)

Rule 1

Value type (type): "boolean"

normal pull up.

Rule 2

Allowed values (enum): 100, 101, 102, 103

PUPD/R1/R0 pull down type. See MTK_PUPD_SET_R1R0 defines in dt-bindings/pinctrl/mt65xx.h.

bias-pull-down — not listed as required here

Exactly one of these rules must match (oneOf)

Rule 1

Value type (type): "boolean"

normal pull down.

Rule 2

Allowed values (enum): 100, 101, 102, 103

PUPD/R1/R0 pull down type. See MTK_PUPD_SET_R1R0 defines in dt-bindings/pinctrl/mt65xx.h.

input-enable — not listed as required here

true — No constraints added by this property rule.

input-disable — not listed as required here

true — No constraints added by this property rule.

output-enable — not listed as required here

true — No constraints added by this property rule.

output-low — not listed as required here

true — No constraints added by this property rule.

output-high — not listed as required here

true — No constraints added by this property rule.

input-schmitt-enable — not listed as required here

true — No constraints added by this property rule.

input-schmitt-disable — not listed as required here

true — No constraints added by this property rule.

drive-strength — not listed as required here

Allowed values (enum): 2, 4, 6, 8, 10, 12, 14, 16

mediatek,pull-up-adv — not listed as required here

Valid arguments for 'mediatek,pull-up-adv' are '0', '1', '2', '3' Pull up settings for 2 pull resistors, R0 and R1. Valid arguments are described as below: 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Allowed values (enum): 0, 1, 2, 3

mediatek,pull-down-adv — not listed as required here

Valid arguments for 'mediatek,pull-up-adv' are '0', '1', '2', '3' Pull down settings for 2 pull resistors, R0 and R1. Valid arguments are described as below: 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Allowed values (enum): 0, 1, 2, 3

Required in this object (required): "pins"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/pinctrl/mt65xx.h>

soc {
  #address-cells = <2>;
  #size-cells = <2>;
  pio: pinctrl@11d00000 {
    compatible = "mediatek,mt7981-pinctrl";
    reg = <0 0x11d00000 0 0x1000>,
          <0 0x11c00000 0 0x1000>,
          <0 0x11c10000 0 0x1000>,
          <0 0x11d20000 0 0x1000>,
          <0 0x11e00000 0 0x1000>,
          <0 0x11e20000 0 0x1000>,
          <0 0x11f00000 0 0x1000>,
          <0 0x11f10000 0 0x1000>,
          <0 0x1000b000 0 0x1000>;
    reg-names = "gpio", "iocfg_rt", "iocfg_rm",
                "iocfg_rb", "iocfg_lb", "iocfg_bl",
                "iocfg_tm", "iocfg_tl", "eint";
    gpio-controller;
    #gpio-cells = <2>;
    gpio-ranges = <&pio 0 0 56>;
    interrupt-controller;
    interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
    interrupt-parent = <&gic>;
    #interrupt-cells = <2>;

    mdio_pins: mdio-pins {
      mux {
        function = "eth";
        groups = "smi_mdc_mdio";
      };
    };

    spi0_flash_pins: spi0-pins {
      mux {
        function = "spi";
        groups = "spi0", "spi0_wp_hold";
      };

      conf-pu {
        pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
        drive-strength = <MTK_DRIVE_8mA>;
        bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
      };

      conf-pd {
        pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
        drive-strength = <MTK_DRIVE_8mA>;
        bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
      };
    };

    pcie_pins: pcie-pins {
      mux {
        function = "pcie";
        groups = "pcie_clk", "pcie_wake", "pcie_pereset";
      };
    };

  };
};

Source notes #

Annotations retained from the schema source

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

Edit this page