1ff01f753SArınç ÜNAL# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2ff01f753SArınç ÜNAL%YAML 1.2 3ff01f753SArınç ÜNAL--- 4ff01f753SArınç ÜNAL$id: http://devicetree.org/schemas/pinctrl/mediatek,mt8186-pinctrl.yaml# 5ff01f753SArınç ÜNAL$schema: http://devicetree.org/meta-schemas/core.yaml# 6ff01f753SArınç ÜNAL 7a9d44c4cSArınç ÜNALtitle: MediaTek MT8186 Pin Controller 8ff01f753SArınç ÜNAL 9ff01f753SArınç ÜNALmaintainers: 10ff01f753SArınç ÜNAL - Sean Wang <sean.wang@mediatek.com> 11ff01f753SArınç ÜNAL 12c911ad22SArınç ÜNALdescription: 13a9d44c4cSArınç ÜNAL The MediaTek's MT8186 Pin controller is used to control SoC pins. 14ff01f753SArınç ÜNAL 15ff01f753SArınç ÜNALproperties: 16ff01f753SArınç ÜNAL compatible: 17ff01f753SArınç ÜNAL const: mediatek,mt8186-pinctrl 18ff01f753SArınç ÜNAL 19ff01f753SArınç ÜNAL gpio-controller: true 20ff01f753SArınç ÜNAL 21ff01f753SArınç ÜNAL '#gpio-cells': 22c911ad22SArınç ÜNAL description: 23ff01f753SArı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. 26ff01f753SArınç ÜNAL const: 2 27ff01f753SArınç ÜNAL 28ff01f753SArınç ÜNAL gpio-ranges: 29ff01f753SArınç ÜNAL maxItems: 1 30ff01f753SArınç ÜNAL 31ff01f753SArınç ÜNAL gpio-line-names: true 32ff01f753SArınç ÜNAL 33ff01f753SArınç ÜNAL reg: 34c911ad22SArınç ÜNAL description: 35c911ad22SArınç ÜNAL Physical address base for GPIO base registers. There are 8 different GPIO 36ff01f753SArınç ÜNAL physical address base in mt8186. 37ff01f753SArınç ÜNAL maxItems: 8 38ff01f753SArınç ÜNAL 39ff01f753SArınç ÜNAL reg-names: 40c911ad22SArınç ÜNAL description: 41c911ad22SArınç ÜNAL GPIO base register names. 42ff01f753SArınç ÜNAL items: 43ff01f753SArınç ÜNAL - const: iocfg0 44ff01f753SArınç ÜNAL - const: iocfg_lt 45ff01f753SArınç ÜNAL - const: iocfg_lm 46ff01f753SArınç ÜNAL - const: iocfg_lb 47ff01f753SArınç ÜNAL - const: iocfg_bl 48ff01f753SArınç ÜNAL - const: iocfg_rb 49ff01f753SArınç ÜNAL - const: iocfg_rt 50ff01f753SArınç ÜNAL - const: eint 51ff01f753SArınç ÜNAL 52ff01f753SArınç ÜNAL interrupt-controller: true 53ff01f753SArınç ÜNAL 54ff01f753SArınç ÜNAL '#interrupt-cells': 55ff01f753SArınç ÜNAL const: 2 56ff01f753SArınç ÜNAL 57ff01f753SArınç ÜNAL interrupts: 58ff01f753SArınç ÜNAL description: The interrupt outputs to sysirq 59ff01f753SArınç ÜNAL maxItems: 1 60ff01f753SArınç ÜNAL 61ff01f753SArınç ÜNAL mediatek,rsel-resistance-in-si-unit: 62ff01f753SArınç ÜNAL type: boolean 63c911ad22SArınç ÜNAL description: 64c911ad22SArınç ÜNAL Identifying i2c pins pull up/down type which is RSEL. It can support RSEL 65c911ad22SArınç ÜNAL define or si unit value(ohm) to set different resistance. 66ff01f753SArınç ÜNAL 67ff01f753SArınç ÜNAL# PIN CONFIGURATION NODES 68ff01f753SArınç ÜNALpatternProperties: 69ff01f753SArınç ÜNAL '-pins$': 70ff01f753SArınç ÜNAL type: object 71ff01f753SArınç ÜNAL additionalProperties: false 72ff01f753SArınç ÜNAL patternProperties: 73ff01f753SArınç ÜNAL '^pins': 74ff01f753SArınç ÜNAL type: object 75ff01f753SArınç ÜNAL additionalProperties: false 76ff01f753SArınç ÜNAL description: | 77ff01f753SArınç ÜNAL A pinctrl node should contain at least one subnodes representing the 78ff01f753SArınç ÜNAL pinctrl groups available on the machine. Each subnode will list the 79ff01f753SArınç ÜNAL pins it needs, and how they should be configured, with regard to muxer 80c911ad22SArınç ÜNAL configuration, pullups, drive strength, input enable/disable and input 81c911ad22SArınç ÜNAL schmitt. 82ff01f753SArınç ÜNAL An example of using macro: 83ff01f753SArınç ÜNAL pincontroller { 84ff01f753SArınç ÜNAL /* GPIO0 set as multifunction GPIO0 */ 85ff01f753SArınç ÜNAL gpio-pins { 86ff01f753SArınç ÜNAL pins { 87ff01f753SArınç ÜNAL pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; 88ff01f753SArınç ÜNAL } 89ff01f753SArınç ÜNAL }; 90ff01f753SArınç ÜNAL /* GPIO128 set as multifunction SDA0 */ 91ff01f753SArınç ÜNAL i2c0-pins { 92ff01f753SArınç ÜNAL pins { 93ff01f753SArınç ÜNAL pinmux = <PINMUX_GPIO128__FUNC_SDA0>; 94ff01f753SArınç ÜNAL } 95ff01f753SArınç ÜNAL }; 96ff01f753SArınç ÜNAL }; 97*6a735ad5SArınç ÜNAL $ref: pinmux-node.yaml 98ff01f753SArınç ÜNAL 99ff01f753SArınç ÜNAL properties: 100ff01f753SArınç ÜNAL pinmux: 101c911ad22SArınç ÜNAL description: 102ff01f753SArınç ÜNAL Integer array, represents gpio pin number and mux setting. 103ff01f753SArınç ÜNAL Supported pin number and mux varies for different SoCs, and are 104c911ad22SArınç ÜNAL defined as macros in dt-bindings/pinctrl/<soc>-pinfunc.h directly. 105ff01f753SArınç ÜNAL 106ff01f753SArınç ÜNAL drive-strength: 107ff01f753SArınç ÜNAL enum: [2, 4, 6, 8, 10, 12, 14, 16] 108ff01f753SArınç ÜNAL 109ff01f753SArınç ÜNAL drive-strength-microamp: 110ff01f753SArınç ÜNAL enum: [125, 250, 500, 1000] 111ff01f753SArınç ÜNAL 112ff01f753SArınç ÜNAL bias-pull-down: 113ff01f753SArınç ÜNAL oneOf: 114ff01f753SArınç ÜNAL - type: boolean 115ff01f753SArınç ÜNAL - enum: [100, 101, 102, 103] 116ff01f753SArınç ÜNAL description: mt8186 pull down PUPD/R0/R1 type define value. 117ff01f753SArınç ÜNAL - enum: [200, 201, 202, 203] 118ff01f753SArınç ÜNAL description: mt8186 pull down RSEL type define value. 119ff01f753SArınç ÜNAL - enum: [75000, 5000] 120ff01f753SArınç ÜNAL description: mt8186 pull down RSEL type si unit value(ohm). 121ff01f753SArınç ÜNAL description: | 122ff01f753SArınç ÜNAL For pull down type is normal, it don't need add RSEL & R1R0 define 123ff01f753SArınç ÜNAL and resistance value. 124ff01f753SArınç ÜNAL For pull down type is PUPD/R0/R1 type, it can add R1R0 define to 125ff01f753SArınç ÜNAL set different resistance. It can support "MTK_PUPD_SET_R1R0_00" & 126ff01f753SArınç ÜNAL "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & 127ff01f753SArınç ÜNAL "MTK_PUPD_SET_R1R0_11" define in mt8186. 128ff01f753SArınç ÜNAL For pull down type is RSEL, it can add RSEL define & resistance 129ff01f753SArınç ÜNAL value(ohm) to set different resistance by identifying property 130ff01f753SArınç ÜNAL "mediatek,rsel-resistance-in-si-unit". 131c911ad22SArınç ÜNAL It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001" & 132c911ad22SArınç ÜNAL "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" define in 133c911ad22SArınç ÜNAL mt8186. It can also support resistance value(ohm) "75000" & "5000" 134c911ad22SArınç ÜNAL in mt8186. 135ff01f753SArınç ÜNAL An example of using RSEL define: 136ff01f753SArınç ÜNAL pincontroller { 137ff01f753SArınç ÜNAL i2c0_pin { 138ff01f753SArınç ÜNAL pins { 139ff01f753SArınç ÜNAL pinmux = <PINMUX_GPIO128__FUNC_SDA0>; 140ff01f753SArınç ÜNAL bias-pull-down = <MTK_PULL_SET_RSEL_001>; 141ff01f753SArınç ÜNAL } 142ff01f753SArınç ÜNAL }; 143ff01f753SArınç ÜNAL }; 144ff01f753SArınç ÜNAL An example of using si unit resistance value(ohm): 145ff01f753SArınç ÜNAL &pio { 146ff01f753SArınç ÜNAL mediatek,rsel-resistance-in-si-unit; 147ff01f753SArınç ÜNAL } 148ff01f753SArınç ÜNAL pincontroller { 149ff01f753SArınç ÜNAL i2c0_pin { 150ff01f753SArınç ÜNAL pins { 151ff01f753SArınç ÜNAL pinmux = <PINMUX_GPIO128__FUNC_SDA0>; 152ff01f753SArınç ÜNAL bias-pull-down = <75000>; 153ff01f753SArınç ÜNAL } 154ff01f753SArınç ÜNAL }; 155ff01f753SArınç ÜNAL }; 156ff01f753SArınç ÜNAL 157ff01f753SArınç ÜNAL bias-pull-up: 158ff01f753SArınç ÜNAL oneOf: 159ff01f753SArınç ÜNAL - type: boolean 160ff01f753SArınç ÜNAL - enum: [100, 101, 102, 103] 161ff01f753SArınç ÜNAL description: mt8186 pull up PUPD/R0/R1 type define value. 162ff01f753SArınç ÜNAL - enum: [200, 201, 202, 203] 163ff01f753SArınç ÜNAL description: mt8186 pull up RSEL type define value. 164ff01f753SArınç ÜNAL - enum: [1000, 5000, 10000, 75000] 165ff01f753SArınç ÜNAL description: mt8186 pull up RSEL type si unit value(ohm). 166ff01f753SArınç ÜNAL description: | 167ff01f753SArınç ÜNAL For pull up type is normal, it don't need add RSEL & R1R0 define 168ff01f753SArınç ÜNAL and resistance value. 169ff01f753SArınç ÜNAL For pull up type is PUPD/R0/R1 type, it can add R1R0 define to 170ff01f753SArınç ÜNAL set different resistance. It can support "MTK_PUPD_SET_R1R0_00" & 171ff01f753SArınç ÜNAL "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & 172ff01f753SArınç ÜNAL "MTK_PUPD_SET_R1R0_11" define in mt8186. 173ff01f753SArınç ÜNAL For pull up type is RSEL, it can add RSEL define & resistance 174ff01f753SArınç ÜNAL value(ohm) to set different resistance by identifying property 175ff01f753SArınç ÜNAL "mediatek,rsel-resistance-in-si-unit". 176c911ad22SArınç ÜNAL It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001" & 177c911ad22SArınç ÜNAL "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" define in 178c911ad22SArınç ÜNAL mt8186. It can also support resistance value(ohm) "1000" & "5000" 179c911ad22SArınç ÜNAL & "10000" & "75000" in mt8186. 180ff01f753SArınç ÜNAL An example of using si unit resistance value(ohm): 181ff01f753SArınç ÜNAL &pio { 182ff01f753SArınç ÜNAL mediatek,rsel-resistance-in-si-unit; 183ff01f753SArınç ÜNAL } 184ff01f753SArınç ÜNAL pincontroller { 185ff01f753SArınç ÜNAL i2c0-pins { 186ff01f753SArınç ÜNAL pins { 187ff01f753SArınç ÜNAL pinmux = <PINMUX_GPIO128__FUNC_SDA0>; 188ff01f753SArınç ÜNAL bias-pull-up = <1000>; 189ff01f753SArınç ÜNAL } 190ff01f753SArınç ÜNAL }; 191ff01f753SArınç ÜNAL }; 192ff01f753SArınç ÜNAL 193ff01f753SArınç ÜNAL bias-disable: true 194ff01f753SArınç ÜNAL 195ff01f753SArınç ÜNAL output-high: true 196ff01f753SArınç ÜNAL 197ff01f753SArınç ÜNAL output-low: true 198ff01f753SArınç ÜNAL 199ff01f753SArınç ÜNAL input-enable: true 200ff01f753SArınç ÜNAL 201ff01f753SArınç ÜNAL input-disable: true 202ff01f753SArınç ÜNAL 203ff01f753SArınç ÜNAL input-schmitt-enable: true 204ff01f753SArınç ÜNAL 205ff01f753SArınç ÜNAL input-schmitt-disable: true 206ff01f753SArınç ÜNAL 207ff01f753SArınç ÜNAL required: 208ff01f753SArınç ÜNAL - pinmux 209ff01f753SArınç ÜNAL 210ff01f753SArınç ÜNALrequired: 211ff01f753SArınç ÜNAL - compatible 212ff01f753SArınç ÜNAL - reg 213ff01f753SArınç ÜNAL - interrupts 214ff01f753SArınç ÜNAL - interrupt-controller 215ff01f753SArınç ÜNAL - '#interrupt-cells' 216ff01f753SArınç ÜNAL - gpio-controller 217ff01f753SArınç ÜNAL - '#gpio-cells' 218ff01f753SArınç ÜNAL - gpio-ranges 219ff01f753SArınç ÜNAL 220ff01f753SArınç ÜNALadditionalProperties: false 221ff01f753SArınç ÜNAL 222ff01f753SArınç ÜNALexamples: 223ff01f753SArınç ÜNAL - | 224ff01f753SArınç ÜNAL #include <dt-bindings/pinctrl/mt8186-pinfunc.h> 225ff01f753SArınç ÜNAL #include <dt-bindings/interrupt-controller/arm-gic.h> 226ff01f753SArınç ÜNAL 227ff01f753SArınç ÜNAL pio: pinctrl@10005000 { 228ff01f753SArınç ÜNAL compatible = "mediatek,mt8186-pinctrl"; 229ff01f753SArınç ÜNAL reg = <0x10005000 0x1000>, 230ff01f753SArınç ÜNAL <0x10002000 0x0200>, 231ff01f753SArınç ÜNAL <0x10002200 0x0200>, 232ff01f753SArınç ÜNAL <0x10002400 0x0200>, 233ff01f753SArınç ÜNAL <0x10002600 0x0200>, 234ff01f753SArınç ÜNAL <0x10002A00 0x0200>, 235ff01f753SArınç ÜNAL <0x10002c00 0x0200>, 236ff01f753SArınç ÜNAL <0x1000b000 0x1000>; 237ff01f753SArınç ÜNAL reg-names = "iocfg0", "iocfg_lt", "iocfg_lm", 238ff01f753SArınç ÜNAL "iocfg_lb", "iocfg_bl", "iocfg_rb", 239ff01f753SArınç ÜNAL "iocfg_rt", "eint"; 240ff01f753SArınç ÜNAL gpio-controller; 241ff01f753SArınç ÜNAL #gpio-cells = <2>; 242ff01f753SArınç ÜNAL gpio-ranges = <&pio 0 0 185>; 243ff01f753SArınç ÜNAL interrupt-controller; 244ff01f753SArınç ÜNAL interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH 0>; 245ff01f753SArınç ÜNAL #interrupt-cells = <2>; 246ff01f753SArınç ÜNAL 247ff01f753SArınç ÜNAL pio-pins { 248ff01f753SArınç ÜNAL pins { 249ff01f753SArınç ÜNAL pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; 250ff01f753SArınç ÜNAL output-low; 251ff01f753SArınç ÜNAL }; 252ff01f753SArınç ÜNAL }; 253ff01f753SArınç ÜNAL 254ff01f753SArınç ÜNAL spi0-pins { 255ff01f753SArınç ÜNAL pins-spi { 256ff01f753SArınç ÜNAL pinmux = <PINMUX_GPIO0__FUNC_SPI0_CLK_B>, 257ff01f753SArınç ÜNAL <PINMUX_GPIO1__FUNC_SPI0_CSB_B>, 258ff01f753SArınç ÜNAL <PINMUX_GPIO2__FUNC_SPI0_MO_B>; 259ff01f753SArınç ÜNAL bias-disable; 260ff01f753SArınç ÜNAL }; 261ff01f753SArınç ÜNAL pins-spi-mi { 262ff01f753SArınç ÜNAL pinmux = <PINMUX_GPIO3__FUNC_SPI0_MI_B>; 263ff01f753SArınç ÜNAL bias-pull-down; 264ff01f753SArınç ÜNAL }; 265ff01f753SArınç ÜNAL }; 266ff01f753SArınç ÜNAL 267ff01f753SArınç ÜNAL i2c0-pins { 268ff01f753SArınç ÜNAL pins { 269ff01f753SArınç ÜNAL pinmux = <PINMUX_GPIO127__FUNC_SCL0>, 270ff01f753SArınç ÜNAL <PINMUX_GPIO128__FUNC_SDA0>; 271ff01f753SArınç ÜNAL bias-pull-up = <MTK_PULL_SET_RSEL_001>; 272ff01f753SArınç ÜNAL drive-strength-microamp = <1000>; 273ff01f753SArınç ÜNAL }; 274ff01f753SArınç ÜNAL }; 275ff01f753SArınç ÜNAL }; 276