pinctrl-single.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. One-register-per-pin type device tree based pinctrl driver
  2. Required properties:
  3. - compatible : "pinctrl-single"
  4. - reg : offset and length of the register set for the mux registers
  5. - pinctrl-single,register-width : pinmux register access width in bits
  6. - pinctrl-single,function-mask : mask of allowed pinmux function bits
  7. in the pinmux register
  8. Optional properties:
  9. - pinctrl-single,function-off : function off mode for disabled state if
  10. available and same for all registers; if not specified, disabling of
  11. pin functions is ignored
  12. This driver assumes that there is only one register for each pin,
  13. and uses the common pinctrl bindings as specified in the pinctrl-bindings.txt
  14. document in this directory.
  15. The pin configuration nodes for pinctrl-single are specified as pinctrl
  16. register offset and value pairs using pinctrl-single,pins. Only the bits
  17. specified in pinctrl-single,function-mask are updated. For example, setting
  18. a pin for a device could be done with:
  19. pinctrl-single,pins = <0xdc 0x118>;
  20. Where 0xdc is the offset from the pinctrl register base address for the
  21. device pinctrl register, and 0x118 contains the desired value of the
  22. pinctrl register. See the device example and static board pins example
  23. below for more information.
  24. Example:
  25. /* SoC common file */
  26. /* first controller instance for pins in core domain */
  27. pmx_core: pinmux@4a100040 {
  28. compatible = "pinctrl-single";
  29. reg = <0x4a100040 0x0196>;
  30. #address-cells = <1>;
  31. #size-cells = <0>;
  32. pinctrl-single,register-width = <16>;
  33. pinctrl-single,function-mask = <0xffff>;
  34. };
  35. /* second controller instance for pins in wkup domain */
  36. pmx_wkup: pinmux@4a31e040 {
  37. compatible = "pinctrl-single;
  38. reg = <0x4a31e040 0x0038>;
  39. #address-cells = <1>;
  40. #size-cells = <0>;
  41. pinctrl-single,register-width = <16>;
  42. pinctrl-single,function-mask = <0xffff>;
  43. };
  44. /* board specific .dts file */
  45. &pmx_core {
  46. /*
  47. * map all board specific static pins enabled by the pinctrl driver
  48. * itself during the boot (or just set them up in the bootloader)
  49. */
  50. pinctrl-names = "default";
  51. pinctrl-0 = <&board_pins>;
  52. board_pins: pinmux_board_pins {
  53. pinctrl-single,pins = <
  54. 0x6c 0xf
  55. 0x6e 0xf
  56. 0x70 0xf
  57. 0x72 0xf
  58. >;
  59. };
  60. /* map uart2 pins */
  61. uart2_pins: pinmux_uart2_pins {
  62. pinctrl-single,pins = <
  63. 0xd8 0x118
  64. 0xda 0
  65. 0xdc 0x118
  66. 0xde 0
  67. >;
  68. };
  69. };
  70. &uart2 {
  71. pinctrl-names = "default";
  72. pinctrl-0 = <&uart2_pins>;
  73. };