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