1*4882a593Smuzhiyun* Mediatek MT65XX Pin Controller 2*4882a593Smuzhiyun 3*4882a593SmuzhiyunThe Mediatek's Pin controller is used to control SoC pins. 4*4882a593Smuzhiyun 5*4882a593SmuzhiyunRequired properties: 6*4882a593Smuzhiyun- compatible: value should be one of the following. 7*4882a593Smuzhiyun "mediatek,mt2701-pinctrl", compatible with mt2701 pinctrl. 8*4882a593Smuzhiyun "mediatek,mt2712-pinctrl", compatible with mt2712 pinctrl. 9*4882a593Smuzhiyun "mediatek,mt6397-pinctrl", compatible with mt6397 pinctrl. 10*4882a593Smuzhiyun "mediatek,mt7623-pinctrl", compatible with mt7623 pinctrl. 11*4882a593Smuzhiyun "mediatek,mt8127-pinctrl", compatible with mt8127 pinctrl. 12*4882a593Smuzhiyun "mediatek,mt8135-pinctrl", compatible with mt8135 pinctrl. 13*4882a593Smuzhiyun "mediatek,mt8167-pinctrl", compatible with mt8167 pinctrl. 14*4882a593Smuzhiyun "mediatek,mt8173-pinctrl", compatible with mt8173 pinctrl. 15*4882a593Smuzhiyun "mediatek,mt8516-pinctrl", compatible with mt8516 pinctrl. 16*4882a593Smuzhiyun- pins-are-numbered: Specify the subnodes are using numbered pinmux to 17*4882a593Smuzhiyun specify pins. 18*4882a593Smuzhiyun- gpio-controller : Marks the device node as a gpio controller. 19*4882a593Smuzhiyun- #gpio-cells: number of cells in GPIO specifier. Since the generic GPIO 20*4882a593Smuzhiyun binding is used, the amount of cells must be specified as 2. See the below 21*4882a593Smuzhiyun mentioned gpio binding representation for description of particular cells. 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun Eg: <&pio 6 0> 24*4882a593Smuzhiyun <[phandle of the gpio controller node] 25*4882a593Smuzhiyun [line number within the gpio controller] 26*4882a593Smuzhiyun [flags]> 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun Values for gpio specifier: 29*4882a593Smuzhiyun - Line number: is a value between 0 to 202. 30*4882a593Smuzhiyun - Flags: bit field of flags, as defined in <dt-bindings/gpio/gpio.h>. 31*4882a593Smuzhiyun Only the following flags are supported: 32*4882a593Smuzhiyun 0 - GPIO_ACTIVE_HIGH 33*4882a593Smuzhiyun 1 - GPIO_ACTIVE_LOW 34*4882a593Smuzhiyun 35*4882a593SmuzhiyunOptional properties: 36*4882a593Smuzhiyun- mediatek,pctl-regmap: Should be a phandle of the syscfg node. 37*4882a593Smuzhiyun- reg: physicall address base for EINT registers 38*4882a593Smuzhiyun- interrupt-controller: Marks the device node as an interrupt controller 39*4882a593Smuzhiyun- #interrupt-cells: Should be two. 40*4882a593Smuzhiyun- interrupts : The interrupt outputs from the controller. 41*4882a593Smuzhiyun 42*4882a593SmuzhiyunPlease refer to pinctrl-bindings.txt in this directory for details of the 43*4882a593Smuzhiyuncommon pinctrl bindings used by client devices. 44*4882a593Smuzhiyun 45*4882a593SmuzhiyunSubnode format 46*4882a593SmuzhiyunA pinctrl node should contain at least one subnodes representing the 47*4882a593Smuzhiyunpinctrl groups available on the machine. Each subnode will list the 48*4882a593Smuzhiyunpins it needs, and how they should be configured, with regard to muxer 49*4882a593Smuzhiyunconfiguration, pullups, drive strength, input enable/disable and input schmitt. 50*4882a593Smuzhiyun 51*4882a593Smuzhiyun node { 52*4882a593Smuzhiyun pinmux = <PIN_NUMBER_PINMUX>; 53*4882a593Smuzhiyun GENERIC_PINCONFIG; 54*4882a593Smuzhiyun }; 55*4882a593Smuzhiyun 56*4882a593SmuzhiyunRequired properties: 57*4882a593Smuzhiyun- pinmux: integer array, represents gpio pin number and mux setting. 58*4882a593Smuzhiyun Supported pin number and mux varies for different SoCs, and are defined 59*4882a593Smuzhiyun as macros in boot/dts/<soc>-pinfunc.h directly. 60*4882a593Smuzhiyun 61*4882a593SmuzhiyunOptional properties: 62*4882a593Smuzhiyun- GENERIC_PINCONFIG: is the generic pinconfig options to use, bias-disable, 63*4882a593Smuzhiyun bias-pull-down, bias-pull-up, input-enable, input-disable, output-low, output-high, 64*4882a593Smuzhiyun input-schmitt-enable, input-schmitt-disable and drive-strength are valid. 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun Some special pins have extra pull up strength, there are R0 and R1 pull-up 67*4882a593Smuzhiyun resistors available, but for user, it's only need to set R1R0 as 00, 01, 10 or 11. 68*4882a593Smuzhiyun So when config bias-pull-up, it support arguments for those special pins. 69*4882a593Smuzhiyun Some macros have been defined for this usage, such as MTK_PUPD_SET_R1R0_00. 70*4882a593Smuzhiyun See dt-bindings/pinctrl/mt65xx.h. 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun When config drive-strength, it can support some arguments, such as 73*4882a593Smuzhiyun MTK_DRIVE_4mA, MTK_DRIVE_6mA, etc. See dt-bindings/pinctrl/mt65xx.h. 74*4882a593Smuzhiyun 75*4882a593SmuzhiyunExamples: 76*4882a593Smuzhiyun 77*4882a593Smuzhiyun#include "mt8135-pinfunc.h" 78*4882a593Smuzhiyun 79*4882a593Smuzhiyun... 80*4882a593Smuzhiyun{ 81*4882a593Smuzhiyun syscfg_pctl_a: syscfg-pctl-a@10005000 { 82*4882a593Smuzhiyun compatible = "mediatek,mt8135-pctl-a-syscfg", "syscon"; 83*4882a593Smuzhiyun reg = <0 0x10005000 0 0x1000>; 84*4882a593Smuzhiyun }; 85*4882a593Smuzhiyun 86*4882a593Smuzhiyun syscfg_pctl_b: syscfg-pctl-b@1020c020 { 87*4882a593Smuzhiyun compatible = "mediatek,mt8135-pctl-b-syscfg", "syscon"; 88*4882a593Smuzhiyun reg = <0 0x1020C020 0 0x1000>; 89*4882a593Smuzhiyun }; 90*4882a593Smuzhiyun 91*4882a593Smuzhiyun pinctrl@1c20800 { 92*4882a593Smuzhiyun compatible = "mediatek,mt8135-pinctrl"; 93*4882a593Smuzhiyun reg = <0 0x1000B000 0 0x1000>; 94*4882a593Smuzhiyun mediatek,pctl-regmap = <&syscfg_pctl_a &syscfg_pctl_b>; 95*4882a593Smuzhiyun pins-are-numbered; 96*4882a593Smuzhiyun gpio-controller; 97*4882a593Smuzhiyun #gpio-cells = <2>; 98*4882a593Smuzhiyun interrupt-controller; 99*4882a593Smuzhiyun #interrupt-cells = <2>; 100*4882a593Smuzhiyun interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>, 101*4882a593Smuzhiyun <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>, 102*4882a593Smuzhiyun <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>; 103*4882a593Smuzhiyun 104*4882a593Smuzhiyun i2c0_pins_a: i2c0@0 { 105*4882a593Smuzhiyun pins1 { 106*4882a593Smuzhiyun pinmux = <MT8135_PIN_100_SDA0__FUNC_SDA0>, 107*4882a593Smuzhiyun <MT8135_PIN_101_SCL0__FUNC_SCL0>; 108*4882a593Smuzhiyun bias-disable; 109*4882a593Smuzhiyun }; 110*4882a593Smuzhiyun }; 111*4882a593Smuzhiyun 112*4882a593Smuzhiyun i2c1_pins_a: i2c1@0 { 113*4882a593Smuzhiyun pins { 114*4882a593Smuzhiyun pinmux = <MT8135_PIN_195_SDA1__FUNC_SDA1>, 115*4882a593Smuzhiyun <MT8135_PIN_196_SCL1__FUNC_SCL1>; 116*4882a593Smuzhiyun bias-pull-up = <55>; 117*4882a593Smuzhiyun }; 118*4882a593Smuzhiyun }; 119*4882a593Smuzhiyun 120*4882a593Smuzhiyun i2c2_pins_a: i2c2@0 { 121*4882a593Smuzhiyun pins1 { 122*4882a593Smuzhiyun pinmux = <MT8135_PIN_193_SDA2__FUNC_SDA2>; 123*4882a593Smuzhiyun bias-pull-down; 124*4882a593Smuzhiyun }; 125*4882a593Smuzhiyun 126*4882a593Smuzhiyun pins2 { 127*4882a593Smuzhiyun pinmux = <MT8135_PIN_49_WATCHDOG__FUNC_GPIO49>; 128*4882a593Smuzhiyun bias-pull-up; 129*4882a593Smuzhiyun }; 130*4882a593Smuzhiyun }; 131*4882a593Smuzhiyun 132*4882a593Smuzhiyun i2c3_pins_a: i2c3@0 { 133*4882a593Smuzhiyun pins1 { 134*4882a593Smuzhiyun pinmux = <MT8135_PIN_40_DAC_CLK__FUNC_GPIO40>, 135*4882a593Smuzhiyun <MT8135_PIN_41_DAC_WS__FUNC_GPIO41>; 136*4882a593Smuzhiyun bias-pull-up = <55>; 137*4882a593Smuzhiyun }; 138*4882a593Smuzhiyun 139*4882a593Smuzhiyun pins2 { 140*4882a593Smuzhiyun pinmux = <MT8135_PIN_35_SCL3__FUNC_SCL3>, 141*4882a593Smuzhiyun <MT8135_PIN_36_SDA3__FUNC_SDA3>; 142*4882a593Smuzhiyun output-low; 143*4882a593Smuzhiyun bias-pull-up = <55>; 144*4882a593Smuzhiyun }; 145*4882a593Smuzhiyun 146*4882a593Smuzhiyun pins3 { 147*4882a593Smuzhiyun pinmux = <MT8135_PIN_57_JTCK__FUNC_GPIO57>, 148*4882a593Smuzhiyun <MT8135_PIN_60_JTDI__FUNC_JTDI>; 149*4882a593Smuzhiyun drive-strength = <32>; 150*4882a593Smuzhiyun }; 151*4882a593Smuzhiyun }; 152*4882a593Smuzhiyun 153*4882a593Smuzhiyun ... 154*4882a593Smuzhiyun } 155*4882a593Smuzhiyun}; 156