MediaTek MT7986 Pin Controller

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

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

Maintainers (maintainers): "Sean Wang <sean.wang@kernel.org>"

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

Properties and child nodes (properties) #

compatible — required here #

Allowed values (enum): "mediatek,mt7986a-pinctrl", "mediatek,mt7986b-pinctrl"

reg — required here #

Minimum number of items (minItems): 8

Maximum number of items (maxItems): 8

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_rb"

Item 4

Exact value (const): "iocfg_lt"

Item 5

Exact value (const): "iocfg_lb"

Item 6

Exact value (const): "iocfg_tr"

Item 7

Exact value (const): "iocfg_tl"

Item 8

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#)
---------------------------------------------------------------------
"watchdog"        "watchdog"  0
"wifi_led"        "led"       1, 2
"i2c"             "i2c"       3, 4
"uart1_0"         "uart"      7, 8, 9, 10
"uart1_rx_tx"     "uart"      42, 43
"uart1_cts_rts"   "uart"      44, 45
"pcie_clk"        "pcie"      9
"pcie_wake"       "pcie"      10
"spi1_0"          "spi"       11, 12, 13, 14
"pwm1_1"          "pwm"       20,
"pwm0"            "pwm"       21,
"pwm1_0"          "pwm"       22,
"snfi"            "flash"     23, 24, 25, 26, 27, 28
"spi1_2"          "spi"       29, 30, 31, 32
"emmc_45"         "emmc"      22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
                              32
"spi1_1"          "spi"       23, 24, 25, 26
"uart1_2_rx_tx"   "uart"      29, 30
"uart1_2_cts_rts" "uart"      31, 32
"uart1_1"         "uart"      23, 24, 25, 26
"uart2_0_rx_tx"   "uart"      29, 30
"uart2_0_cts_rts" "uart"      31, 32
"spi0"            "spi"       33, 34, 35, 36
"spi0_wp_hold"    "spi"       37, 38
"uart1_3_rx_tx"   "uart"      35, 36
"uart1_3_cts_rts" "uart"      37, 38
"uart2_1"         "uart"      33, 34, 35, 36
"spi1_3"          "spi"       33, 34, 35, 36
"uart0"           "uart"      39, 40
"pcie_pereset"    "pcie"      41
"uart1"           "uart"      42, 43, 44, 45
"uart2"           "uart"      46, 47, 48, 49
"emmc_51"         "emmc"      50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
                              60, 61
"pcm"             "audio"     62, 63, 64, 65
"i2s"             "audio"     62, 63, 64, 65
"switch_int"      "eth"       66
"mdc_mdio"        "eth"       67
"wf_2g"           "wifi"      74, 75, 76, 77, 78, 79, 80, 81, 82, 83
"wf_5g"           "wifi"      91, 92, 93, 94, 95, 96, 97, 98, 99, 100
"wf_dbdc"         "wifi"      74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
                              84, 85

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. There is no "audio", "pcie" functions on mt7986b, you can only use those functions on mt7986a.

Allowed values (enum): "audio", "emmc", "eth", "i2c", "led", "flash", "pcie", "pwm", "spi", "uart", "watchdog", "wifi"

groups — required here

An array of strings. Each string contains the name of a group. There is no "pcie_pereset", "uart1", "uart2" "emmc_51", "pcm", and "i2s" groups on mt7986b, you can only use those groups on mt7986a.

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): "audio"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Allowed values (enum): "pcm", "i2s"

Rule 2

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "emmc"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

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

Rule 3

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): "switch_int", "mdc_mdio"

Rule 4

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): "i2c"

Rule 5

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): "wifi_led"

Rule 6

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

Allowed values (enum): "snfi"

Rule 7

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

Rule 8

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): "pwm0", "pwm1_0", "pwm1_1"

Maximum number of items (maxItems): 2

Rule 9

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): "spi0", "spi0_wp_hold", "spi1_0", "spi1_1", "spi1_2", "spi1_3"

Maximum number of items (maxItems): 2

Rule 10

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): "uart1_0", "uart1_rx_tx", "uart1_cts_rts", "uart1_1", "uart1_2_rx_tx", "uart1_2_cts_rts", "uart1_3_rx_tx", "uart1_3_cts_rts", "uart2_0_rx_tx", "uart2_0_cts_rts", "uart2_1", "uart0", "uart1", "uart2"

