rockchip,pinctrl.txt 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. Required properties for gpio sub nodes:
  20. - compatible: "rockchip,gpio-bank"
  21. - reg: register of the gpio bank (different than the iomux registerset)
  22. - interrupts: base interrupt of the gpio bank in the interrupt controller
  23. - clocks: clock that drives this bank
  24. - gpio-controller: identifies the node as a gpio controller and pin bank.
  25. - #gpio-cells: number of cells in GPIO specifier. Since the generic GPIO
  26. binding is used, the amount of cells must be specified as 2. See generic
  27. GPIO binding documentation for description of particular cells.
  28. - interrupt-controller: identifies the controller node as interrupt-parent.
  29. - #interrupt-cells: the value of this property should be 2 and the interrupt
  30. cells should use the standard two-cell scheme described in
  31. bindings/interrupt-controller/interrupts.txt
  32. Required properties for pin configuration node:
  33. - rockchip,pins: 3 integers array, represents a group of pins mux and config
  34. setting. The format is rockchip,pins = <PIN_BANK PIN_BANK_IDX MUX &phandle>.
  35. The MUX 0 means gpio and MUX 1 to 3 mean the specific device function.
  36. The phandle of a node containing the generic pinconfig options
  37. to use, as described in pinctrl-bindings.txt in this directory.
  38. Examples:
  39. #include <dt-bindings/pinctrl/rockchip.h>
  40. ...
  41. pinctrl@20008000 {
  42. compatible = "rockchip,rk3066a-pinctrl";
  43. reg = <0x20008000 0x150>;
  44. #address-cells = <1>;
  45. #size-cells = <1>;
  46. ranges;
  47. gpio0: gpio0@20034000 {
  48. compatible = "rockchip,gpio-bank";
  49. reg = <0x20034000 0x100>;
  50. interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
  51. clocks = <&clk_gates8 9>;
  52. gpio-controller;
  53. #gpio-cells = <2>;
  54. interrupt-controller;
  55. #interrupt-cells = <2>;
  56. };
  57. ...
  58. pcfg_pull_default: pcfg_pull_default {
  59. bias-pull-pin-default
  60. };
  61. uart2 {
  62. uart2_xfer: uart2-xfer {
  63. rockchip,pins = <RK_GPIO1 8 1 &pcfg_pull_default>,
  64. <RK_GPIO1 9 1 &pcfg_pull_default>;
  65. };
  66. };
  67. };
  68. uart2: serial@20064000 {
  69. compatible = "snps,dw-apb-uart";
  70. reg = <0x20064000 0x400>;
  71. interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
  72. reg-shift = <2>;
  73. reg-io-width = <1>;
  74. clocks = <&mux_uart2>;
  75. status = "okay";
  76. pinctrl-names = "default";
  77. pinctrl-0 = <&uart2_xfer>;
  78. };