rockchip,pinctrl.txt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. * Rockchip Pinmux Controller
  2. The Rockchip Pinmux Controller, enables the IC
  3. to share one PAD to several functional blocks. The sharing is done by
  4. multiplexing the PAD input/output signals. For each PAD there are up to
  5. 4 muxing options with option 0 being the use as a GPIO.
  6. Please refer to pinctrl-bindings.txt in this directory for details of the
  7. common pinctrl bindings used by client devices, including the meaning of the
  8. phrase "pin configuration node".
  9. The Rockchip pin configuration node is a node of a group of pins which can be
  10. used for a specific device or function. This node represents both mux and
  11. config of the pins in that group. The 'pins' selects the function mode(also
  12. named pin mode) this pin can work on and the 'config' configures various pad
  13. settings such as pull-up, etc.
  14. The pins are grouped into up to 5 individual pin banks which need to be
  15. defined as gpio sub-nodes of the pinmux controller.
  16. Required properties for iomux controller:
  17. - compatible: one of "rockchip,rk2928-pinctrl", "rockchip,rk3066a-pinctrl"
  18. "rockchip,rk3066b-pinctrl", "rockchip,rk3188-pinctrl"
  19. - reg: first element is the general register space of the iomux controller
  20. second element is the separate pull register space of the rk3188
  21. Required properties for gpio sub nodes:
  22. - compatible: "rockchip,gpio-bank", "rockchip,rk3188-gpio-bank0"
  23. - reg: register of the gpio bank (different than the iomux registerset)
  24. second element: separate pull register for rk3188 bank0
  25. - interrupts: base interrupt of the gpio bank in the interrupt controller
  26. - clocks: clock that drives this bank
  27. - gpio-controller: identifies the node as a gpio controller and pin bank.
  28. - #gpio-cells: number of cells in GPIO specifier. Since the generic GPIO
  29. binding is used, the amount of cells must be specified as 2. See generic
  30. GPIO binding documentation for description of particular cells.
  31. - interrupt-controller: identifies the controller node as interrupt-parent.
  32. - #interrupt-cells: the value of this property should be 2 and the interrupt
  33. cells should use the standard two-cell scheme described in
  34. bindings/interrupt-controller/interrupts.txt
  35. Required properties for pin configuration node:
  36. - rockchip,pins: 3 integers array, represents a group of pins mux and config
  37. setting. The format is rockchip,pins = <PIN_BANK PIN_BANK_IDX MUX &phandle>.
  38. The MUX 0 means gpio and MUX 1 to 3 mean the specific device function.
  39. The phandle of a node containing the generic pinconfig options
  40. to use, as described in pinctrl-bindings.txt in this directory.
  41. Examples:
  42. #include <dt-bindings/pinctrl/rockchip.h>
  43. ...
  44. pinctrl@20008000 {
  45. compatible = "rockchip,rk3066a-pinctrl";
  46. reg = <0x20008000 0x150>;
  47. #address-cells = <1>;
  48. #size-cells = <1>;
  49. ranges;
  50. gpio0: gpio0@20034000 {
  51. compatible = "rockchip,gpio-bank";
  52. reg = <0x20034000 0x100>;
  53. interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
  54. clocks = <&clk_gates8 9>;
  55. gpio-controller;
  56. #gpio-cells = <2>;
  57. interrupt-controller;
  58. #interrupt-cells = <2>;
  59. };
  60. ...
  61. pcfg_pull_default: pcfg_pull_default {
  62. bias-pull-pin-default
  63. };
  64. uart2 {
  65. uart2_xfer: uart2-xfer {
  66. rockchip,pins = <RK_GPIO1 8 1 &pcfg_pull_default>,
  67. <RK_GPIO1 9 1 &pcfg_pull_default>;
  68. };
  69. };
  70. };
  71. uart2: serial@20064000 {
  72. compatible = "snps,dw-apb-uart";
  73. reg = <0x20064000 0x400>;
  74. interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
  75. reg-shift = <2>;
  76. reg-io-width = <1>;
  77. clocks = <&mux_uart2>;
  78. status = "okay";
  79. pinctrl-names = "default";
  80. pinctrl-0 = <&uart2_xfer>;
  81. };
  82. Example for rk3188:
  83. pinctrl@20008000 {
  84. compatible = "rockchip,rk3188-pinctrl";
  85. reg = <0x20008000 0xa0>,
  86. <0x20008164 0x1a0>;
  87. #address-cells = <1>;
  88. #size-cells = <1>;
  89. ranges;
  90. gpio0: gpio0@0x2000a000 {
  91. compatible = "rockchip,rk3188-gpio-bank0";
  92. reg = <0x2000a000 0x100>,
  93. <0x20004064 0x8>;
  94. interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
  95. clocks = <&clk_gates8 9>;
  96. gpio-controller;
  97. #gpio-cells = <2>;
  98. interrupt-controller;
  99. #interrupt-cells = <2>;
  100. };
  101. gpio1: gpio1@0x2003c000 {
  102. compatible = "rockchip,gpio-bank";
  103. reg = <0x2003c000 0x100>;
  104. interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
  105. clocks = <&clk_gates8 10>;
  106. gpio-controller;
  107. #gpio-cells = <2>;
  108. interrupt-controller;
  109. #interrupt-cells = <2>;
  110. };
  111. ...
  112. };