rockchip,pinctrl.txt 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 several
  5. 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. "rockchip,rk3288-pinctrl", "rockchip,rk3368-pinctrl"
  20. - rockchip,grf: phandle referencing a syscon providing the
  21. "general register files"
  22. Optional properties for iomux controller:
  23. - rockchip,pmu: phandle referencing a syscon providing the pmu registers
  24. as some SoCs carry parts of the iomux controller registers there.
  25. Required for at least rk3188 and rk3288. On the rk3368 this should
  26. point to the PMUGRF syscon.
  27. Deprecated properties for iomux controller:
  28. - reg: first element is the general register space of the iomux controller
  29. It should be large enough to contain also separate pull registers.
  30. second element is the separate pull register space of the rk3188.
  31. Use rockchip,grf and rockchip,pmu described above instead.
  32. Required properties for gpio sub nodes:
  33. - compatible: "rockchip,gpio-bank"
  34. - reg: register of the gpio bank (different than the iomux registerset)
  35. - interrupts: base interrupt of the gpio bank in the interrupt controller
  36. - clocks: clock that drives this bank
  37. - gpio-controller: identifies the node as a gpio controller and pin bank.
  38. - #gpio-cells: number of cells in GPIO specifier. Since the generic GPIO
  39. binding is used, the amount of cells must be specified as 2. See generic
  40. GPIO binding documentation for description of particular cells.
  41. - interrupt-controller: identifies the controller node as interrupt-parent.
  42. - #interrupt-cells: the value of this property should be 2 and the interrupt
  43. cells should use the standard two-cell scheme described in
  44. bindings/interrupt-controller/interrupts.txt
  45. Deprecated properties for gpio sub nodes:
  46. - compatible: "rockchip,rk3188-gpio-bank0"
  47. - reg: second element: separate pull register for rk3188 bank0, use
  48. rockchip,pmu described above instead
  49. Required properties for pin configuration node:
  50. - rockchip,pins: 3 integers array, represents a group of pins mux and config
  51. setting. The format is rockchip,pins = <PIN_BANK PIN_BANK_IDX MUX &phandle>.
  52. The MUX 0 means gpio and MUX 1 to N mean the specific device function.
  53. The phandle of a node containing the generic pinconfig options
  54. to use, as described in pinctrl-bindings.txt in this directory.
  55. Examples:
  56. #include <dt-bindings/pinctrl/rockchip.h>
  57. ...
  58. pinctrl@20008000 {
  59. compatible = "rockchip,rk3066a-pinctrl";
  60. rockchip,grf = <&grf>;
  61. #address-cells = <1>;
  62. #size-cells = <1>;
  63. ranges;
  64. gpio0: gpio0@20034000 {
  65. compatible = "rockchip,gpio-bank";
  66. reg = <0x20034000 0x100>;
  67. interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
  68. clocks = <&clk_gates8 9>;
  69. gpio-controller;
  70. #gpio-cells = <2>;
  71. interrupt-controller;
  72. #interrupt-cells = <2>;
  73. };
  74. ...
  75. pcfg_pull_default: pcfg_pull_default {
  76. bias-pull-pin-default
  77. };
  78. uart2 {
  79. uart2_xfer: uart2-xfer {
  80. rockchip,pins = <RK_GPIO1 8 1 &pcfg_pull_default>,
  81. <RK_GPIO1 9 1 &pcfg_pull_default>;
  82. };
  83. };
  84. };
  85. uart2: serial@20064000 {
  86. compatible = "snps,dw-apb-uart";
  87. reg = <0x20064000 0x400>;
  88. interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
  89. reg-shift = <2>;
  90. reg-io-width = <1>;
  91. clocks = <&mux_uart2>;
  92. status = "okay";
  93. pinctrl-names = "default";
  94. pinctrl-0 = <&uart2_xfer>;
  95. };
  96. Example for rk3188:
  97. pinctrl@20008000 {
  98. compatible = "rockchip,rk3188-pinctrl";
  99. rockchip,grf = <&grf>;
  100. rockchip,pmu = <&pmu>;
  101. #address-cells = <1>;
  102. #size-cells = <1>;
  103. ranges;
  104. gpio0: gpio0@0x2000a000 {
  105. compatible = "rockchip,rk3188-gpio-bank0";
  106. reg = <0x2000a000 0x100>;
  107. interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
  108. clocks = <&clk_gates8 9>;
  109. gpio-controller;
  110. #gpio-cells = <2>;
  111. interrupt-controller;
  112. #interrupt-cells = <2>;
  113. };
  114. gpio1: gpio1@0x2003c000 {
  115. compatible = "rockchip,gpio-bank";
  116. reg = <0x2003c000 0x100>;
  117. interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
  118. clocks = <&clk_gates8 10>;
  119. gpio-controller;
  120. #gpio-cells = <2>;
  121. interrupt-controller;
  122. #interrupt-cells = <2>;
  123. };
  124. ...
  125. };