pinctrl-meson8.c 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Pin controller and GPIO driver for Amlogic Meson8 and Meson8m2.
  4. *
  5. * Copyright (C) 2014 Beniamino Galvani <[email protected]>
  6. */
  7. #include <dt-bindings/gpio/meson8-gpio.h>
  8. #include "pinctrl-meson.h"
  9. #include "pinctrl-meson8-pmx.h"
  10. static const struct pinctrl_pin_desc meson8_cbus_pins[] = {
  11. MESON_PIN(GPIOX_0),
  12. MESON_PIN(GPIOX_1),
  13. MESON_PIN(GPIOX_2),
  14. MESON_PIN(GPIOX_3),
  15. MESON_PIN(GPIOX_4),
  16. MESON_PIN(GPIOX_5),
  17. MESON_PIN(GPIOX_6),
  18. MESON_PIN(GPIOX_7),
  19. MESON_PIN(GPIOX_8),
  20. MESON_PIN(GPIOX_9),
  21. MESON_PIN(GPIOX_10),
  22. MESON_PIN(GPIOX_11),
  23. MESON_PIN(GPIOX_12),
  24. MESON_PIN(GPIOX_13),
  25. MESON_PIN(GPIOX_14),
  26. MESON_PIN(GPIOX_15),
  27. MESON_PIN(GPIOX_16),
  28. MESON_PIN(GPIOX_17),
  29. MESON_PIN(GPIOX_18),
  30. MESON_PIN(GPIOX_19),
  31. MESON_PIN(GPIOX_20),
  32. MESON_PIN(GPIOX_21),
  33. MESON_PIN(GPIOY_0),
  34. MESON_PIN(GPIOY_1),
  35. MESON_PIN(GPIOY_2),
  36. MESON_PIN(GPIOY_3),
  37. MESON_PIN(GPIOY_4),
  38. MESON_PIN(GPIOY_5),
  39. MESON_PIN(GPIOY_6),
  40. MESON_PIN(GPIOY_7),
  41. MESON_PIN(GPIOY_8),
  42. MESON_PIN(GPIOY_9),
  43. MESON_PIN(GPIOY_10),
  44. MESON_PIN(GPIOY_11),
  45. MESON_PIN(GPIOY_12),
  46. MESON_PIN(GPIOY_13),
  47. MESON_PIN(GPIOY_14),
  48. MESON_PIN(GPIOY_15),
  49. MESON_PIN(GPIOY_16),
  50. MESON_PIN(GPIODV_0),
  51. MESON_PIN(GPIODV_1),
  52. MESON_PIN(GPIODV_2),
  53. MESON_PIN(GPIODV_3),
  54. MESON_PIN(GPIODV_4),
  55. MESON_PIN(GPIODV_5),
  56. MESON_PIN(GPIODV_6),
  57. MESON_PIN(GPIODV_7),
  58. MESON_PIN(GPIODV_8),
  59. MESON_PIN(GPIODV_9),
  60. MESON_PIN(GPIODV_10),
  61. MESON_PIN(GPIODV_11),
  62. MESON_PIN(GPIODV_12),
  63. MESON_PIN(GPIODV_13),
  64. MESON_PIN(GPIODV_14),
  65. MESON_PIN(GPIODV_15),
  66. MESON_PIN(GPIODV_16),
  67. MESON_PIN(GPIODV_17),
  68. MESON_PIN(GPIODV_18),
  69. MESON_PIN(GPIODV_19),
  70. MESON_PIN(GPIODV_20),
  71. MESON_PIN(GPIODV_21),
  72. MESON_PIN(GPIODV_22),
  73. MESON_PIN(GPIODV_23),
  74. MESON_PIN(GPIODV_24),
  75. MESON_PIN(GPIODV_25),
  76. MESON_PIN(GPIODV_26),
  77. MESON_PIN(GPIODV_27),
  78. MESON_PIN(GPIODV_28),
  79. MESON_PIN(GPIODV_29),
  80. MESON_PIN(GPIOH_0),
  81. MESON_PIN(GPIOH_1),
  82. MESON_PIN(GPIOH_2),
  83. MESON_PIN(GPIOH_3),
  84. MESON_PIN(GPIOH_4),
  85. MESON_PIN(GPIOH_5),
  86. MESON_PIN(GPIOH_6),
  87. MESON_PIN(GPIOH_7),
  88. MESON_PIN(GPIOH_8),
  89. MESON_PIN(GPIOH_9),
  90. MESON_PIN(GPIOZ_0),
  91. MESON_PIN(GPIOZ_1),
  92. MESON_PIN(GPIOZ_2),
  93. MESON_PIN(GPIOZ_3),
  94. MESON_PIN(GPIOZ_4),
  95. MESON_PIN(GPIOZ_5),
  96. MESON_PIN(GPIOZ_6),
  97. MESON_PIN(GPIOZ_7),
  98. MESON_PIN(GPIOZ_8),
  99. MESON_PIN(GPIOZ_9),
  100. MESON_PIN(GPIOZ_10),
  101. MESON_PIN(GPIOZ_11),
  102. MESON_PIN(GPIOZ_12),
  103. MESON_PIN(GPIOZ_13),
  104. MESON_PIN(GPIOZ_14),
  105. MESON_PIN(CARD_0),
  106. MESON_PIN(CARD_1),
  107. MESON_PIN(CARD_2),
  108. MESON_PIN(CARD_3),
  109. MESON_PIN(CARD_4),
  110. MESON_PIN(CARD_5),
  111. MESON_PIN(CARD_6),
  112. MESON_PIN(BOOT_0),
  113. MESON_PIN(BOOT_1),
  114. MESON_PIN(BOOT_2),
  115. MESON_PIN(BOOT_3),
  116. MESON_PIN(BOOT_4),
  117. MESON_PIN(BOOT_5),
  118. MESON_PIN(BOOT_6),
  119. MESON_PIN(BOOT_7),
  120. MESON_PIN(BOOT_8),
  121. MESON_PIN(BOOT_9),
  122. MESON_PIN(BOOT_10),
  123. MESON_PIN(BOOT_11),
  124. MESON_PIN(BOOT_12),
  125. MESON_PIN(BOOT_13),
  126. MESON_PIN(BOOT_14),
  127. MESON_PIN(BOOT_15),
  128. MESON_PIN(BOOT_16),
  129. MESON_PIN(BOOT_17),
  130. MESON_PIN(BOOT_18),
  131. };
  132. static const struct pinctrl_pin_desc meson8_aobus_pins[] = {
  133. MESON_PIN(GPIOAO_0),
  134. MESON_PIN(GPIOAO_1),
  135. MESON_PIN(GPIOAO_2),
  136. MESON_PIN(GPIOAO_3),
  137. MESON_PIN(GPIOAO_4),
  138. MESON_PIN(GPIOAO_5),
  139. MESON_PIN(GPIOAO_6),
  140. MESON_PIN(GPIOAO_7),
  141. MESON_PIN(GPIOAO_8),
  142. MESON_PIN(GPIOAO_9),
  143. MESON_PIN(GPIOAO_10),
  144. MESON_PIN(GPIOAO_11),
  145. MESON_PIN(GPIOAO_12),
  146. MESON_PIN(GPIOAO_13),
  147. MESON_PIN(GPIO_BSD_EN),
  148. MESON_PIN(GPIO_TEST_N),
  149. };
  150. /* bank X */
  151. static const unsigned int sd_d0_a_pins[] = { GPIOX_0 };
  152. static const unsigned int sd_d1_a_pins[] = { GPIOX_1 };
  153. static const unsigned int sd_d2_a_pins[] = { GPIOX_2 };
  154. static const unsigned int sd_d3_a_pins[] = { GPIOX_3 };
  155. static const unsigned int sd_clk_a_pins[] = { GPIOX_8 };
  156. static const unsigned int sd_cmd_a_pins[] = { GPIOX_9 };
  157. static const unsigned int sdxc_d0_a_pins[] = { GPIOX_0 };
  158. static const unsigned int sdxc_d13_a_pins[] = { GPIOX_1, GPIOX_2, GPIOX_3 };
  159. static const unsigned int sdxc_d47_a_pins[] = { GPIOX_4, GPIOX_5, GPIOX_6,
  160. GPIOX_7 };
  161. static const unsigned int sdxc_clk_a_pins[] = { GPIOX_8 };
  162. static const unsigned int sdxc_cmd_a_pins[] = { GPIOX_9 };
  163. static const unsigned int pcm_out_a_pins[] = { GPIOX_4 };
  164. static const unsigned int pcm_in_a_pins[] = { GPIOX_5 };
  165. static const unsigned int pcm_fs_a_pins[] = { GPIOX_6 };
  166. static const unsigned int pcm_clk_a_pins[] = { GPIOX_7 };
  167. static const unsigned int uart_tx_a0_pins[] = { GPIOX_4 };
  168. static const unsigned int uart_rx_a0_pins[] = { GPIOX_5 };
  169. static const unsigned int uart_cts_a0_pins[] = { GPIOX_6 };
  170. static const unsigned int uart_rts_a0_pins[] = { GPIOX_7 };
  171. static const unsigned int uart_tx_a1_pins[] = { GPIOX_12 };
  172. static const unsigned int uart_rx_a1_pins[] = { GPIOX_13 };
  173. static const unsigned int uart_cts_a1_pins[] = { GPIOX_14 };
  174. static const unsigned int uart_rts_a1_pins[] = { GPIOX_15 };
  175. static const unsigned int uart_tx_b0_pins[] = { GPIOX_16 };
  176. static const unsigned int uart_rx_b0_pins[] = { GPIOX_17 };
  177. static const unsigned int uart_cts_b0_pins[] = { GPIOX_18 };
  178. static const unsigned int uart_rts_b0_pins[] = { GPIOX_19 };
  179. static const unsigned int iso7816_det_pins[] = { GPIOX_16 };
  180. static const unsigned int iso7816_reset_pins[] = { GPIOX_17 };
  181. static const unsigned int iso7816_clk_pins[] = { GPIOX_18 };
  182. static const unsigned int iso7816_data_pins[] = { GPIOX_19 };
  183. static const unsigned int i2c_sda_d0_pins[] = { GPIOX_16 };
  184. static const unsigned int i2c_sck_d0_pins[] = { GPIOX_17 };
  185. static const unsigned int xtal_32k_out_pins[] = { GPIOX_10 };
  186. static const unsigned int xtal_24m_out_pins[] = { GPIOX_11 };
  187. static const unsigned int pwm_e_pins[] = { GPIOX_10 };
  188. static const unsigned int pwm_b_x_pins[] = { GPIOX_11 };
  189. /* bank Y */
  190. static const unsigned int uart_tx_c_pins[] = { GPIOY_0 };
  191. static const unsigned int uart_rx_c_pins[] = { GPIOY_1 };
  192. static const unsigned int uart_cts_c_pins[] = { GPIOY_2 };
  193. static const unsigned int uart_rts_c_pins[] = { GPIOY_3 };
  194. static const unsigned int pcm_out_b_pins[] = { GPIOY_4 };
  195. static const unsigned int pcm_in_b_pins[] = { GPIOY_5 };
  196. static const unsigned int pcm_fs_b_pins[] = { GPIOY_6 };
  197. static const unsigned int pcm_clk_b_pins[] = { GPIOY_7 };
  198. static const unsigned int i2c_sda_c0_pins[] = { GPIOY_0 };
  199. static const unsigned int i2c_sck_c0_pins[] = { GPIOY_1 };
  200. static const unsigned int pwm_a_y_pins[] = { GPIOY_16 };
  201. static const unsigned int i2s_out_ch45_pins[] = { GPIOY_0 };
  202. static const unsigned int i2s_out_ch23_pins[] = { GPIOY_1 };
  203. static const unsigned int i2s_out_ch01_pins[] = { GPIOY_4 };
  204. static const unsigned int i2s_in_ch01_pins[] = { GPIOY_5 };
  205. static const unsigned int i2s_lr_clk_in_pins[] = { GPIOY_6 };
  206. static const unsigned int i2s_ao_clk_in_pins[] = { GPIOY_7 };
  207. static const unsigned int i2s_am_clk_pins[] = { GPIOY_8 };
  208. static const unsigned int i2s_out_ch78_pins[] = { GPIOY_9 };
  209. static const unsigned int spdif_in_pins[] = { GPIOY_2 };
  210. static const unsigned int spdif_out_pins[] = { GPIOY_3 };
  211. /* bank DV */
  212. static const unsigned int dvin_rgb_pins[] = {
  213. GPIODV_0, GPIODV_1, GPIODV_2, GPIODV_3, GPIODV_4, GPIODV_5,
  214. GPIODV_6, GPIODV_7, GPIODV_8, GPIODV_9, GPIODV_10, GPIODV_11,
  215. GPIODV_12, GPIODV_13, GPIODV_14, GPIODV_15, GPIODV_16, GPIODV_17,
  216. GPIODV_18, GPIODV_19, GPIODV_20, GPIODV_21, GPIODV_22, GPIODV_23
  217. };
  218. static const unsigned int dvin_vs_pins[] = { GPIODV_24 };
  219. static const unsigned int dvin_hs_pins[] = { GPIODV_25 };
  220. static const unsigned int dvin_clk_pins[] = { GPIODV_26 };
  221. static const unsigned int dvin_de_pins[] = { GPIODV_27 };
  222. static const unsigned int enc_0_pins[] = { GPIODV_0 };
  223. static const unsigned int enc_1_pins[] = { GPIODV_1 };
  224. static const unsigned int enc_2_pins[] = { GPIODV_2 };
  225. static const unsigned int enc_3_pins[] = { GPIODV_3 };
  226. static const unsigned int enc_4_pins[] = { GPIODV_4 };
  227. static const unsigned int enc_5_pins[] = { GPIODV_5 };
  228. static const unsigned int enc_6_pins[] = { GPIODV_6 };
  229. static const unsigned int enc_7_pins[] = { GPIODV_7 };
  230. static const unsigned int enc_8_pins[] = { GPIODV_8 };
  231. static const unsigned int enc_9_pins[] = { GPIODV_9 };
  232. static const unsigned int enc_10_pins[] = { GPIODV_10 };
  233. static const unsigned int enc_11_pins[] = { GPIODV_11 };
  234. static const unsigned int enc_12_pins[] = { GPIODV_12 };
  235. static const unsigned int enc_13_pins[] = { GPIODV_13 };
  236. static const unsigned int enc_14_pins[] = { GPIODV_14 };
  237. static const unsigned int enc_15_pins[] = { GPIODV_15 };
  238. static const unsigned int enc_16_pins[] = { GPIODV_16 };
  239. static const unsigned int enc_17_pins[] = { GPIODV_17 };
  240. static const unsigned int uart_tx_b1_pins[] = { GPIODV_24 };
  241. static const unsigned int uart_rx_b1_pins[] = { GPIODV_25 };
  242. static const unsigned int uart_cts_b1_pins[] = { GPIODV_26 };
  243. static const unsigned int uart_rts_b1_pins[] = { GPIODV_27 };
  244. static const unsigned int vga_vs_pins[] = { GPIODV_24 };
  245. static const unsigned int vga_hs_pins[] = { GPIODV_25 };
  246. static const unsigned int pwm_c_dv9_pins[] = { GPIODV_9 };
  247. static const unsigned int pwm_c_dv29_pins[] = { GPIODV_29 };
  248. static const unsigned int pwm_d_pins[] = { GPIODV_28 };
  249. /* bank H */
  250. static const unsigned int hdmi_hpd_pins[] = { GPIOH_0 };
  251. static const unsigned int hdmi_sda_pins[] = { GPIOH_1 };
  252. static const unsigned int hdmi_scl_pins[] = { GPIOH_2 };
  253. static const unsigned int hdmi_cec_pins[] = { GPIOH_3 };
  254. static const unsigned int spi_ss0_0_pins[] = { GPIOH_3 };
  255. static const unsigned int spi_miso_0_pins[] = { GPIOH_4 };
  256. static const unsigned int spi_mosi_0_pins[] = { GPIOH_5 };
  257. static const unsigned int spi_sclk_0_pins[] = { GPIOH_6 };
  258. static const unsigned int i2c_sda_d1_pins[] = { GPIOH_7 };
  259. static const unsigned int i2c_sck_d1_pins[] = { GPIOH_8 };
  260. /* bank Z */
  261. static const unsigned int spi_ss0_1_pins[] = { GPIOZ_9 };
  262. static const unsigned int spi_ss1_1_pins[] = { GPIOZ_10 };
  263. static const unsigned int spi_sclk_1_pins[] = { GPIOZ_11 };
  264. static const unsigned int spi_mosi_1_pins[] = { GPIOZ_12 };
  265. static const unsigned int spi_miso_1_pins[] = { GPIOZ_13 };
  266. static const unsigned int spi_ss2_1_pins[] = { GPIOZ_14 };
  267. static const unsigned int eth_txd3_pins[] = { GPIOZ_0 };
  268. static const unsigned int eth_txd2_pins[] = { GPIOZ_1 };
  269. static const unsigned int eth_rxd3_pins[] = { GPIOZ_2 };
  270. static const unsigned int eth_rxd2_pins[] = { GPIOZ_3 };
  271. static const unsigned int eth_tx_clk_50m_pins[] = { GPIOZ_4 };
  272. static const unsigned int eth_tx_en_pins[] = { GPIOZ_5 };
  273. static const unsigned int eth_txd1_pins[] = { GPIOZ_6 };
  274. static const unsigned int eth_txd0_pins[] = { GPIOZ_7 };
  275. static const unsigned int eth_rx_clk_in_pins[] = { GPIOZ_8 };
  276. static const unsigned int eth_rx_dv_pins[] = { GPIOZ_9 };
  277. static const unsigned int eth_rxd1_pins[] = { GPIOZ_10 };
  278. static const unsigned int eth_rxd0_pins[] = { GPIOZ_11 };
  279. static const unsigned int eth_mdio_pins[] = { GPIOZ_12 };
  280. static const unsigned int eth_mdc_pins[] = { GPIOZ_13 };
  281. static const unsigned int i2c_sda_a0_pins[] = { GPIOZ_0 };
  282. static const unsigned int i2c_sck_a0_pins[] = { GPIOZ_1 };
  283. static const unsigned int i2c_sda_b_pins[] = { GPIOZ_2 };
  284. static const unsigned int i2c_sck_b_pins[] = { GPIOZ_3 };
  285. static const unsigned int i2c_sda_c1_pins[] = { GPIOZ_4 };
  286. static const unsigned int i2c_sck_c1_pins[] = { GPIOZ_5 };
  287. static const unsigned int i2c_sda_a1_pins[] = { GPIOZ_0 };
  288. static const unsigned int i2c_sck_a1_pins[] = { GPIOZ_1 };
  289. static const unsigned int i2c_sda_a2_pins[] = { GPIOZ_0 };
  290. static const unsigned int i2c_sck_a2_pins[] = { GPIOZ_1 };
  291. static const unsigned int pwm_a_z0_pins[] = { GPIOZ_0 };
  292. static const unsigned int pwm_a_z7_pins[] = { GPIOZ_7 };
  293. static const unsigned int pwm_b_z_pins[] = { GPIOZ_1 };
  294. static const unsigned int pwm_c_z_pins[] = { GPIOZ_8 };
  295. /* bank BOOT */
  296. static const unsigned int sd_d0_c_pins[] = { BOOT_0 };
  297. static const unsigned int sd_d1_c_pins[] = { BOOT_1 };
  298. static const unsigned int sd_d2_c_pins[] = { BOOT_2 };
  299. static const unsigned int sd_d3_c_pins[] = { BOOT_3 };
  300. static const unsigned int sd_cmd_c_pins[] = { BOOT_16 };
  301. static const unsigned int sd_clk_c_pins[] = { BOOT_17 };
  302. static const unsigned int sdxc_d0_c_pins[] = { BOOT_0};
  303. static const unsigned int sdxc_d13_c_pins[] = { BOOT_1, BOOT_2, BOOT_3 };
  304. static const unsigned int sdxc_d47_c_pins[] = { BOOT_4, BOOT_5, BOOT_6,
  305. BOOT_7 };
  306. static const unsigned int sdxc_cmd_c_pins[] = { BOOT_16 };
  307. static const unsigned int sdxc_clk_c_pins[] = { BOOT_17 };
  308. static const unsigned int nand_io_pins[] = {
  309. BOOT_0, BOOT_1, BOOT_2, BOOT_3, BOOT_4, BOOT_5, BOOT_6, BOOT_7
  310. };
  311. static const unsigned int nand_io_ce0_pins[] = { BOOT_8 };
  312. static const unsigned int nand_io_ce1_pins[] = { BOOT_9 };
  313. static const unsigned int nand_io_rb0_pins[] = { BOOT_10 };
  314. static const unsigned int nand_ale_pins[] = { BOOT_11 };
  315. static const unsigned int nand_cle_pins[] = { BOOT_12 };
  316. static const unsigned int nand_wen_clk_pins[] = { BOOT_13 };
  317. static const unsigned int nand_ren_clk_pins[] = { BOOT_14 };
  318. static const unsigned int nand_dqs_pins[] = { BOOT_15 };
  319. static const unsigned int nand_ce2_pins[] = { BOOT_16 };
  320. static const unsigned int nand_ce3_pins[] = { BOOT_17 };
  321. static const unsigned int nor_d_pins[] = { BOOT_11 };
  322. static const unsigned int nor_q_pins[] = { BOOT_12 };
  323. static const unsigned int nor_c_pins[] = { BOOT_13 };
  324. static const unsigned int nor_cs_pins[] = { BOOT_18 };
  325. /* bank CARD */
  326. static const unsigned int sd_d1_b_pins[] = { CARD_0 };
  327. static const unsigned int sd_d0_b_pins[] = { CARD_1 };
  328. static const unsigned int sd_clk_b_pins[] = { CARD_2 };
  329. static const unsigned int sd_cmd_b_pins[] = { CARD_3 };
  330. static const unsigned int sd_d3_b_pins[] = { CARD_4 };
  331. static const unsigned int sd_d2_b_pins[] = { CARD_5 };
  332. static const unsigned int sdxc_d13_b_pins[] = { CARD_0, CARD_4, CARD_5 };
  333. static const unsigned int sdxc_d0_b_pins[] = { CARD_1 };
  334. static const unsigned int sdxc_clk_b_pins[] = { CARD_2 };
  335. static const unsigned int sdxc_cmd_b_pins[] = { CARD_3 };
  336. /* bank AO */
  337. static const unsigned int uart_tx_ao_a_pins[] = { GPIOAO_0 };
  338. static const unsigned int uart_rx_ao_a_pins[] = { GPIOAO_1 };
  339. static const unsigned int uart_cts_ao_a_pins[] = { GPIOAO_2 };
  340. static const unsigned int uart_rts_ao_a_pins[] = { GPIOAO_3 };
  341. static const unsigned int remote_input_pins[] = { GPIOAO_7 };
  342. static const unsigned int remote_output_ao_pins[] = { GPIOAO_13 };
  343. static const unsigned int i2c_slave_sck_ao_pins[] = { GPIOAO_4 };
  344. static const unsigned int i2c_slave_sda_ao_pins[] = { GPIOAO_5 };
  345. static const unsigned int uart_tx_ao_b0_pins[] = { GPIOAO_0 };
  346. static const unsigned int uart_rx_ao_b0_pins[] = { GPIOAO_1 };
  347. static const unsigned int uart_tx_ao_b1_pins[] = { GPIOAO_4 };
  348. static const unsigned int uart_rx_ao_b1_pins[] = { GPIOAO_5 };
  349. static const unsigned int i2c_mst_sck_ao_pins[] = { GPIOAO_4 };
  350. static const unsigned int i2c_mst_sda_ao_pins[] = { GPIOAO_5 };
  351. static const unsigned int pwm_f_ao_pins[] = { GPIO_TEST_N };
  352. static const unsigned int i2s_am_clk_out_ao_pins[] = { GPIOAO_8 };
  353. static const unsigned int i2s_ao_clk_out_ao_pins[] = { GPIOAO_9 };
  354. static const unsigned int i2s_lr_clk_out_ao_pins[] = { GPIOAO_10 };
  355. static const unsigned int i2s_out_ch01_ao_pins[] = { GPIOAO_11 };
  356. static const unsigned int hdmi_cec_ao_pins[] = { GPIOAO_12 };
  357. static struct meson_pmx_group meson8_cbus_groups[] = {
  358. GPIO_GROUP(GPIOX_0),
  359. GPIO_GROUP(GPIOX_1),
  360. GPIO_GROUP(GPIOX_2),
  361. GPIO_GROUP(GPIOX_3),
  362. GPIO_GROUP(GPIOX_4),
  363. GPIO_GROUP(GPIOX_5),
  364. GPIO_GROUP(GPIOX_6),
  365. GPIO_GROUP(GPIOX_7),
  366. GPIO_GROUP(GPIOX_8),
  367. GPIO_GROUP(GPIOX_9),
  368. GPIO_GROUP(GPIOX_10),
  369. GPIO_GROUP(GPIOX_11),
  370. GPIO_GROUP(GPIOX_12),
  371. GPIO_GROUP(GPIOX_13),
  372. GPIO_GROUP(GPIOX_14),
  373. GPIO_GROUP(GPIOX_15),
  374. GPIO_GROUP(GPIOX_16),
  375. GPIO_GROUP(GPIOX_17),
  376. GPIO_GROUP(GPIOX_18),
  377. GPIO_GROUP(GPIOX_19),
  378. GPIO_GROUP(GPIOX_20),
  379. GPIO_GROUP(GPIOX_21),
  380. GPIO_GROUP(GPIOY_0),
  381. GPIO_GROUP(GPIOY_1),
  382. GPIO_GROUP(GPIOY_2),
  383. GPIO_GROUP(GPIOY_3),
  384. GPIO_GROUP(GPIOY_4),
  385. GPIO_GROUP(GPIOY_5),
  386. GPIO_GROUP(GPIOY_6),
  387. GPIO_GROUP(GPIOY_7),
  388. GPIO_GROUP(GPIOY_8),
  389. GPIO_GROUP(GPIOY_9),
  390. GPIO_GROUP(GPIOY_10),
  391. GPIO_GROUP(GPIOY_11),
  392. GPIO_GROUP(GPIOY_12),
  393. GPIO_GROUP(GPIOY_13),
  394. GPIO_GROUP(GPIOY_14),
  395. GPIO_GROUP(GPIOY_15),
  396. GPIO_GROUP(GPIOY_16),
  397. GPIO_GROUP(GPIODV_0),
  398. GPIO_GROUP(GPIODV_1),
  399. GPIO_GROUP(GPIODV_2),
  400. GPIO_GROUP(GPIODV_3),
  401. GPIO_GROUP(GPIODV_4),
  402. GPIO_GROUP(GPIODV_5),
  403. GPIO_GROUP(GPIODV_6),
  404. GPIO_GROUP(GPIODV_7),
  405. GPIO_GROUP(GPIODV_8),
  406. GPIO_GROUP(GPIODV_9),
  407. GPIO_GROUP(GPIODV_10),
  408. GPIO_GROUP(GPIODV_11),
  409. GPIO_GROUP(GPIODV_12),
  410. GPIO_GROUP(GPIODV_13),
  411. GPIO_GROUP(GPIODV_14),
  412. GPIO_GROUP(GPIODV_15),
  413. GPIO_GROUP(GPIODV_16),
  414. GPIO_GROUP(GPIODV_17),
  415. GPIO_GROUP(GPIODV_18),
  416. GPIO_GROUP(GPIODV_19),
  417. GPIO_GROUP(GPIODV_20),
  418. GPIO_GROUP(GPIODV_21),
  419. GPIO_GROUP(GPIODV_22),
  420. GPIO_GROUP(GPIODV_23),
  421. GPIO_GROUP(GPIODV_24),
  422. GPIO_GROUP(GPIODV_25),
  423. GPIO_GROUP(GPIODV_26),
  424. GPIO_GROUP(GPIODV_27),
  425. GPIO_GROUP(GPIODV_28),
  426. GPIO_GROUP(GPIODV_29),
  427. GPIO_GROUP(GPIOH_0),
  428. GPIO_GROUP(GPIOH_1),
  429. GPIO_GROUP(GPIOH_2),
  430. GPIO_GROUP(GPIOH_3),
  431. GPIO_GROUP(GPIOH_4),
  432. GPIO_GROUP(GPIOH_5),
  433. GPIO_GROUP(GPIOH_6),
  434. GPIO_GROUP(GPIOH_7),
  435. GPIO_GROUP(GPIOH_8),
  436. GPIO_GROUP(GPIOH_9),
  437. GPIO_GROUP(GPIOZ_0),
  438. GPIO_GROUP(GPIOZ_1),
  439. GPIO_GROUP(GPIOZ_2),
  440. GPIO_GROUP(GPIOZ_3),
  441. GPIO_GROUP(GPIOZ_4),
  442. GPIO_GROUP(GPIOZ_5),
  443. GPIO_GROUP(GPIOZ_6),
  444. GPIO_GROUP(GPIOZ_7),
  445. GPIO_GROUP(GPIOZ_8),
  446. GPIO_GROUP(GPIOZ_9),
  447. GPIO_GROUP(GPIOZ_10),
  448. GPIO_GROUP(GPIOZ_11),
  449. GPIO_GROUP(GPIOZ_12),
  450. GPIO_GROUP(GPIOZ_13),
  451. GPIO_GROUP(GPIOZ_14),
  452. GPIO_GROUP(CARD_0),
  453. GPIO_GROUP(CARD_1),
  454. GPIO_GROUP(CARD_2),
  455. GPIO_GROUP(CARD_3),
  456. GPIO_GROUP(CARD_4),
  457. GPIO_GROUP(CARD_5),
  458. GPIO_GROUP(CARD_6),
  459. GPIO_GROUP(BOOT_0),
  460. GPIO_GROUP(BOOT_1),
  461. GPIO_GROUP(BOOT_2),
  462. GPIO_GROUP(BOOT_3),
  463. GPIO_GROUP(BOOT_4),
  464. GPIO_GROUP(BOOT_5),
  465. GPIO_GROUP(BOOT_6),
  466. GPIO_GROUP(BOOT_7),
  467. GPIO_GROUP(BOOT_8),
  468. GPIO_GROUP(BOOT_9),
  469. GPIO_GROUP(BOOT_10),
  470. GPIO_GROUP(BOOT_11),
  471. GPIO_GROUP(BOOT_12),
  472. GPIO_GROUP(BOOT_13),
  473. GPIO_GROUP(BOOT_14),
  474. GPIO_GROUP(BOOT_15),
  475. GPIO_GROUP(BOOT_16),
  476. GPIO_GROUP(BOOT_17),
  477. GPIO_GROUP(BOOT_18),
  478. /* bank X */
  479. GROUP(sd_d0_a, 8, 5),
  480. GROUP(sd_d1_a, 8, 4),
  481. GROUP(sd_d2_a, 8, 3),
  482. GROUP(sd_d3_a, 8, 2),
  483. GROUP(sd_clk_a, 8, 1),
  484. GROUP(sd_cmd_a, 8, 0),
  485. GROUP(sdxc_d0_a, 5, 14),
  486. GROUP(sdxc_d13_a, 5, 13),
  487. GROUP(sdxc_d47_a, 5, 12),
  488. GROUP(sdxc_clk_a, 5, 11),
  489. GROUP(sdxc_cmd_a, 5, 10),
  490. GROUP(pcm_out_a, 3, 30),
  491. GROUP(pcm_in_a, 3, 29),
  492. GROUP(pcm_fs_a, 3, 28),
  493. GROUP(pcm_clk_a, 3, 27),
  494. GROUP(uart_tx_a0, 4, 17),
  495. GROUP(uart_rx_a0, 4, 16),
  496. GROUP(uart_cts_a0, 4, 15),
  497. GROUP(uart_rts_a0, 4, 14),
  498. GROUP(uart_tx_a1, 4, 13),
  499. GROUP(uart_rx_a1, 4, 12),
  500. GROUP(uart_cts_a1, 4, 11),
  501. GROUP(uart_rts_a1, 4, 10),
  502. GROUP(uart_tx_b0, 4, 9),
  503. GROUP(uart_rx_b0, 4, 8),
  504. GROUP(uart_cts_b0, 4, 7),
  505. GROUP(uart_rts_b0, 4, 6),
  506. GROUP(iso7816_det, 4, 21),
  507. GROUP(iso7816_reset, 4, 20),
  508. GROUP(iso7816_clk, 4, 19),
  509. GROUP(iso7816_data, 4, 18),
  510. GROUP(i2c_sda_d0, 4, 5),
  511. GROUP(i2c_sck_d0, 4, 4),
  512. GROUP(xtal_32k_out, 3, 22),
  513. GROUP(xtal_24m_out, 3, 23),
  514. GROUP(pwm_e, 9, 19),
  515. GROUP(pwm_b_x, 2, 3),
  516. /* bank Y */
  517. GROUP(uart_tx_c, 1, 19),
  518. GROUP(uart_rx_c, 1, 18),
  519. GROUP(uart_cts_c, 1, 17),
  520. GROUP(uart_rts_c, 1, 16),
  521. GROUP(pcm_out_b, 4, 25),
  522. GROUP(pcm_in_b, 4, 24),
  523. GROUP(pcm_fs_b, 4, 23),
  524. GROUP(pcm_clk_b, 4, 22),
  525. GROUP(i2c_sda_c0, 1, 15),
  526. GROUP(i2c_sck_c0, 1, 14),
  527. GROUP(pwm_a_y, 9, 14),
  528. GROUP(i2s_out_ch45, 1, 10),
  529. GROUP(i2s_out_ch23, 1, 19),
  530. GROUP(i2s_out_ch01, 1, 6),
  531. GROUP(i2s_in_ch01, 1, 5),
  532. GROUP(i2s_lr_clk_in, 1, 4),
  533. GROUP(i2s_ao_clk_in, 1, 2),
  534. GROUP(i2s_am_clk, 1, 0),
  535. GROUP(i2s_out_ch78, 1, 11),
  536. GROUP(spdif_in, 1, 8),
  537. GROUP(spdif_out, 1, 7),
  538. /* bank DV */
  539. GROUP(dvin_rgb, 0, 6),
  540. GROUP(dvin_vs, 0, 9),
  541. GROUP(dvin_hs, 0, 8),
  542. GROUP(dvin_clk, 0, 7),
  543. GROUP(dvin_de, 0, 10),
  544. GROUP(enc_0, 7, 0),
  545. GROUP(enc_1, 7, 1),
  546. GROUP(enc_2, 7, 2),
  547. GROUP(enc_3, 7, 3),
  548. GROUP(enc_4, 7, 4),
  549. GROUP(enc_5, 7, 5),
  550. GROUP(enc_6, 7, 6),
  551. GROUP(enc_7, 7, 7),
  552. GROUP(enc_8, 7, 8),
  553. GROUP(enc_9, 7, 9),
  554. GROUP(enc_10, 7, 10),
  555. GROUP(enc_11, 7, 11),
  556. GROUP(enc_12, 7, 12),
  557. GROUP(enc_13, 7, 13),
  558. GROUP(enc_14, 7, 14),
  559. GROUP(enc_15, 7, 15),
  560. GROUP(enc_16, 7, 16),
  561. GROUP(enc_17, 7, 17),
  562. GROUP(uart_tx_b1, 6, 23),
  563. GROUP(uart_rx_b1, 6, 22),
  564. GROUP(uart_cts_b1, 6, 21),
  565. GROUP(uart_rts_b1, 6, 20),
  566. GROUP(vga_vs, 0, 21),
  567. GROUP(vga_hs, 0, 20),
  568. GROUP(pwm_c_dv9, 3, 24),
  569. GROUP(pwm_c_dv29, 3, 25),
  570. GROUP(pwm_d, 3, 26),
  571. /* bank H */
  572. GROUP(hdmi_hpd, 1, 26),
  573. GROUP(hdmi_sda, 1, 25),
  574. GROUP(hdmi_scl, 1, 24),
  575. GROUP(hdmi_cec, 1, 23),
  576. GROUP(spi_ss0_0, 9, 13),
  577. GROUP(spi_miso_0, 9, 12),
  578. GROUP(spi_mosi_0, 9, 11),
  579. GROUP(spi_sclk_0, 9, 10),
  580. GROUP(i2c_sda_d1, 4, 3),
  581. GROUP(i2c_sck_d1, 4, 2),
  582. /* bank Z */
  583. GROUP(spi_ss0_1, 8, 16),
  584. GROUP(spi_ss1_1, 8, 12),
  585. GROUP(spi_sclk_1, 8, 15),
  586. GROUP(spi_mosi_1, 8, 14),
  587. GROUP(spi_miso_1, 8, 13),
  588. GROUP(spi_ss2_1, 8, 17),
  589. GROUP(eth_tx_clk_50m, 6, 15),
  590. GROUP(eth_tx_en, 6, 14),
  591. GROUP(eth_txd1, 6, 13),
  592. GROUP(eth_txd0, 6, 12),
  593. GROUP(eth_rx_clk_in, 6, 10),
  594. GROUP(eth_rx_dv, 6, 11),
  595. GROUP(eth_rxd1, 6, 8),
  596. GROUP(eth_rxd0, 6, 7),
  597. GROUP(eth_mdio, 6, 6),
  598. GROUP(eth_mdc, 6, 5),
  599. /* NOTE: the following four groups are only available on Meson8m2: */
  600. GROUP(eth_rxd2, 6, 3),
  601. GROUP(eth_rxd3, 6, 2),
  602. GROUP(eth_txd2, 6, 1),
  603. GROUP(eth_txd3, 6, 0),
  604. GROUP(i2c_sda_a0, 5, 31),
  605. GROUP(i2c_sck_a0, 5, 30),
  606. GROUP(i2c_sda_b, 5, 27),
  607. GROUP(i2c_sck_b, 5, 26),
  608. GROUP(i2c_sda_c1, 5, 25),
  609. GROUP(i2c_sck_c1, 5, 24),
  610. GROUP(i2c_sda_a1, 5, 9),
  611. GROUP(i2c_sck_a1, 5, 8),
  612. GROUP(i2c_sda_a2, 5, 7),
  613. GROUP(i2c_sck_a2, 5, 6),
  614. GROUP(pwm_a_z0, 9, 16),
  615. GROUP(pwm_a_z7, 2, 0),
  616. GROUP(pwm_b_z, 9, 15),
  617. GROUP(pwm_c_z, 2, 1),
  618. /* bank BOOT */
  619. GROUP(sd_d0_c, 6, 29),
  620. GROUP(sd_d1_c, 6, 28),
  621. GROUP(sd_d2_c, 6, 27),
  622. GROUP(sd_d3_c, 6, 26),
  623. GROUP(sd_cmd_c, 6, 25),
  624. GROUP(sd_clk_c, 6, 24),
  625. GROUP(sdxc_d0_c, 4, 30),
  626. GROUP(sdxc_d13_c, 4, 29),
  627. GROUP(sdxc_d47_c, 4, 28),
  628. GROUP(sdxc_cmd_c, 4, 27),
  629. GROUP(sdxc_clk_c, 4, 26),
  630. GROUP(nand_io, 2, 26),
  631. GROUP(nand_io_ce0, 2, 25),
  632. GROUP(nand_io_ce1, 2, 24),
  633. GROUP(nand_io_rb0, 2, 17),
  634. GROUP(nand_ale, 2, 21),
  635. GROUP(nand_cle, 2, 20),
  636. GROUP(nand_wen_clk, 2, 19),
  637. GROUP(nand_ren_clk, 2, 18),
  638. GROUP(nand_dqs, 2, 27),
  639. GROUP(nand_ce2, 2, 23),
  640. GROUP(nand_ce3, 2, 22),
  641. GROUP(nor_d, 5, 1),
  642. GROUP(nor_q, 5, 3),
  643. GROUP(nor_c, 5, 2),
  644. GROUP(nor_cs, 5, 0),
  645. /* bank CARD */
  646. GROUP(sd_d1_b, 2, 14),
  647. GROUP(sd_d0_b, 2, 15),
  648. GROUP(sd_clk_b, 2, 11),
  649. GROUP(sd_cmd_b, 2, 10),
  650. GROUP(sd_d3_b, 2, 12),
  651. GROUP(sd_d2_b, 2, 13),
  652. GROUP(sdxc_d13_b, 2, 6),
  653. GROUP(sdxc_d0_b, 2, 7),
  654. GROUP(sdxc_clk_b, 2, 5),
  655. GROUP(sdxc_cmd_b, 2, 4),
  656. };
  657. static struct meson_pmx_group meson8_aobus_groups[] = {
  658. GPIO_GROUP(GPIOAO_0),
  659. GPIO_GROUP(GPIOAO_1),
  660. GPIO_GROUP(GPIOAO_2),
  661. GPIO_GROUP(GPIOAO_3),
  662. GPIO_GROUP(GPIOAO_4),
  663. GPIO_GROUP(GPIOAO_5),
  664. GPIO_GROUP(GPIOAO_6),
  665. GPIO_GROUP(GPIOAO_7),
  666. GPIO_GROUP(GPIOAO_8),
  667. GPIO_GROUP(GPIOAO_9),
  668. GPIO_GROUP(GPIOAO_10),
  669. GPIO_GROUP(GPIOAO_11),
  670. GPIO_GROUP(GPIOAO_12),
  671. GPIO_GROUP(GPIOAO_13),
  672. GPIO_GROUP(GPIO_BSD_EN),
  673. GPIO_GROUP(GPIO_TEST_N),
  674. /* bank AO */
  675. GROUP(uart_tx_ao_a, 0, 12),
  676. GROUP(uart_rx_ao_a, 0, 11),
  677. GROUP(uart_cts_ao_a, 0, 10),
  678. GROUP(uart_rts_ao_a, 0, 9),
  679. GROUP(remote_input, 0, 0),
  680. GROUP(remote_output_ao, 0, 31),
  681. GROUP(i2c_slave_sck_ao, 0, 2),
  682. GROUP(i2c_slave_sda_ao, 0, 1),
  683. GROUP(uart_tx_ao_b0, 0, 26),
  684. GROUP(uart_rx_ao_b0, 0, 25),
  685. GROUP(uart_tx_ao_b1, 0, 24),
  686. GROUP(uart_rx_ao_b1, 0, 23),
  687. GROUP(i2c_mst_sck_ao, 0, 6),
  688. GROUP(i2c_mst_sda_ao, 0, 5),
  689. GROUP(pwm_f_ao, 0, 19),
  690. GROUP(i2s_am_clk_out_ao, 0, 30),
  691. GROUP(i2s_ao_clk_out_ao, 0, 29),
  692. GROUP(i2s_lr_clk_out_ao, 0, 28),
  693. GROUP(i2s_out_ch01_ao, 0, 27),
  694. GROUP(hdmi_cec_ao, 0, 17),
  695. };
  696. static const char * const gpio_periphs_groups[] = {
  697. "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4",
  698. "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9",
  699. "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14",
  700. "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18", "GPIOX_19",
  701. "GPIOX_20", "GPIOX_21",
  702. "GPIOY_0", "GPIOY_1", "GPIOY_2", "GPIOY_3", "GPIOY_4",
  703. "GPIOY_5", "GPIOY_6", "GPIOY_7", "GPIOY_8", "GPIOY_9",
  704. "GPIOY_10", "GPIOY_11", "GPIOY_12", "GPIOY_13", "GPIOY_14",
  705. "GPIOY_15", "GPIOY_16",
  706. "GPIODV_0", "GPIODV_1", "GPIODV_2", "GPIODV_3", "GPIODV_4",
  707. "GPIODV_5", "GPIODV_6", "GPIODV_7", "GPIODV_8", "GPIODV_9",
  708. "GPIODV_10", "GPIODV_11", "GPIODV_12", "GPIODV_13", "GPIODV_14",
  709. "GPIODV_15", "GPIODV_16", "GPIODV_17", "GPIODV_18", "GPIODV_19",
  710. "GPIODV_20", "GPIODV_21", "GPIODV_22", "GPIODV_23", "GPIODV_24",
  711. "GPIODV_25", "GPIODV_26", "GPIODV_27", "GPIODV_28", "GPIODV_29",
  712. "GPIOH_0", "GPIOH_1", "GPIOH_2", "GPIOH_3", "GPIOH_4",
  713. "GPIOH_5", "GPIOH_6", "GPIOH_7", "GPIOH_8", "GPIOH_9",
  714. "GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4",
  715. "GPIOZ_5", "GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9",
  716. "GPIOZ_10", "GPIOZ_11", "GPIOZ_12", "GPIOZ_13", "GPIOZ_14",
  717. "CARD_0", "CARD_1", "CARD_2", "CARD_3", "CARD_4",
  718. "CARD_5", "CARD_6",
  719. "BOOT_0", "BOOT_1", "BOOT_2", "BOOT_3", "BOOT_4",
  720. "BOOT_5", "BOOT_6", "BOOT_7", "BOOT_8", "BOOT_9",
  721. "BOOT_10", "BOOT_11", "BOOT_12", "BOOT_13", "BOOT_14",
  722. "BOOT_15", "BOOT_16", "BOOT_17", "BOOT_18",
  723. };
  724. static const char * const gpio_aobus_groups[] = {
  725. "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3",
  726. "GPIOAO_4", "GPIOAO_5", "GPIOAO_6", "GPIOAO_7",
  727. "GPIOAO_8", "GPIOAO_9", "GPIOAO_10", "GPIOAO_11",
  728. "GPIOAO_12", "GPIOAO_13", "GPIO_BSD_EN", "GPIO_TEST_N"
  729. };
  730. static const char * const sd_a_groups[] = {
  731. "sd_d0_a", "sd_d1_a", "sd_d2_a", "sd_d3_a", "sd_clk_a", "sd_cmd_a"
  732. };
  733. static const char * const sdxc_a_groups[] = {
  734. "sdxc_d0_a", "sdxc_d13_a", "sdxc_d47_a", "sdxc_clk_a", "sdxc_cmd_a"
  735. };
  736. static const char * const pcm_a_groups[] = {
  737. "pcm_out_a", "pcm_in_a", "pcm_fs_a", "pcm_clk_a"
  738. };
  739. static const char * const uart_a_groups[] = {
  740. "uart_tx_a0", "uart_rx_a0", "uart_cts_a0", "uart_rts_a0",
  741. "uart_tx_a1", "uart_rx_a1", "uart_cts_a1", "uart_rts_a1"
  742. };
  743. static const char * const uart_b_groups[] = {
  744. "uart_tx_b0", "uart_rx_b0", "uart_cts_b0", "uart_rts_b0",
  745. "uart_tx_b1", "uart_rx_b1", "uart_cts_b1", "uart_rts_b1"
  746. };
  747. static const char * const iso7816_groups[] = {
  748. "iso7816_det", "iso7816_reset", "iso7816_clk", "iso7816_data"
  749. };
  750. static const char * const i2c_d_groups[] = {
  751. "i2c_sda_d0", "i2c_sck_d0", "i2c_sda_d1", "i2c_sck_d1"
  752. };
  753. static const char * const xtal_groups[] = {
  754. "xtal_32k_out", "xtal_24m_out"
  755. };
  756. static const char * const uart_c_groups[] = {
  757. "uart_tx_c", "uart_rx_c", "uart_cts_c", "uart_rts_c"
  758. };
  759. static const char * const pcm_b_groups[] = {
  760. "pcm_out_b", "pcm_in_b", "pcm_fs_b", "pcm_clk_b"
  761. };
  762. static const char * const i2c_c_groups[] = {
  763. "i2c_sda_c0", "i2c_sck_c0", "i2c_sda_c1", "i2c_sck_c1"
  764. };
  765. static const char * const dvin_groups[] = {
  766. "dvin_rgb", "dvin_vs", "dvin_hs", "dvin_clk", "dvin_de"
  767. };
  768. static const char * const enc_groups[] = {
  769. "enc_0", "enc_1", "enc_2", "enc_3", "enc_4", "enc_5",
  770. "enc_6", "enc_7", "enc_8", "enc_9", "enc_10", "enc_11",
  771. "enc_12", "enc_13", "enc_14", "enc_15", "enc_16", "enc_17"
  772. };
  773. static const char * const vga_groups[] = {
  774. "vga_vs", "vga_hs"
  775. };
  776. static const char * const hdmi_groups[] = {
  777. "hdmi_hpd", "hdmi_sda", "hdmi_scl", "hdmi_cec"
  778. };
  779. static const char * const spi_groups[] = {
  780. "spi_ss0_0", "spi_miso_0", "spi_mosi_0", "spi_sclk_0",
  781. "spi_ss0_1", "spi_ss1_1", "spi_sclk_1", "spi_mosi_1",
  782. "spi_miso_1", "spi_ss2_1"
  783. };
  784. static const char * const ethernet_groups[] = {
  785. "eth_tx_clk_50m", "eth_tx_en", "eth_txd1",
  786. "eth_txd0", "eth_rx_clk_in", "eth_rx_dv",
  787. "eth_rxd1", "eth_rxd0", "eth_mdio", "eth_mdc", "eth_rxd2",
  788. "eth_rxd3", "eth_txd2", "eth_txd3"
  789. };
  790. static const char * const i2c_a_groups[] = {
  791. "i2c_sda_a0", "i2c_sck_a0", "i2c_sda_a1", "i2c_sck_a1",
  792. "i2c_sda_a2", "i2c_sck_a2"
  793. };
  794. static const char * const i2c_b_groups[] = {
  795. "i2c_sda_b", "i2c_sck_b"
  796. };
  797. static const char * const i2s_groups[] = {
  798. "i2s_out_ch45", "i2s_out_ch23_pins", "i2s_out_ch01_pins",
  799. "i2s_in_ch01_pins", "i2s_lr_clk_in_pins", "i2s_ao_clk_in_pins",
  800. "i2s_am_clk_pins", "i2s_out_ch78_pins"
  801. };
  802. static const char * const sd_c_groups[] = {
  803. "sd_d0_c", "sd_d1_c", "sd_d2_c", "sd_d3_c",
  804. "sd_cmd_c", "sd_clk_c"
  805. };
  806. static const char * const sdxc_c_groups[] = {
  807. "sdxc_d0_c", "sdxc_d13_c", "sdxc_d47_c", "sdxc_cmd_c",
  808. "sdxc_clk_c"
  809. };
  810. static const char * const nand_groups[] = {
  811. "nand_io", "nand_io_ce0", "nand_io_ce1",
  812. "nand_io_rb0", "nand_ale", "nand_cle",
  813. "nand_wen_clk", "nand_ren_clk", "nand_dqs",
  814. "nand_ce2", "nand_ce3"
  815. };
  816. static const char * const nor_groups[] = {
  817. "nor_d", "nor_q", "nor_c", "nor_cs"
  818. };
  819. static const char * const pwm_a_groups[] = {
  820. "pwm_a_y", "pwm_a_z0", "pwm_a_z7"
  821. };
  822. static const char * const pwm_b_groups[] = {
  823. "pwm_b_x", "pwm_b_z"
  824. };
  825. static const char * const pwm_c_groups[] = {
  826. "pwm_c_dv9", "pwm_c_dv29", "pwm_c_z"
  827. };
  828. static const char * const pwm_d_groups[] = {
  829. "pwm_d"
  830. };
  831. static const char * const pwm_e_groups[] = {
  832. "pwm_e"
  833. };
  834. static const char * const sd_b_groups[] = {
  835. "sd_d1_b", "sd_d0_b", "sd_clk_b", "sd_cmd_b",
  836. "sd_d3_b", "sd_d2_b"
  837. };
  838. static const char * const sdxc_b_groups[] = {
  839. "sdxc_d13_b", "sdxc_d0_b", "sdxc_clk_b", "sdxc_cmd_b"
  840. };
  841. static const char * const spdif_groups[] = {
  842. "spdif_in", "spdif_out"
  843. };
  844. static const char * const uart_ao_groups[] = {
  845. "uart_tx_ao_a", "uart_rx_ao_a", "uart_cts_ao_a", "uart_rts_ao_a"
  846. };
  847. static const char * const remote_groups[] = {
  848. "remote_input", "remote_output_ao"
  849. };
  850. static const char * const i2c_slave_ao_groups[] = {
  851. "i2c_slave_sck_ao", "i2c_slave_sda_ao"
  852. };
  853. static const char * const uart_ao_b_groups[] = {
  854. "uart_tx_ao_b0", "uart_rx_ao_b0", "uart_tx_ao_b1", "uart_rx_ao_b1"
  855. };
  856. static const char * const i2c_mst_ao_groups[] = {
  857. "i2c_mst_sck_ao", "i2c_mst_sda_ao"
  858. };
  859. static const char * const pwm_f_ao_groups[] = {
  860. "pwm_f_ao"
  861. };
  862. static const char * const i2s_ao_groups[] = {
  863. "i2s_am_clk_out_ao", "i2s_ao_clk_out_ao", "i2s_lr_clk_out_ao",
  864. "i2s_out_ch01_ao"
  865. };
  866. static const char * const hdmi_cec_ao_groups[] = {
  867. "hdmi_cec_ao"
  868. };
  869. static struct meson_pmx_func meson8_cbus_functions[] = {
  870. FUNCTION(gpio_periphs),
  871. FUNCTION(sd_a),
  872. FUNCTION(sdxc_a),
  873. FUNCTION(pcm_a),
  874. FUNCTION(uart_a),
  875. FUNCTION(uart_b),
  876. FUNCTION(iso7816),
  877. FUNCTION(i2c_d),
  878. FUNCTION(xtal),
  879. FUNCTION(uart_c),
  880. FUNCTION(pcm_b),
  881. FUNCTION(i2c_c),
  882. FUNCTION(dvin),
  883. FUNCTION(enc),
  884. FUNCTION(vga),
  885. FUNCTION(hdmi),
  886. FUNCTION(spi),
  887. FUNCTION(ethernet),
  888. FUNCTION(i2c_a),
  889. FUNCTION(i2c_b),
  890. FUNCTION(sd_c),
  891. FUNCTION(sdxc_c),
  892. FUNCTION(nand),
  893. FUNCTION(nor),
  894. FUNCTION(sd_b),
  895. FUNCTION(sdxc_b),
  896. FUNCTION(pwm_a),
  897. FUNCTION(pwm_b),
  898. FUNCTION(pwm_c),
  899. FUNCTION(pwm_d),
  900. FUNCTION(pwm_e),
  901. FUNCTION(i2s),
  902. FUNCTION(spdif),
  903. };
  904. static struct meson_pmx_func meson8_aobus_functions[] = {
  905. FUNCTION(gpio_aobus),
  906. FUNCTION(uart_ao),
  907. FUNCTION(remote),
  908. FUNCTION(i2c_slave_ao),
  909. FUNCTION(uart_ao_b),
  910. FUNCTION(i2c_mst_ao),
  911. FUNCTION(pwm_f_ao),
  912. FUNCTION(i2s_ao),
  913. FUNCTION(hdmi_cec_ao),
  914. };
  915. static struct meson_bank meson8_cbus_banks[] = {
  916. /* name first last irq pullen pull dir out in */
  917. BANK("X", GPIOX_0, GPIOX_21, 112, 133, 4, 0, 4, 0, 0, 0, 1, 0, 2, 0),
  918. BANK("Y", GPIOY_0, GPIOY_16, 95, 111, 3, 0, 3, 0, 3, 0, 4, 0, 5, 0),
  919. BANK("DV", GPIODV_0, GPIODV_29, 65, 94, 0, 0, 0, 0, 7, 0, 8, 0, 9, 0),
  920. BANK("H", GPIOH_0, GPIOH_9, 29, 38, 1, 16, 1, 16, 9, 19, 10, 19, 11, 19),
  921. BANK("Z", GPIOZ_0, GPIOZ_14, 14, 28, 1, 0, 1, 0, 3, 17, 4, 17, 5, 17),
  922. BANK("CARD", CARD_0, CARD_6, 58, 64, 2, 20, 2, 20, 0, 22, 1, 22, 2, 22),
  923. BANK("BOOT", BOOT_0, BOOT_18, 39, 57, 2, 0, 2, 0, 9, 0, 10, 0, 11, 0),
  924. };
  925. static struct meson_bank meson8_aobus_banks[] = {
  926. /* name first last irq pullen pull dir out in */
  927. BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
  928. };
  929. static struct meson_pinctrl_data meson8_cbus_pinctrl_data = {
  930. .name = "cbus-banks",
  931. .pins = meson8_cbus_pins,
  932. .groups = meson8_cbus_groups,
  933. .funcs = meson8_cbus_functions,
  934. .banks = meson8_cbus_banks,
  935. .num_pins = ARRAY_SIZE(meson8_cbus_pins),
  936. .num_groups = ARRAY_SIZE(meson8_cbus_groups),
  937. .num_funcs = ARRAY_SIZE(meson8_cbus_functions),
  938. .num_banks = ARRAY_SIZE(meson8_cbus_banks),
  939. .pmx_ops = &meson8_pmx_ops,
  940. };
  941. static struct meson_pinctrl_data meson8_aobus_pinctrl_data = {
  942. .name = "ao-bank",
  943. .pins = meson8_aobus_pins,
  944. .groups = meson8_aobus_groups,
  945. .funcs = meson8_aobus_functions,
  946. .banks = meson8_aobus_banks,
  947. .num_pins = ARRAY_SIZE(meson8_aobus_pins),
  948. .num_groups = ARRAY_SIZE(meson8_aobus_groups),
  949. .num_funcs = ARRAY_SIZE(meson8_aobus_functions),
  950. .num_banks = ARRAY_SIZE(meson8_aobus_banks),
  951. .pmx_ops = &meson8_pmx_ops,
  952. .parse_dt = &meson8_aobus_parse_dt_extra,
  953. };
  954. static const struct of_device_id meson8_pinctrl_dt_match[] = {
  955. {
  956. .compatible = "amlogic,meson8-cbus-pinctrl",
  957. .data = &meson8_cbus_pinctrl_data,
  958. },
  959. {
  960. .compatible = "amlogic,meson8-aobus-pinctrl",
  961. .data = &meson8_aobus_pinctrl_data,
  962. },
  963. {
  964. .compatible = "amlogic,meson8m2-cbus-pinctrl",
  965. .data = &meson8_cbus_pinctrl_data,
  966. },
  967. {
  968. .compatible = "amlogic,meson8m2-aobus-pinctrl",
  969. .data = &meson8_aobus_pinctrl_data,
  970. },
  971. { },
  972. };
  973. static struct platform_driver meson8_pinctrl_driver = {
  974. .probe = meson_pinctrl_probe,
  975. .driver = {
  976. .name = "meson8-pinctrl",
  977. .of_match_table = meson8_pinctrl_dt_match,
  978. },
  979. };
  980. builtin_platform_driver(meson8_pinctrl_driver);