1c66ec88fSEmmanuel Vadot* Rockchip Pinmux Controller 2c66ec88fSEmmanuel Vadot 3c66ec88fSEmmanuel VadotThe Rockchip Pinmux Controller, enables the IC 4c66ec88fSEmmanuel Vadotto share one PAD to several functional blocks. The sharing is done by 5c66ec88fSEmmanuel Vadotmultiplexing the PAD input/output signals. For each PAD there are several 6c66ec88fSEmmanuel Vadotmuxing options with option 0 being the use as a GPIO. 7c66ec88fSEmmanuel Vadot 8c66ec88fSEmmanuel VadotPlease refer to pinctrl-bindings.txt in this directory for details of the 9c66ec88fSEmmanuel Vadotcommon pinctrl bindings used by client devices, including the meaning of the 10c66ec88fSEmmanuel Vadotphrase "pin configuration node". 11c66ec88fSEmmanuel Vadot 12c66ec88fSEmmanuel VadotThe Rockchip pin configuration node is a node of a group of pins which can be 13c66ec88fSEmmanuel Vadotused for a specific device or function. This node represents both mux and 14c66ec88fSEmmanuel Vadotconfig of the pins in that group. The 'pins' selects the function mode(also 15c66ec88fSEmmanuel Vadotnamed pin mode) this pin can work on and the 'config' configures various pad 16c66ec88fSEmmanuel Vadotsettings such as pull-up, etc. 17c66ec88fSEmmanuel Vadot 18c66ec88fSEmmanuel VadotThe pins are grouped into up to 5 individual pin banks which need to be 19c66ec88fSEmmanuel Vadotdefined as gpio sub-nodes of the pinmux controller. 20c66ec88fSEmmanuel Vadot 21c66ec88fSEmmanuel VadotRequired properties for iomux controller: 22c66ec88fSEmmanuel Vadot - compatible: should be 23c66ec88fSEmmanuel Vadot "rockchip,px30-pinctrl": for Rockchip PX30 24c66ec88fSEmmanuel Vadot "rockchip,rv1108-pinctrl": for Rockchip RV1108 25c66ec88fSEmmanuel Vadot "rockchip,rk2928-pinctrl": for Rockchip RK2928 26c66ec88fSEmmanuel Vadot "rockchip,rk3066a-pinctrl": for Rockchip RK3066a 27c66ec88fSEmmanuel Vadot "rockchip,rk3066b-pinctrl": for Rockchip RK3066b 28c66ec88fSEmmanuel Vadot "rockchip,rk3128-pinctrl": for Rockchip RK3128 29c66ec88fSEmmanuel Vadot "rockchip,rk3188-pinctrl": for Rockchip RK3188 30c66ec88fSEmmanuel Vadot "rockchip,rk3228-pinctrl": for Rockchip RK3228 31c66ec88fSEmmanuel Vadot "rockchip,rk3288-pinctrl": for Rockchip RK3288 32c66ec88fSEmmanuel Vadot "rockchip,rk3308-pinctrl": for Rockchip RK3308 33c66ec88fSEmmanuel Vadot "rockchip,rk3328-pinctrl": for Rockchip RK3328 34c66ec88fSEmmanuel Vadot "rockchip,rk3368-pinctrl": for Rockchip RK3368 35c66ec88fSEmmanuel Vadot "rockchip,rk3399-pinctrl": for Rockchip RK3399 36*2eb4d8dcSEmmanuel Vadot "rockchip,rk3568-pinctrl": for Rockchip RK3568 37c66ec88fSEmmanuel Vadot 38c66ec88fSEmmanuel Vadot - rockchip,grf: phandle referencing a syscon providing the 39c66ec88fSEmmanuel Vadot "general register files" 40c66ec88fSEmmanuel Vadot 41c66ec88fSEmmanuel VadotOptional properties for iomux controller: 42c66ec88fSEmmanuel Vadot - rockchip,pmu: phandle referencing a syscon providing the pmu registers 43c66ec88fSEmmanuel Vadot as some SoCs carry parts of the iomux controller registers there. 44c66ec88fSEmmanuel Vadot Required for at least rk3188 and rk3288. On the rk3368 this should 45c66ec88fSEmmanuel Vadot point to the PMUGRF syscon. 46c66ec88fSEmmanuel Vadot 47c66ec88fSEmmanuel VadotDeprecated properties for iomux controller: 48c66ec88fSEmmanuel Vadot - reg: first element is the general register space of the iomux controller 49c66ec88fSEmmanuel Vadot It should be large enough to contain also separate pull registers. 50c66ec88fSEmmanuel Vadot second element is the separate pull register space of the rk3188. 51c66ec88fSEmmanuel Vadot Use rockchip,grf and rockchip,pmu described above instead. 52c66ec88fSEmmanuel Vadot 53c66ec88fSEmmanuel VadotRequired properties for gpio sub nodes: 54*2eb4d8dcSEmmanuel VadotSee rockchip,gpio-bank.yaml 55c66ec88fSEmmanuel Vadot 56c66ec88fSEmmanuel VadotRequired properties for pin configuration node: 57c66ec88fSEmmanuel Vadot - rockchip,pins: 3 integers array, represents a group of pins mux and config 58c66ec88fSEmmanuel Vadot setting. The format is rockchip,pins = <PIN_BANK PIN_BANK_IDX MUX &phandle>. 59c66ec88fSEmmanuel Vadot The MUX 0 means gpio and MUX 1 to N mean the specific device function. 60c66ec88fSEmmanuel Vadot The phandle of a node containing the generic pinconfig options 61c66ec88fSEmmanuel Vadot to use, as described in pinctrl-bindings.txt in this directory. 62c66ec88fSEmmanuel Vadot 63c66ec88fSEmmanuel VadotExamples: 64c66ec88fSEmmanuel Vadot 65c66ec88fSEmmanuel Vadot#include <dt-bindings/pinctrl/rockchip.h> 66c66ec88fSEmmanuel Vadot 67c66ec88fSEmmanuel Vadot... 68c66ec88fSEmmanuel Vadot 69c66ec88fSEmmanuel Vadotpinctrl@20008000 { 70c66ec88fSEmmanuel Vadot compatible = "rockchip,rk3066a-pinctrl"; 71c66ec88fSEmmanuel Vadot rockchip,grf = <&grf>; 72c66ec88fSEmmanuel Vadot 73c66ec88fSEmmanuel Vadot #address-cells = <1>; 74c66ec88fSEmmanuel Vadot #size-cells = <1>; 75c66ec88fSEmmanuel Vadot ranges; 76c66ec88fSEmmanuel Vadot 77c66ec88fSEmmanuel Vadot gpio0: gpio0@20034000 { 78c66ec88fSEmmanuel Vadot compatible = "rockchip,gpio-bank"; 79c66ec88fSEmmanuel Vadot reg = <0x20034000 0x100>; 80c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; 81c66ec88fSEmmanuel Vadot clocks = <&clk_gates8 9>; 82c66ec88fSEmmanuel Vadot 83c66ec88fSEmmanuel Vadot gpio-controller; 84c66ec88fSEmmanuel Vadot #gpio-cells = <2>; 85c66ec88fSEmmanuel Vadot 86c66ec88fSEmmanuel Vadot interrupt-controller; 87c66ec88fSEmmanuel Vadot #interrupt-cells = <2>; 88c66ec88fSEmmanuel Vadot }; 89c66ec88fSEmmanuel Vadot 90c66ec88fSEmmanuel Vadot ... 91c66ec88fSEmmanuel Vadot 92c66ec88fSEmmanuel Vadot pcfg_pull_default: pcfg_pull_default { 93c66ec88fSEmmanuel Vadot bias-pull-pin-default 94c66ec88fSEmmanuel Vadot }; 95c66ec88fSEmmanuel Vadot 96c66ec88fSEmmanuel Vadot uart2 { 97c66ec88fSEmmanuel Vadot uart2_xfer: uart2-xfer { 98c66ec88fSEmmanuel Vadot rockchip,pins = <1 RK_PB0 1 &pcfg_pull_default>, 99c66ec88fSEmmanuel Vadot <1 RK_PB1 1 &pcfg_pull_default>; 100c66ec88fSEmmanuel Vadot }; 101c66ec88fSEmmanuel Vadot }; 102c66ec88fSEmmanuel Vadot}; 103c66ec88fSEmmanuel Vadot 104c66ec88fSEmmanuel Vadotuart2: serial@20064000 { 105c66ec88fSEmmanuel Vadot compatible = "snps,dw-apb-uart"; 106c66ec88fSEmmanuel Vadot reg = <0x20064000 0x400>; 107c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; 108c66ec88fSEmmanuel Vadot reg-shift = <2>; 109c66ec88fSEmmanuel Vadot reg-io-width = <1>; 110c66ec88fSEmmanuel Vadot clocks = <&mux_uart2>; 111c66ec88fSEmmanuel Vadot 112c66ec88fSEmmanuel Vadot pinctrl-names = "default"; 113c66ec88fSEmmanuel Vadot pinctrl-0 = <&uart2_xfer>; 114c66ec88fSEmmanuel Vadot}; 115