1*4882a593Smuzhiyun* Rockchip Pinmux Controller 2*4882a593Smuzhiyun 3*4882a593SmuzhiyunThe Rockchip Pinmux Controller, enables the IC 4*4882a593Smuzhiyunto share one PAD to several functional blocks. The sharing is done by 5*4882a593Smuzhiyunmultiplexing the PAD input/output signals. For each PAD there are several 6*4882a593Smuzhiyunmuxing options with option 0 being the use as a GPIO. 7*4882a593Smuzhiyun 8*4882a593SmuzhiyunPlease refer to pinctrl-bindings.txt in this directory for details of the 9*4882a593Smuzhiyuncommon pinctrl bindings used by client devices, including the meaning of the 10*4882a593Smuzhiyunphrase "pin configuration node". 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunThe Rockchip pin configuration node is a node of a group of pins which can be 13*4882a593Smuzhiyunused for a specific device or function. This node represents both mux and 14*4882a593Smuzhiyunconfig of the pins in that group. The 'pins' selects the function mode(also 15*4882a593Smuzhiyunnamed pin mode) this pin can work on and the 'config' configures various pad 16*4882a593Smuzhiyunsettings such as pull-up, etc. 17*4882a593Smuzhiyun 18*4882a593SmuzhiyunThe pins are grouped into up to 5 individual pin banks which need to be 19*4882a593Smuzhiyundefined as gpio sub-nodes of the pinmux controller. 20*4882a593Smuzhiyun 21*4882a593SmuzhiyunRequired properties for iomux controller: 22*4882a593Smuzhiyun - compatible: should be 23*4882a593Smuzhiyun "rockchip,px30-pinctrl": for Rockchip PX30 24*4882a593Smuzhiyun "rockchip,rv1108-pinctrl": for Rockchip RV1108 25*4882a593Smuzhiyun "rockchip,rk2928-pinctrl": for Rockchip RK2928 26*4882a593Smuzhiyun "rockchip,rk3066a-pinctrl": for Rockchip RK3066a 27*4882a593Smuzhiyun "rockchip,rk3066b-pinctrl": for Rockchip RK3066b 28*4882a593Smuzhiyun "rockchip,rk3128-pinctrl": for Rockchip RK3128 29*4882a593Smuzhiyun "rockchip,rk3188-pinctrl": for Rockchip RK3188 30*4882a593Smuzhiyun "rockchip,rk3228-pinctrl": for Rockchip RK3228 31*4882a593Smuzhiyun "rockchip,rk3288-pinctrl": for Rockchip RK3288 32*4882a593Smuzhiyun "rockchip,rk3308-pinctrl": for Rockchip RK3308 33*4882a593Smuzhiyun "rockchip,rk3328-pinctrl": for Rockchip RK3328 34*4882a593Smuzhiyun "rockchip,rk3368-pinctrl": for Rockchip RK3368 35*4882a593Smuzhiyun "rockchip,rk3399-pinctrl": for Rockchip RK3399 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun - rockchip,grf: phandle referencing a syscon providing the 38*4882a593Smuzhiyun "general register files" 39*4882a593Smuzhiyun 40*4882a593SmuzhiyunOptional properties for iomux controller: 41*4882a593Smuzhiyun - rockchip,pmu: phandle referencing a syscon providing the pmu registers 42*4882a593Smuzhiyun as some SoCs carry parts of the iomux controller registers there. 43*4882a593Smuzhiyun Required for at least rk3188 and rk3288. On the rk3368 this should 44*4882a593Smuzhiyun point to the PMUGRF syscon. 45*4882a593Smuzhiyun 46*4882a593SmuzhiyunDeprecated properties for iomux controller: 47*4882a593Smuzhiyun - reg: first element is the general register space of the iomux controller 48*4882a593Smuzhiyun It should be large enough to contain also separate pull registers. 49*4882a593Smuzhiyun second element is the separate pull register space of the rk3188. 50*4882a593Smuzhiyun Use rockchip,grf and rockchip,pmu described above instead. 51*4882a593Smuzhiyun 52*4882a593SmuzhiyunRequired properties for gpio sub nodes: 53*4882a593Smuzhiyun - compatible: "rockchip,gpio-bank" 54*4882a593Smuzhiyun - reg: register of the gpio bank (different than the iomux registerset) 55*4882a593Smuzhiyun - interrupts: base interrupt of the gpio bank in the interrupt controller 56*4882a593Smuzhiyun - clocks: clock that drives this bank 57*4882a593Smuzhiyun - gpio-controller: identifies the node as a gpio controller and pin bank. 58*4882a593Smuzhiyun - #gpio-cells: number of cells in GPIO specifier. Since the generic GPIO 59*4882a593Smuzhiyun binding is used, the amount of cells must be specified as 2. See generic 60*4882a593Smuzhiyun GPIO binding documentation for description of particular cells. 61*4882a593Smuzhiyun - interrupt-controller: identifies the controller node as interrupt-parent. 62*4882a593Smuzhiyun - #interrupt-cells: the value of this property should be 2 and the interrupt 63*4882a593Smuzhiyun cells should use the standard two-cell scheme described in 64*4882a593Smuzhiyun bindings/interrupt-controller/interrupts.txt 65*4882a593Smuzhiyun 66*4882a593SmuzhiyunDeprecated properties for gpio sub nodes: 67*4882a593Smuzhiyun - compatible: "rockchip,rk3188-gpio-bank0" 68*4882a593Smuzhiyun - reg: second element: separate pull register for rk3188 bank0, use 69*4882a593Smuzhiyun rockchip,pmu described above instead 70*4882a593Smuzhiyun 71*4882a593SmuzhiyunRequired properties for pin configuration node: 72*4882a593Smuzhiyun - rockchip,pins: 3 integers array, represents a group of pins mux and config 73*4882a593Smuzhiyun setting. The format is rockchip,pins = <PIN_BANK PIN_BANK_IDX MUX &phandle>. 74*4882a593Smuzhiyun The MUX 0 means gpio and MUX 1 to N mean the specific device function. 75*4882a593Smuzhiyun The phandle of a node containing the generic pinconfig options 76*4882a593Smuzhiyun to use, as described in pinctrl-bindings.txt in this directory. 77*4882a593Smuzhiyun 78*4882a593SmuzhiyunExamples: 79*4882a593Smuzhiyun 80*4882a593Smuzhiyun#include <dt-bindings/pinctrl/rockchip.h> 81*4882a593Smuzhiyun 82*4882a593Smuzhiyun... 83*4882a593Smuzhiyun 84*4882a593Smuzhiyunpinctrl@20008000 { 85*4882a593Smuzhiyun compatible = "rockchip,rk3066a-pinctrl"; 86*4882a593Smuzhiyun rockchip,grf = <&grf>; 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun #address-cells = <1>; 89*4882a593Smuzhiyun #size-cells = <1>; 90*4882a593Smuzhiyun ranges; 91*4882a593Smuzhiyun 92*4882a593Smuzhiyun gpio0: gpio0@20034000 { 93*4882a593Smuzhiyun compatible = "rockchip,gpio-bank"; 94*4882a593Smuzhiyun reg = <0x20034000 0x100>; 95*4882a593Smuzhiyun interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; 96*4882a593Smuzhiyun clocks = <&clk_gates8 9>; 97*4882a593Smuzhiyun 98*4882a593Smuzhiyun gpio-controller; 99*4882a593Smuzhiyun #gpio-cells = <2>; 100*4882a593Smuzhiyun 101*4882a593Smuzhiyun interrupt-controller; 102*4882a593Smuzhiyun #interrupt-cells = <2>; 103*4882a593Smuzhiyun }; 104*4882a593Smuzhiyun 105*4882a593Smuzhiyun ... 106*4882a593Smuzhiyun 107*4882a593Smuzhiyun pcfg_pull_default: pcfg_pull_default { 108*4882a593Smuzhiyun bias-pull-pin-default 109*4882a593Smuzhiyun }; 110*4882a593Smuzhiyun 111*4882a593Smuzhiyun uart2 { 112*4882a593Smuzhiyun uart2_xfer: uart2-xfer { 113*4882a593Smuzhiyun rockchip,pins = <1 RK_PB0 1 &pcfg_pull_default>, 114*4882a593Smuzhiyun <1 RK_PB1 1 &pcfg_pull_default>; 115*4882a593Smuzhiyun }; 116*4882a593Smuzhiyun }; 117*4882a593Smuzhiyun}; 118*4882a593Smuzhiyun 119*4882a593Smuzhiyunuart2: serial@20064000 { 120*4882a593Smuzhiyun compatible = "snps,dw-apb-uart"; 121*4882a593Smuzhiyun reg = <0x20064000 0x400>; 122*4882a593Smuzhiyun interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; 123*4882a593Smuzhiyun reg-shift = <2>; 124*4882a593Smuzhiyun reg-io-width = <1>; 125*4882a593Smuzhiyun clocks = <&mux_uart2>; 126*4882a593Smuzhiyun 127*4882a593Smuzhiyun pinctrl-names = "default"; 128*4882a593Smuzhiyun pinctrl-0 = <&uart2_xfer>; 129*4882a593Smuzhiyun}; 130*4882a593Smuzhiyun 131*4882a593SmuzhiyunExample for rk3188: 132*4882a593Smuzhiyun 133*4882a593Smuzhiyun pinctrl@20008000 { 134*4882a593Smuzhiyun compatible = "rockchip,rk3188-pinctrl"; 135*4882a593Smuzhiyun rockchip,grf = <&grf>; 136*4882a593Smuzhiyun rockchip,pmu = <&pmu>; 137*4882a593Smuzhiyun #address-cells = <1>; 138*4882a593Smuzhiyun #size-cells = <1>; 139*4882a593Smuzhiyun ranges; 140*4882a593Smuzhiyun 141*4882a593Smuzhiyun gpio0: gpio0@2000a000 { 142*4882a593Smuzhiyun compatible = "rockchip,rk3188-gpio-bank0"; 143*4882a593Smuzhiyun reg = <0x2000a000 0x100>; 144*4882a593Smuzhiyun interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; 145*4882a593Smuzhiyun clocks = <&clk_gates8 9>; 146*4882a593Smuzhiyun 147*4882a593Smuzhiyun gpio-controller; 148*4882a593Smuzhiyun #gpio-cells = <2>; 149*4882a593Smuzhiyun 150*4882a593Smuzhiyun interrupt-controller; 151*4882a593Smuzhiyun #interrupt-cells = <2>; 152*4882a593Smuzhiyun }; 153*4882a593Smuzhiyun 154*4882a593Smuzhiyun gpio1: gpio1@2003c000 { 155*4882a593Smuzhiyun compatible = "rockchip,gpio-bank"; 156*4882a593Smuzhiyun reg = <0x2003c000 0x100>; 157*4882a593Smuzhiyun interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>; 158*4882a593Smuzhiyun clocks = <&clk_gates8 10>; 159*4882a593Smuzhiyun 160*4882a593Smuzhiyun gpio-controller; 161*4882a593Smuzhiyun #gpio-cells = <2>; 162*4882a593Smuzhiyun 163*4882a593Smuzhiyun interrupt-controller; 164*4882a593Smuzhiyun #interrupt-cells = <2>; 165*4882a593Smuzhiyun }; 166*4882a593Smuzhiyun 167*4882a593Smuzhiyun ... 168*4882a593Smuzhiyun 169*4882a593Smuzhiyun }; 170