0169-dt-bindings-pinctrl-add-bindings-for-MediaTek-MT7622.patch 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. From 4e4c2d695a5daf6dc55b8713af720ef15b52c0e7 Mon Sep 17 00:00:00 2001
  2. From: Sean Wang <[email protected]>
  3. Date: Tue, 12 Dec 2017 14:24:18 +0800
  4. Subject: [PATCH 169/224] dt-bindings: pinctrl: add bindings for MediaTek
  5. MT7622 SoC
  6. Add devicetree bindings for MediaTek MT7622 pinctrl driver.
  7. Signed-off-by: Sean Wang <[email protected]>
  8. Reviewed-by: Biao Huang <[email protected]>
  9. Acked-by: Rob Herring <[email protected]>
  10. Signed-off-by: Linus Walleij <[email protected]>
  11. ---
  12. .../devicetree/bindings/pinctrl/pinctrl-mt7622.txt | 351 +++++++++++++++++++++
  13. 1 file changed, 351 insertions(+)
  14. create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt
  15. --- /dev/null
  16. +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt
  17. @@ -0,0 +1,351 @@
  18. +== MediaTek MT7622 pinctrl controller ==
  19. +
  20. +Required properties for the root node:
  21. + - compatible: Should be one of the following
  22. + "mediatek,mt7622-pinctrl" for MT7622 SoC
  23. + - reg: offset and length of the pinctrl space
  24. +
  25. + - gpio-controller: Marks the device node as a GPIO controller.
  26. + - #gpio-cells: Should be two. The first cell is the pin number and the
  27. + second is the GPIO flags.
  28. +
  29. +Please refer to pinctrl-bindings.txt in this directory for details of the
  30. +common pinctrl bindings used by client devices, including the meaning of the
  31. +phrase "pin configuration node".
  32. +
  33. +MT7622 pin configuration nodes act as a container for an arbitrary number of
  34. +subnodes. Each of these subnodes represents some desired configuration for a
  35. +pin, a group, or a list of pins or groups. This configuration can include the
  36. +mux function to select on those pin(s)/group(s), and various pin configuration
  37. +parameters, such as pull-up, slew rate, etc.
  38. +
  39. +We support 2 types of configuration nodes. Those nodes can be either pinmux
  40. +nodes or pinconf nodes. Each configuration node can consist of multiple nodes
  41. +describing the pinmux and pinconf options.
  42. +
  43. +The name of each subnode doesn't matter as long as it is unique; all subnodes
  44. +should be enumerated and processed purely based on their content.
  45. +
  46. +== pinmux nodes content ==
  47. +
  48. +The following generic properties as defined in pinctrl-bindings.txt are valid
  49. +to specify in a pinmux subnode:
  50. +
  51. +Required properties are:
  52. + - groups: An array of strings. Each string contains the name of a group.
  53. + Valid values for these names are listed below.
  54. + - function: A string containing the name of the function to mux to the
  55. + group. Valid values for function names are listed below.
  56. +
  57. +== pinconf nodes content ==
  58. +
  59. +The following generic properties as defined in pinctrl-bindings.txt are valid
  60. +to specify in a pinconf subnode:
  61. +
  62. +Required properties are:
  63. + - pins: An array of strings. Each string contains the name of a pin.
  64. + Valid values for these names are listed below.
  65. + - groups: An array of strings. Each string contains the name of a group.
  66. + Valid values for these names are listed below.
  67. +
  68. +Optional properies are:
  69. + bias-disable, bias-pull, bias-pull-down, input-enable,
  70. + input-schmitt-enable, input-schmitt-disable, output-enable
  71. + output-low, output-high, drive-strength, slew-rate
  72. +
  73. + Valid arguments for 'slew-rate' are '0' for no slew rate controlled and '1' for
  74. + slower slew rate respectively.
  75. + Valid arguments for 'drive-strength', 4, 8, 12, or 16 in mA.
  76. +
  77. +The following specific properties as defined are valid to specify in a pinconf
  78. +subnode:
  79. +
  80. +Optional properties are:
  81. + - mediatek,tdsel: An integer describing the steps for output level shifter duty
  82. + cycle when asserted (high pulse width adjustment). Valid arguments are from 0
  83. + to 15.
  84. + - mediatek,rdsel: An integer describing the steps for input level shifter duty
  85. + cycle when asserted (high pulse width adjustment). Valid arguments are from 0
  86. + to 63.
  87. +
  88. +== Valid values for pins, function and groups on MT7622 ==
  89. +
  90. +Valid values for pins are:
  91. +pins can be referenced via the pin names as the below table shown and the
  92. +related physical number is also put ahead of those names which helps cross
  93. +references to pins between groups to know whether pins assignment conflict
  94. +happens among devices try to acquire those available pins.
  95. +
  96. + Pin #: Valid values for pins
  97. + -----------------------------
  98. + PIN 0: "GPIO_A"
  99. + PIN 1: "I2S1_IN"
  100. + PIN 2: "I2S1_OUT"
  101. + PIN 3: "I2S_BCLK"
  102. + PIN 4: "I2S_WS"
  103. + PIN 5: "I2S_MCLK"
  104. + PIN 6: "TXD0"
  105. + PIN 7: "RXD0"
  106. + PIN 8: "SPI_WP"
  107. + PIN 9: "SPI_HOLD"
  108. + PIN 10: "SPI_CLK"
  109. + PIN 11: "SPI_MOSI"
  110. + PIN 12: "SPI_MISO"
  111. + PIN 13: "SPI_CS"
  112. + PIN 14: "I2C_SDA"
  113. + PIN 15: "I2C_SCL"
  114. + PIN 16: "I2S2_IN"
  115. + PIN 17: "I2S3_IN"
  116. + PIN 18: "I2S4_IN"
  117. + PIN 19: "I2S2_OUT"
  118. + PIN 20: "I2S3_OUT"
  119. + PIN 21: "I2S4_OUT"
  120. + PIN 22: "GPIO_B"
  121. + PIN 23: "MDC"
  122. + PIN 24: "MDIO"
  123. + PIN 25: "G2_TXD0"
  124. + PIN 26: "G2_TXD1"
  125. + PIN 27: "G2_TXD2"
  126. + PIN 28: "G2_TXD3"
  127. + PIN 29: "G2_TXEN"
  128. + PIN 30: "G2_TXC"
  129. + PIN 31: "G2_RXD0"
  130. + PIN 32: "G2_RXD1"
  131. + PIN 33: "G2_RXD2"
  132. + PIN 34: "G2_RXD3"
  133. + PIN 35: "G2_RXDV"
  134. + PIN 36: "G2_RXC"
  135. + PIN 37: "NCEB"
  136. + PIN 38: "NWEB"
  137. + PIN 39: "NREB"
  138. + PIN 40: "NDL4"
  139. + PIN 41: "NDL5"
  140. + PIN 42: "NDL6"
  141. + PIN 43: "NDL7"
  142. + PIN 44: "NRB"
  143. + PIN 45: "NCLE"
  144. + PIN 46: "NALE"
  145. + PIN 47: "NDL0"
  146. + PIN 48: "NDL1"
  147. + PIN 49: "NDL2"
  148. + PIN 50: "NDL3"
  149. + PIN 51: "MDI_TP_P0"
  150. + PIN 52: "MDI_TN_P0"
  151. + PIN 53: "MDI_RP_P0"
  152. + PIN 54: "MDI_RN_P0"
  153. + PIN 55: "MDI_TP_P1"
  154. + PIN 56: "MDI_TN_P1"
  155. + PIN 57: "MDI_RP_P1"
  156. + PIN 58: "MDI_RN_P1"
  157. + PIN 59: "MDI_RP_P2"
  158. + PIN 60: "MDI_RN_P2"
  159. + PIN 61: "MDI_TP_P2"
  160. + PIN 62: "MDI_TN_P2"
  161. + PIN 63: "MDI_TP_P3"
  162. + PIN 64: "MDI_TN_P3"
  163. + PIN 65: "MDI_RP_P3"
  164. + PIN 66: "MDI_RN_P3"
  165. + PIN 67: "MDI_RP_P4"
  166. + PIN 68: "MDI_RN_P4"
  167. + PIN 69: "MDI_TP_P4"
  168. + PIN 70: "MDI_TN_P4"
  169. + PIN 71: "PMIC_SCL"
  170. + PIN 72: "PMIC_SDA"
  171. + PIN 73: "SPIC1_CLK"
  172. + PIN 74: "SPIC1_MOSI"
  173. + PIN 75: "SPIC1_MISO"
  174. + PIN 76: "SPIC1_CS"
  175. + PIN 77: "GPIO_D"
  176. + PIN 78: "WATCHDOG"
  177. + PIN 79: "RTS3_N"
  178. + PIN 80: "CTS3_N"
  179. + PIN 81: "TXD3"
  180. + PIN 82: "RXD3"
  181. + PIN 83: "PERST0_N"
  182. + PIN 84: "PERST1_N"
  183. + PIN 85: "WLED_N"
  184. + PIN 86: "EPHY_LED0_N"
  185. + PIN 87: "AUXIN0"
  186. + PIN 88: "AUXIN1"
  187. + PIN 89: "AUXIN2"
  188. + PIN 90: "AUXIN3"
  189. + PIN 91: "TXD4"
  190. + PIN 92: "RXD4"
  191. + PIN 93: "RTS4_N"
  192. + PIN 94: "CST4_N"
  193. + PIN 95: "PWM1"
  194. + PIN 96: "PWM2"
  195. + PIN 97: "PWM3"
  196. + PIN 98: "PWM4"
  197. + PIN 99: "PWM5"
  198. + PIN 100: "PWM6"
  199. + PIN 101: "PWM7"
  200. + PIN 102: "GPIO_E"
  201. +
  202. +Valid values for function are:
  203. + "emmc", "eth", "i2c", "i2s", "ir", "led", "flash", "pcie",
  204. + "pmic", "pwm", "sd", "spi", "tdm", "uart", "watchdog"
  205. +
  206. +Valid values for groups are:
  207. +additional data is put followingly with valid value allowing us to know which
  208. +applicable function and which relevant pins (in pin#) are able applied for that
  209. +group.
  210. +
  211. + Valid value function pins (in pin#)
  212. + -------------------------------------------------------------------------
  213. + "emmc" "emmc" 40, 41, 42, 43, 44, 45,
  214. + 47, 48, 49, 50
  215. + "emmc_rst" "emmc" 37
  216. + "esw" "eth" 51, 52, 53, 54, 55, 56,
  217. + 57, 58, 59, 60, 61, 62,
  218. + 63, 64, 65, 66, 67, 68,
  219. + 69, 70
  220. + "esw_p0_p1" "eth" 51, 52, 53, 54, 55, 56,
  221. + 57, 58
  222. + "esw_p2_p3_p4" "eth" 59, 60, 61, 62, 63, 64,
  223. + 65, 66, 67, 68, 69, 70
  224. + "rgmii_via_esw" "eth" 59, 60, 61, 62, 63, 64,
  225. + 65, 66, 67, 68, 69, 70
  226. + "rgmii_via_gmac1" "eth" 59, 60, 61, 62, 63, 64,
  227. + 65, 66, 67, 68, 69, 70
  228. + "rgmii_via_gmac2" "eth" 25, 26, 27, 28, 29, 30,
  229. + 31, 32, 33, 34, 35, 36
  230. + "mdc_mdio" "eth" 23, 24
  231. + "i2c0" "i2c" 14, 15
  232. + "i2c1_0" "i2c" 55, 56
  233. + "i2c1_1" "i2c" 73, 74
  234. + "i2c1_2" "i2c" 87, 88
  235. + "i2c2_0" "i2c" 57, 58
  236. + "i2c2_1" "i2c" 75, 76
  237. + "i2c2_2" "i2c" 89, 90
  238. + "i2s_in_mclk_bclk_ws" "i2s" 3, 4, 5
  239. + "i2s1_in_data" "i2s" 1
  240. + "i2s2_in_data" "i2s" 16
  241. + "i2s3_in_data" "i2s" 17
  242. + "i2s4_in_data" "i2s" 18
  243. + "i2s_out_mclk_bclk_ws" "i2s" 3, 4, 5
  244. + "i2s1_out_data" "i2s" 2
  245. + "i2s2_out_data" "i2s" 19
  246. + "i2s3_out_data" "i2s" 20
  247. + "i2s4_out_data" "i2s" 21
  248. + "ir_0_tx" "ir" 16
  249. + "ir_1_tx" "ir" 59
  250. + "ir_2_tx" "ir" 99
  251. + "ir_0_rx" "ir" 17
  252. + "ir_1_rx" "ir" 60
  253. + "ir_2_rx" "ir" 100
  254. + "ephy_leds" "led" 86, 91, 92, 93, 94
  255. + "ephy0_led" "led" 86
  256. + "ephy1_led" "led" 91
  257. + "ephy2_led" "led" 92
  258. + "ephy3_led" "led" 93
  259. + "ephy4_led" "led" 94
  260. + "wled" "led" 85
  261. + "par_nand" "flash" 37, 38, 39, 40, 41, 42,
  262. + 43, 44, 45, 46, 47, 48,
  263. + 49, 50
  264. + "snfi" "flash" 8, 9, 10, 11, 12, 13
  265. + "spi_nor" "flash" 8, 9, 10, 11, 12, 13
  266. + "pcie0_0_waken" "pcie" 14
  267. + "pcie0_1_waken" "pcie" 79
  268. + "pcie1_0_waken" "pcie" 14
  269. + "pcie0_0_clkreq" "pcie" 15
  270. + "pcie0_1_clkreq" "pcie" 80
  271. + "pcie1_0_clkreq" "pcie" 15
  272. + "pcie0_pad_perst" "pcie" 83
  273. + "pcie1_pad_perst" "pcie" 84
  274. + "pmic_bus" "pmic" 71, 72
  275. + "pwm_ch1_0" "pwm" 51
  276. + "pwm_ch1_1" "pwm" 73
  277. + "pwm_ch1_2" "pwm" 95
  278. + "pwm_ch2_0" "pwm" 52
  279. + "pwm_ch2_1" "pwm" 74
  280. + "pwm_ch2_2" "pwm" 96
  281. + "pwm_ch3_0" "pwm" 53
  282. + "pwm_ch3_1" "pwm" 75
  283. + "pwm_ch3_2" "pwm" 97
  284. + "pwm_ch4_0" "pwm" 54
  285. + "pwm_ch4_1" "pwm" 67
  286. + "pwm_ch4_2" "pwm" 76
  287. + "pwm_ch4_3" "pwm" 98
  288. + "pwm_ch5_0" "pwm" 68
  289. + "pwm_ch5_1" "pwm" 77
  290. + "pwm_ch5_2" "pwm" 99
  291. + "pwm_ch6_0" "pwm" 69
  292. + "pwm_ch6_1" "pwm" 78
  293. + "pwm_ch6_2" "pwm" 81
  294. + "pwm_ch6_3" "pwm" 100
  295. + "pwm_ch7_0" "pwm" 70
  296. + "pwm_ch7_1" "pwm" 82
  297. + "pwm_ch7_2" "pwm" 101
  298. + "sd_0" "sd" 16, 17, 18, 19, 20, 21
  299. + "sd_1" "sd" 25, 26, 27, 28, 29, 30
  300. + "spic0_0" "spi" 63, 64, 65, 66
  301. + "spic0_1" "spi" 79, 80, 81, 82
  302. + "spic1_0" "spi" 67, 68, 69, 70
  303. + "spic1_1" "spi" 73, 74, 75, 76
  304. + "spic2_0_wp_hold" "spi" 8, 9
  305. + "spic2_0" "spi" 10, 11, 12, 13
  306. + "tdm_0_out_mclk_bclk_ws" "tdm" 8, 9, 10
  307. + "tdm_0_in_mclk_bclk_ws" "tdm" 11, 12, 13
  308. + "tdm_0_out_data" "tdm" 20
  309. + "tdm_0_in_data" "tdm" 21
  310. + "tdm_1_out_mclk_bclk_ws" "tdm" 57, 58, 59
  311. + "tdm_1_in_mclk_bclk_ws" "tdm" 60, 61, 62
  312. + "tdm_1_out_data" "tdm" 55
  313. + "tdm_1_in_data" "tdm" 56
  314. + "uart0_0_tx_rx" "uart" 6, 7
  315. + "uart1_0_tx_rx" "uart" 55, 56
  316. + "uart1_0_rts_cts" "uart" 57, 58
  317. + "uart1_1_tx_rx" "uart" 73, 74
  318. + "uart1_1_rts_cts" "uart" 75, 76
  319. + "uart2_0_tx_rx" "uart" 3, 4
  320. + "uart2_0_rts_cts" "uart" 1, 2
  321. + "uart2_1_tx_rx" "uart" 51, 52
  322. + "uart2_1_rts_cts" "uart" 53, 54
  323. + "uart2_2_tx_rx" "uart" 59, 60
  324. + "uart2_2_rts_cts" "uart" 61, 62
  325. + "uart2_3_tx_rx" "uart" 95, 96
  326. + "uart3_0_tx_rx" "uart" 57, 58
  327. + "uart3_1_tx_rx" "uart" 81, 82
  328. + "uart3_1_rts_cts" "uart" 79, 80
  329. + "uart4_0_tx_rx" "uart" 61, 62
  330. + "uart4_1_tx_rx" "uart" 91, 92
  331. + "uart4_1_rts_cts" "uart" 93, 94
  332. + "uart4_2_tx_rx" "uart" 97, 98
  333. + "uart4_2_rts_cts" "uart" 95, 96
  334. + "watchdog" "watchdog" 78
  335. +
  336. +Example:
  337. +
  338. + pio: pinctrl@10211000 {
  339. + compatible = "mediatek,mt7622-pinctrl";
  340. + reg = <0 0x10211000 0 0x1000>;
  341. + gpio-controller;
  342. + #gpio-cells = <2>;
  343. +
  344. + pinctrl_eth_default: eth-default {
  345. + mux-mdio {
  346. + groups = "mdc_mdio";
  347. + function = "eth";
  348. + drive-strength = <12>;
  349. + };
  350. +
  351. + mux-gmac2 {
  352. + groups = "gmac2";
  353. + function = "eth";
  354. + drive-strength = <12>;
  355. + };
  356. +
  357. + mux-esw {
  358. + groups = "esw";
  359. + function = "eth";
  360. + drive-strength = <8>;
  361. + };
  362. +
  363. + conf-mdio {
  364. + pins = "MDC";
  365. + bias-pull-up;
  366. + };
  367. + };
  368. + };