11d45ecb0SArınç ÜNAL# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 21d45ecb0SArınç ÜNAL%YAML 1.2 31d45ecb0SArınç ÜNAL--- 41d45ecb0SArınç ÜNAL$id: http://devicetree.org/schemas/pinctrl/mediatek,mt8195-pinctrl.yaml# 51d45ecb0SArınç ÜNAL$schema: http://devicetree.org/meta-schemas/core.yaml# 61d45ecb0SArınç ÜNAL 7a9d44c4cSArınç ÜNALtitle: MediaTek MT8195 Pin Controller 81d45ecb0SArınç ÜNAL 91d45ecb0SArınç ÜNALmaintainers: 101d45ecb0SArınç ÜNAL - Sean Wang <sean.wang@mediatek.com> 111d45ecb0SArınç ÜNAL 12c911ad22SArınç ÜNALdescription: 13a9d44c4cSArınç ÜNAL The MediaTek's MT8195 Pin controller is used to control SoC pins. 141d45ecb0SArınç ÜNAL 151d45ecb0SArınç ÜNALproperties: 161d45ecb0SArınç ÜNAL compatible: 171d45ecb0SArınç ÜNAL const: mediatek,mt8195-pinctrl 181d45ecb0SArınç ÜNAL 191d45ecb0SArınç ÜNAL gpio-controller: true 201d45ecb0SArınç ÜNAL 211d45ecb0SArınç ÜNAL '#gpio-cells': 22c911ad22SArınç ÜNAL description: 231d45ecb0SArınç ÜNAL Number of cells in GPIO specifier. Since the generic GPIO binding is used, 24c911ad22SArınç ÜNAL the amount of cells must be specified as 2. See the below mentioned gpio 25c911ad22SArınç ÜNAL binding representation for description of particular cells. 261d45ecb0SArınç ÜNAL const: 2 271d45ecb0SArınç ÜNAL 281d45ecb0SArınç ÜNAL gpio-ranges: 29c911ad22SArınç ÜNAL description: GPIO valid number range. 301d45ecb0SArınç ÜNAL maxItems: 1 311d45ecb0SArınç ÜNAL 321d45ecb0SArınç ÜNAL gpio-line-names: true 331d45ecb0SArınç ÜNAL 341d45ecb0SArınç ÜNAL reg: 35c911ad22SArınç ÜNAL description: 36c911ad22SArınç ÜNAL Physical address base for GPIO base registers. There are 8 GPIO physical 37c911ad22SArınç ÜNAL address base in mt8195. 381d45ecb0SArınç ÜNAL maxItems: 8 391d45ecb0SArınç ÜNAL 401d45ecb0SArınç ÜNAL reg-names: 41c911ad22SArınç ÜNAL description: 42c911ad22SArınç ÜNAL GPIO base register names. 431d45ecb0SArınç ÜNAL maxItems: 8 441d45ecb0SArınç ÜNAL 451d45ecb0SArınç ÜNAL interrupt-controller: true 461d45ecb0SArınç ÜNAL 471d45ecb0SArınç ÜNAL '#interrupt-cells': 481d45ecb0SArınç ÜNAL const: 2 491d45ecb0SArınç ÜNAL 501d45ecb0SArınç ÜNAL interrupts: 511d45ecb0SArınç ÜNAL description: The interrupt outputs to sysirq. 521d45ecb0SArınç ÜNAL maxItems: 1 531d45ecb0SArınç ÜNAL 541d45ecb0SArınç ÜNAL mediatek,rsel-resistance-in-si-unit: 551d45ecb0SArınç ÜNAL type: boolean 56c911ad22SArınç ÜNAL description: 57c911ad22SArınç ÜNAL Identifying i2c pins pull up/down type which is RSEL. It can support RSEL 58c911ad22SArınç ÜNAL define or si unit value(ohm) to set different resistance. 591d45ecb0SArınç ÜNAL 601d45ecb0SArınç ÜNAL# PIN CONFIGURATION NODES 611d45ecb0SArınç ÜNALpatternProperties: 621d45ecb0SArınç ÜNAL '-pins$': 631d45ecb0SArınç ÜNAL type: object 641d45ecb0SArınç ÜNAL additionalProperties: false 651d45ecb0SArınç ÜNAL patternProperties: 661d45ecb0SArınç ÜNAL '^pins': 671d45ecb0SArınç ÜNAL type: object 681d45ecb0SArınç ÜNAL additionalProperties: false 691d45ecb0SArınç ÜNAL description: | 701d45ecb0SArınç ÜNAL A pinctrl node should contain at least one subnodes representing the 711d45ecb0SArınç ÜNAL pinctrl groups available on the machine. Each subnode will list the 721d45ecb0SArınç ÜNAL pins it needs, and how they should be configured, with regard to muxer 73c911ad22SArınç ÜNAL configuration, pullups, drive strength, input enable/disable and input 74c911ad22SArınç ÜNAL schmitt. 751d45ecb0SArınç ÜNAL An example of using macro: 761d45ecb0SArınç ÜNAL pincontroller { 771d45ecb0SArınç ÜNAL /* GPIO0 set as multifunction GPIO0 */ 781d45ecb0SArınç ÜNAL gpio-pins { 791d45ecb0SArınç ÜNAL pins { 801d45ecb0SArınç ÜNAL pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; 811d45ecb0SArınç ÜNAL } 821d45ecb0SArınç ÜNAL }; 831d45ecb0SArınç ÜNAL /* GPIO8 set as multifunction SDA0 */ 841d45ecb0SArınç ÜNAL i2c0-pins { 851d45ecb0SArınç ÜNAL pins { 861d45ecb0SArınç ÜNAL pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 871d45ecb0SArınç ÜNAL } 881d45ecb0SArınç ÜNAL }; 891d45ecb0SArınç ÜNAL }; 90*6a735ad5SArınç ÜNAL $ref: pinmux-node.yaml 911d45ecb0SArınç ÜNAL 921d45ecb0SArınç ÜNAL properties: 931d45ecb0SArınç ÜNAL pinmux: 94c911ad22SArınç ÜNAL description: 951d45ecb0SArınç ÜNAL Integer array, represents gpio pin number and mux setting. 961d45ecb0SArınç ÜNAL Supported pin number and mux varies for different SoCs, and are 97c911ad22SArınç ÜNAL defined as macros in dt-bindings/pinctrl/<soc>-pinfunc.h directly. 981d45ecb0SArınç ÜNAL 991d45ecb0SArınç ÜNAL drive-strength: 1001d45ecb0SArınç ÜNAL enum: [2, 4, 6, 8, 10, 12, 14, 16] 1011d45ecb0SArınç ÜNAL 1021d45ecb0SArınç ÜNAL drive-strength-microamp: 1031d45ecb0SArınç ÜNAL enum: [125, 250, 500, 1000] 1041d45ecb0SArınç ÜNAL 1051d45ecb0SArınç ÜNAL bias-pull-down: 1061d45ecb0SArınç ÜNAL oneOf: 1071d45ecb0SArınç ÜNAL - type: boolean 1081d45ecb0SArınç ÜNAL - enum: [100, 101, 102, 103] 1091d45ecb0SArınç ÜNAL description: mt8195 pull down PUPD/R0/R1 type define value. 1101d45ecb0SArınç ÜNAL - enum: [200, 201, 202, 203, 204, 205, 206, 207] 1111d45ecb0SArınç ÜNAL description: mt8195 pull down RSEL type define value. 1121d45ecb0SArınç ÜNAL - enum: [75000, 5000] 1131d45ecb0SArınç ÜNAL description: mt8195 pull down RSEL type si unit value(ohm). 1141d45ecb0SArınç ÜNAL description: | 1151d45ecb0SArınç ÜNAL For pull down type is normal, it don't need add RSEL & R1R0 define 1161d45ecb0SArınç ÜNAL and resistance value. 1171d45ecb0SArınç ÜNAL For pull down type is PUPD/R0/R1 type, it can add R1R0 define to 1181d45ecb0SArınç ÜNAL set different resistance. It can support "MTK_PUPD_SET_R1R0_00" & 1191d45ecb0SArınç ÜNAL "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & 1201d45ecb0SArınç ÜNAL "MTK_PUPD_SET_R1R0_11" define in mt8195. 1211d45ecb0SArınç ÜNAL For pull down type is RSEL, it can add RSEL define & resistance 1221d45ecb0SArınç ÜNAL value(ohm) to set different resistance by identifying property 1231d45ecb0SArınç ÜNAL "mediatek,rsel-resistance-in-si-unit". 1241d45ecb0SArınç ÜNAL It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001" 1251d45ecb0SArınç ÜNAL & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" 1261d45ecb0SArınç ÜNAL & "MTK_PULL_SET_RSEL_100" & "MTK_PULL_SET_RSEL_101" 1271d45ecb0SArınç ÜNAL & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111" 1281d45ecb0SArınç ÜNAL define in mt8195. It can also support resistance value(ohm) 1291d45ecb0SArınç ÜNAL "75000" & "5000" in mt8195. 1301d45ecb0SArınç ÜNAL 1311d45ecb0SArınç ÜNAL An example of using RSEL define: 1321d45ecb0SArınç ÜNAL pincontroller { 1331d45ecb0SArınç ÜNAL i2c0_pin { 1341d45ecb0SArınç ÜNAL pins { 1351d45ecb0SArınç ÜNAL pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 1361d45ecb0SArınç ÜNAL bias-pull-down = <MTK_PULL_SET_RSEL_001>; 1371d45ecb0SArınç ÜNAL } 1381d45ecb0SArınç ÜNAL }; 1391d45ecb0SArınç ÜNAL }; 1401d45ecb0SArınç ÜNAL An example of using si unit resistance value(ohm): 1411d45ecb0SArınç ÜNAL &pio { 1421d45ecb0SArınç ÜNAL mediatek,rsel-resistance-in-si-unit; 1431d45ecb0SArınç ÜNAL } 1441d45ecb0SArınç ÜNAL pincontroller { 1451d45ecb0SArınç ÜNAL i2c0_pin { 1461d45ecb0SArınç ÜNAL pins { 1471d45ecb0SArınç ÜNAL pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 1481d45ecb0SArınç ÜNAL bias-pull-down = <75000>; 1491d45ecb0SArınç ÜNAL } 1501d45ecb0SArınç ÜNAL }; 1511d45ecb0SArınç ÜNAL }; 1521d45ecb0SArınç ÜNAL 1531d45ecb0SArınç ÜNAL bias-pull-up: 1541d45ecb0SArınç ÜNAL oneOf: 1551d45ecb0SArınç ÜNAL - type: boolean 1561d45ecb0SArınç ÜNAL - enum: [100, 101, 102, 103] 1571d45ecb0SArınç ÜNAL description: mt8195 pull up PUPD/R0/R1 type define value. 1581d45ecb0SArınç ÜNAL - enum: [200, 201, 202, 203, 204, 205, 206, 207] 1591d45ecb0SArınç ÜNAL description: mt8195 pull up RSEL type define value. 1601d45ecb0SArınç ÜNAL - enum: [1000, 1500, 2000, 3000, 4000, 5000, 10000, 75000] 1611d45ecb0SArınç ÜNAL description: mt8195 pull up RSEL type si unit value(ohm). 1621d45ecb0SArınç ÜNAL description: | 1631d45ecb0SArınç ÜNAL For pull up type is normal, it don't need add RSEL & R1R0 define 1641d45ecb0SArınç ÜNAL and resistance value. 1651d45ecb0SArınç ÜNAL For pull up type is PUPD/R0/R1 type, it can add R1R0 define to 1661d45ecb0SArınç ÜNAL set different resistance. It can support "MTK_PUPD_SET_R1R0_00" & 1671d45ecb0SArınç ÜNAL "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & 1681d45ecb0SArınç ÜNAL "MTK_PUPD_SET_R1R0_11" define in mt8195. 1691d45ecb0SArınç ÜNAL For pull up type is RSEL, it can add RSEL define & resistance 1701d45ecb0SArınç ÜNAL value(ohm) to set different resistance by identifying property 1711d45ecb0SArınç ÜNAL "mediatek,rsel-resistance-in-si-unit". 1721d45ecb0SArınç ÜNAL It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001" 1731d45ecb0SArınç ÜNAL & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" 1741d45ecb0SArınç ÜNAL & "MTK_PULL_SET_RSEL_100" & "MTK_PULL_SET_RSEL_101" 1751d45ecb0SArınç ÜNAL & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111" 176c911ad22SArınç ÜNAL define in mt8195. It can also support resistance value(ohm) "1000" 177c911ad22SArınç ÜNAL & "1500" & "2000" & "3000" & "4000" & "5000" & "10000" & "75000" 178c911ad22SArınç ÜNAL in mt8195. 1791d45ecb0SArınç ÜNAL An example of using RSEL define: 1801d45ecb0SArınç ÜNAL pincontroller { 1811d45ecb0SArınç ÜNAL i2c0-pins { 1821d45ecb0SArınç ÜNAL pins { 1831d45ecb0SArınç ÜNAL pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 1841d45ecb0SArınç ÜNAL bias-pull-up = <MTK_PULL_SET_RSEL_001>; 1851d45ecb0SArınç ÜNAL } 1861d45ecb0SArınç ÜNAL }; 1871d45ecb0SArınç ÜNAL }; 1881d45ecb0SArınç ÜNAL An example of using si unit resistance value(ohm): 1891d45ecb0SArınç ÜNAL &pio { 1901d45ecb0SArınç ÜNAL mediatek,rsel-resistance-in-si-unit; 1911d45ecb0SArınç ÜNAL } 1921d45ecb0SArınç ÜNAL pincontroller { 1931d45ecb0SArınç ÜNAL i2c0-pins { 1941d45ecb0SArınç ÜNAL pins { 1951d45ecb0SArınç ÜNAL pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 1961d45ecb0SArınç ÜNAL bias-pull-up = <1000>; 1971d45ecb0SArınç ÜNAL } 1981d45ecb0SArınç ÜNAL }; 1991d45ecb0SArınç ÜNAL }; 2001d45ecb0SArınç ÜNAL 2011d45ecb0SArınç ÜNAL bias-disable: true 2021d45ecb0SArınç ÜNAL 2031d45ecb0SArınç ÜNAL output-high: true 2041d45ecb0SArınç ÜNAL 2051d45ecb0SArınç ÜNAL output-low: true 2061d45ecb0SArınç ÜNAL 2071d45ecb0SArınç ÜNAL input-enable: true 2081d45ecb0SArınç ÜNAL 2091d45ecb0SArınç ÜNAL input-disable: true 2101d45ecb0SArınç ÜNAL 2111d45ecb0SArınç ÜNAL input-schmitt-enable: true 2121d45ecb0SArınç ÜNAL 2131d45ecb0SArınç ÜNAL input-schmitt-disable: true 2141d45ecb0SArınç ÜNAL 2151d45ecb0SArınç ÜNAL required: 2161d45ecb0SArınç ÜNAL - pinmux 2171d45ecb0SArınç ÜNAL 2181d45ecb0SArınç ÜNALallOf: 219*6a735ad5SArınç ÜNAL - $ref: pinctrl.yaml# 2201d45ecb0SArınç ÜNAL 2211d45ecb0SArınç ÜNALrequired: 2221d45ecb0SArınç ÜNAL - compatible 2231d45ecb0SArınç ÜNAL - reg 2241d45ecb0SArınç ÜNAL - interrupts 2251d45ecb0SArınç ÜNAL - interrupt-controller 2261d45ecb0SArınç ÜNAL - '#interrupt-cells' 2271d45ecb0SArınç ÜNAL - gpio-controller 2281d45ecb0SArınç ÜNAL - '#gpio-cells' 2291d45ecb0SArınç ÜNAL - gpio-ranges 2301d45ecb0SArınç ÜNAL 2311d45ecb0SArınç ÜNALadditionalProperties: false 2321d45ecb0SArınç ÜNAL 2331d45ecb0SArınç ÜNALexamples: 2341d45ecb0SArınç ÜNAL - | 2351d45ecb0SArınç ÜNAL #include <dt-bindings/pinctrl/mt8195-pinfunc.h> 2361d45ecb0SArınç ÜNAL #include <dt-bindings/interrupt-controller/arm-gic.h> 2371d45ecb0SArınç ÜNAL # 2381d45ecb0SArınç ÜNAL pio: pinctrl@10005000 { 2391d45ecb0SArınç ÜNAL compatible = "mediatek,mt8195-pinctrl"; 2401d45ecb0SArınç ÜNAL reg = <0x10005000 0x1000>, 2411d45ecb0SArınç ÜNAL <0x11d10000 0x1000>, 2421d45ecb0SArınç ÜNAL <0x11d30000 0x1000>, 2431d45ecb0SArınç ÜNAL <0x11d40000 0x1000>, 2441d45ecb0SArınç ÜNAL <0x11e20000 0x1000>, 2451d45ecb0SArınç ÜNAL <0x11eb0000 0x1000>, 2461d45ecb0SArınç ÜNAL <0x11f40000 0x1000>, 2471d45ecb0SArınç ÜNAL <0x1000b000 0x1000>; 2481d45ecb0SArınç ÜNAL reg-names = "iocfg0", "iocfg_bm", "iocfg_bl", 2491d45ecb0SArınç ÜNAL "iocfg_br", "iocfg_lm", "iocfg_rb", 2501d45ecb0SArınç ÜNAL "iocfg_tl", "eint"; 2511d45ecb0SArınç ÜNAL gpio-controller; 2521d45ecb0SArınç ÜNAL #gpio-cells = <2>; 2531d45ecb0SArınç ÜNAL gpio-ranges = <&pio 0 0 144>; 2541d45ecb0SArınç ÜNAL interrupt-controller; 2551d45ecb0SArınç ÜNAL interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH 0>; 2561d45ecb0SArınç ÜNAL #interrupt-cells = <2>; 2571d45ecb0SArınç ÜNAL 2581d45ecb0SArınç ÜNAL pio-pins { 2591d45ecb0SArınç ÜNAL pins { 2601d45ecb0SArınç ÜNAL pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; 2611d45ecb0SArınç ÜNAL output-low; 2621d45ecb0SArınç ÜNAL }; 2631d45ecb0SArınç ÜNAL }; 2641d45ecb0SArınç ÜNAL 2651d45ecb0SArınç ÜNAL spi0-pins { 2661d45ecb0SArınç ÜNAL pins-spi { 2671d45ecb0SArınç ÜNAL pinmux = <PINMUX_GPIO132__FUNC_SPIM0_CSB>, 2681d45ecb0SArınç ÜNAL <PINMUX_GPIO134__FUNC_SPIM0_MO>, 2691d45ecb0SArınç ÜNAL <PINMUX_GPIO133__FUNC_SPIM0_CLK>; 2701d45ecb0SArınç ÜNAL bias-disable; 2711d45ecb0SArınç ÜNAL }; 2721d45ecb0SArınç ÜNAL pins-spi-mi { 2731d45ecb0SArınç ÜNAL pinmux = <PINMUX_GPIO135__FUNC_SPIM0_MI>; 2741d45ecb0SArınç ÜNAL bias-pull-down; 2751d45ecb0SArınç ÜNAL }; 2761d45ecb0SArınç ÜNAL }; 2771d45ecb0SArınç ÜNAL 2781d45ecb0SArınç ÜNAL i2c0-pins { 2791d45ecb0SArınç ÜNAL pins { 2801d45ecb0SArınç ÜNAL pinmux = <PINMUX_GPIO8__FUNC_SDA0>, 2811d45ecb0SArınç ÜNAL <PINMUX_GPIO9__FUNC_SCL0>; 2821d45ecb0SArınç ÜNAL bias-disable; 2831d45ecb0SArınç ÜNAL drive-strength-microamp = <1000>; 2841d45ecb0SArınç ÜNAL }; 2851d45ecb0SArınç ÜNAL }; 2861d45ecb0SArınç ÜNAL }; 287