atmel,at91-pinctrl.txt 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. * Atmel AT91 Pinmux Controller
  2. The AT91 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. 8 muxing options (called periph modes). Since different modules require
  6. different PAD settings (like pull up, keeper, etc) the contoller controls
  7. also the PAD settings parameters.
  8. Please refer to pinctrl-bindings.txt in this directory for details of the
  9. common pinctrl bindings used by client devices, including the meaning of the
  10. phrase "pin configuration node".
  11. Atmel AT91 pin configuration node is a node of a group of pins which can be
  12. used for a specific device or function. This node represents both mux and config
  13. of the pins in that group. The 'pins' selects the function mode(also named pin
  14. mode) this pin can work on and the 'config' configures various pad settings
  15. such as pull-up, multi drive, etc.
  16. Required properties for iomux controller:
  17. - compatible: "atmel,at91rm9200-pinctrl" or "atmel,at91sam9x5-pinctrl"
  18. or "atmel,sama5d3-pinctrl"
  19. - atmel,mux-mask: array of mask (periph per bank) to describe if a pin can be
  20. configured in this periph mode. All the periph and bank need to be describe.
  21. How to create such array:
  22. Each column will represent the possible peripheral of the pinctrl
  23. Each line will represent a pio bank
  24. Take an example on the 9260
  25. Peripheral: 2 ( A and B)
  26. Bank: 3 (A, B and C)
  27. =>
  28. /* A B */
  29. 0xffffffff 0xffc00c3b /* pioA */
  30. 0xffffffff 0x7fff3ccf /* pioB */
  31. 0xffffffff 0x007fffff /* pioC */
  32. For each peripheral/bank we will descibe in a u32 if a pin can be
  33. configured in it by putting 1 to the pin bit (1 << pin)
  34. Let's take the pioA on peripheral B
  35. From the datasheet Table 10-2.
  36. Peripheral B
  37. PA0 MCDB0
  38. PA1 MCCDB
  39. PA2
  40. PA3 MCDB3
  41. PA4 MCDB2
  42. PA5 MCDB1
  43. PA6
  44. PA7
  45. PA8
  46. PA9
  47. PA10 ETX2
  48. PA11 ETX3
  49. PA12
  50. PA13
  51. PA14
  52. PA15
  53. PA16
  54. PA17
  55. PA18
  56. PA19
  57. PA20
  58. PA21
  59. PA22 ETXER
  60. PA23 ETX2
  61. PA24 ETX3
  62. PA25 ERX2
  63. PA26 ERX3
  64. PA27 ERXCK
  65. PA28 ECRS
  66. PA29 ECOL
  67. PA30 RXD4
  68. PA31 TXD4
  69. => 0xffc00c3b
  70. Required properties for pin configuration node:
  71. - atmel,pins: 4 integers array, represents a group of pins mux and config
  72. setting. The format is atmel,pins = <PIN_BANK PIN_BANK_NUM PERIPH CONFIG>.
  73. The PERIPH 0 means gpio, PERIPH 1 is periph A, PERIPH 2 is periph B...
  74. PIN_BANK 0 is pioA, PIN_BANK 1 is pioB...
  75. Bits used for CONFIG:
  76. PULL_UP (1 << 0): indicate this pin needs a pull up.
  77. MULTIDRIVE (1 << 1): indicate this pin needs to be configured as multi-drive.
  78. Multi-drive is equivalent to open-drain type output.
  79. DEGLITCH (1 << 2): indicate this pin needs deglitch.
  80. PULL_DOWN (1 << 3): indicate this pin needs a pull down.
  81. DIS_SCHMIT (1 << 4): indicate this pin needs to the disable schmitt trigger.
  82. DRIVE_STRENGTH (3 << 5): indicate the drive strength of the pin using the
  83. following values:
  84. 00 - No change (reset state value kept)
  85. 01 - Low
  86. 10 - Medium
  87. 11 - High
  88. DEBOUNCE (1 << 16): indicate this pin needs debounce.
  89. DEBOUNCE_VAL (0x3fff << 17): debounce value.
  90. NOTE:
  91. Some requirements for using atmel,at91rm9200-pinctrl binding:
  92. 1. We have pin function node defined under at91 controller node to represent
  93. what pinmux functions this SoC supports.
  94. 2. The driver can use the function node's name and pin configuration node's
  95. name describe the pin function and group hierarchy.
  96. For example, Linux at91 pinctrl driver takes the function node's name
  97. as the function name and pin configuration node's name as group name to
  98. create the map table.
  99. 3. Each pin configuration node should have a phandle, devices can set pins
  100. configurations by referring to the phandle of that pin configuration node.
  101. 4. The gpio controller must be describe in the pinctrl simple-bus.
  102. Examples:
  103. pinctrl@fffff400 {
  104. #address-cells = <1>;
  105. #size-cells = <1>;
  106. ranges;
  107. compatible = "atmel,at91rm9200-pinctrl", "simple-bus";
  108. reg = <0xfffff400 0x600>;
  109. atmel,mux-mask = <
  110. /* A B */
  111. 0xffffffff 0xffc00c3b /* pioA */
  112. 0xffffffff 0x7fff3ccf /* pioB */
  113. 0xffffffff 0x007fffff /* pioC */
  114. >;
  115. /* shared pinctrl settings */
  116. dbgu {
  117. pinctrl_dbgu: dbgu-0 {
  118. atmel,pins =
  119. <1 14 0x1 0x0 /* PB14 periph A */
  120. 1 15 0x1 0x1>; /* PB15 periph A with pullup */
  121. };
  122. };
  123. };
  124. dbgu: serial@fffff200 {
  125. compatible = "atmel,at91sam9260-usart";
  126. reg = <0xfffff200 0x200>;
  127. interrupts = <1 4 7>;
  128. pinctrl-names = "default";
  129. pinctrl-0 = <&pinctrl_dbgu>;
  130. status = "disabled";
  131. };