pinctrl-single.txt 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. - pinctrl-single,bit-per-mux : boolean to indicate that one register controls
  13. more than one pin
  14. This driver assumes that there is only one register for each pin (unless the
  15. pinctrl-single,bit-per-mux is set), and uses the common pinctrl bindings as
  16. specified in the pinctrl-bindings.txt document in this directory.
  17. The pin configuration nodes for pinctrl-single are specified as pinctrl
  18. register offset and value pairs using pinctrl-single,pins. Only the bits
  19. specified in pinctrl-single,function-mask are updated. For example, setting
  20. a pin for a device could be done with:
  21. pinctrl-single,pins = <0xdc 0x118>;
  22. Where 0xdc is the offset from the pinctrl register base address for the
  23. device pinctrl register, and 0x118 contains the desired value of the
  24. pinctrl register. See the device example and static board pins example
  25. below for more information.
  26. In case when one register changes more than one pin's mux the
  27. pinctrl-single,bits need to be used which takes three parameters:
  28. pinctrl-single,bits = <0xdc 0x18, 0xff>;
  29. Where 0xdc is the offset from the pinctrl register base address for the
  30. device pinctrl register, 0x18 is the desired value, and 0xff is the sub mask to
  31. be used when applying this change to the register.
  32. Example:
  33. /* SoC common file */
  34. /* first controller instance for pins in core domain */
  35. pmx_core: pinmux@4a100040 {
  36. compatible = "pinctrl-single";
  37. reg = <0x4a100040 0x0196>;
  38. #address-cells = <1>;
  39. #size-cells = <0>;
  40. pinctrl-single,register-width = <16>;
  41. pinctrl-single,function-mask = <0xffff>;
  42. };
  43. /* second controller instance for pins in wkup domain */
  44. pmx_wkup: pinmux@4a31e040 {
  45. compatible = "pinctrl-single;
  46. reg = <0x4a31e040 0x0038>;
  47. #address-cells = <1>;
  48. #size-cells = <0>;
  49. pinctrl-single,register-width = <16>;
  50. pinctrl-single,function-mask = <0xffff>;
  51. };
  52. control_devconf0: pinmux@48002274 {
  53. compatible = "pinctrl-single";
  54. reg = <0x48002274 4>; /* Single register */
  55. #address-cells = <1>;
  56. #size-cells = <0>;
  57. pinctrl-single,bit-per-mux;
  58. pinctrl-single,register-width = <32>;
  59. pinctrl-single,function-mask = <0x5F>;
  60. };
  61. /* board specific .dts file */
  62. &pmx_core {
  63. /*
  64. * map all board specific static pins enabled by the pinctrl driver
  65. * itself during the boot (or just set them up in the bootloader)
  66. */
  67. pinctrl-names = "default";
  68. pinctrl-0 = <&board_pins>;
  69. board_pins: pinmux_board_pins {
  70. pinctrl-single,pins = <
  71. 0x6c 0xf
  72. 0x6e 0xf
  73. 0x70 0xf
  74. 0x72 0xf
  75. >;
  76. };
  77. /* map uart2 pins */
  78. uart2_pins: pinmux_uart2_pins {
  79. pinctrl-single,pins = <
  80. 0xd8 0x118
  81. 0xda 0
  82. 0xdc 0x118
  83. 0xde 0
  84. >;
  85. };
  86. };
  87. &control_devconf0 {
  88. mcbsp1_pins: pinmux_mcbsp1_pins {
  89. pinctrl-single,bits = <
  90. 0x00 0x18 0x18 /* FSR/CLKR signal from FSX/CLKX pin */
  91. >;
  92. };
  93. mcbsp2_clks_pins: pinmux_mcbsp2_clks_pins {
  94. pinctrl-single,bits = <
  95. 0x00 0x40 0x40 /* McBSP2 CLKS from McBSP_CLKS pin */
  96. >;
  97. };
  98. };
  99. &uart2 {
  100. pinctrl-names = "default";
  101. pinctrl-0 = <&uart2_pins>;
  102. };