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