Maximum number of items (maxItems): 2

Rule 11

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 12

Condition (if)

Properties and child nodes (properties)

function — not listed as required here

Exact value (const): "wifi"

When the condition matches (then)

Properties and child nodes (properties)

groups — not listed as required here

Array item rules (items)

Allowed values (enum): "wf_2g", "wf_5g", "wf_dbdc"

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. There is no PIN 41 to PIN 65 above on mt7686b, you can only use those pins on mt7986a.

Array item rules (items)

Allowed values (enum): "SYS_WATCHDOG", "WF2G_LED", "WF5G_LED", "I2C_SCL", "I2C_SDA", "GPIO_0", "GPIO_1", "GPIO_2", "GPIO_3", "GPIO_4", "GPIO_5", "GPIO_6", "GPIO_7", "GPIO_8", "GPIO_9", "GPIO_10", "GPIO_11", "GPIO_12", "GPIO_13", "GPIO_14", "GPIO_15", "PWM0", "PWM1", "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_PERESET_N", "UART1_RXD", "UART1_TXD", "UART1_CTS", "UART1_RTS", "UART2_RXD", "UART2_TXD", "UART2_CTS", "UART2_RTS", "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD", "EMMC_CK", "EMMC_DSL", "EMMC_RSTB", "PCM_DTX", "PCM_DRX", "PCM_CLK", "PCM_FS", "MT7531_INT", "SMI_MDC", "SMI_MDIO", "WF0_DIG_RESETB", "WF0_CBA_RESETB", "WF0_XO_REQ", "WF0_TOP_CLK", "WF0_TOP_DATA", "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", "WF1_DIG_RESETB", "WF1_CBA_RESETB", "WF1_XO_REQ", "WF1_TOP_CLK", "WF1_TOP_DATA", "WF1_HB1", "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", "WF1_HB0_B", "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8"

Maximum number of items (maxItems): 101

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@1001f000 {
    compatible = "mediatek,mt7986a-pinctrl";
    reg = <0 0x1001f000 0 0x1000>,
          <0 0x11c30000 0 0x1000>,
          <0 0x11c40000 0 0x1000>,
          <0 0x11e20000 0 0x1000>,
          <0 0x11e30000 0 0x1000>,
          <0 0x11f00000 0 0x1000>,
          <0 0x11f10000 0 0x1000>,
          <0 0x1000b000 0 0x1000>;
    reg-names = "gpio", "iocfg_rt", "iocfg_rb", "iocfg_lt",
                "iocfg_lb", "iocfg_tr", "iocfg_tl", "eint";
    gpio-controller;
    #gpio-cells = <2>;
    gpio-ranges = <&pio 0 0 100>;
    interrupt-controller;
    interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
    interrupt-parent = <&gic>;
    #interrupt-cells = <2>;

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

    pwm_pins: pwm-pins {
      mux {
        function = "pwm";
        groups = "pwm0", "pwm1_0";
      };
    };

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

    uart1_pins: uart1-pins {
      mux {
        function = "uart";
        groups = "uart1";
      };
    };

    uart1_3_pins: uart1-3-pins {
      mux {
        function = "uart";
        groups = "uart1_3_rx_tx", "uart1_3_cts_rts";
      };
    };

    uart2_pins: uart2-pins {
      mux {
        function = "uart";
        groups = "uart2";
      };
    };

    mmc0_pins_default: mmc0-pins {
      mux {
        function = "emmc";
        groups = "emmc_51";
      };
      conf-cmd-dat {
        pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
               "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
               "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
        input-enable;
        drive-strength = <4>;
        bias-pull-up = <MTK_PUPD_SET_R1R0_01>; /* pull-up 10K */
      };
      conf-clk {
        pins = "EMMC_CK";
        drive-strength = <6>;
        bias-pull-down = <MTK_PUPD_SET_R1R0_10>; /* pull-down 50K */
      };
      conf-ds {
        pins = "EMMC_DSL";
        bias-pull-down = <MTK_PUPD_SET_R1R0_10>; /* pull-down 50K */
      };
      conf-rst {
        pins = "EMMC_RSTB";
        drive-strength = <4>;
        bias-pull-up = <MTK_PUPD_SET_R1R0_01>; /* pull-up 10K */
      };
    };

  };
};

Source notes #

Annotations retained from the schema source

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

Edit this page