pinctrl-meson-g12a.c 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428
  1. // SPDX-License-Identifier: (GPL-2.0+ or MIT)
  2. /*
  3. * Pin controller and GPIO driver for Amlogic Meson G12A SoC.
  4. *
  5. * Copyright (c) 2018 Amlogic, Inc. All rights reserved.
  6. * Author: Xingyu Chen <[email protected]>
  7. * Author: Yixun Lan <[email protected]>
  8. */
  9. #include <dt-bindings/gpio/meson-g12a-gpio.h>
  10. #include "pinctrl-meson.h"
  11. #include "pinctrl-meson-axg-pmx.h"
  12. static const struct pinctrl_pin_desc meson_g12a_periphs_pins[] = {
  13. MESON_PIN(GPIOZ_0),
  14. MESON_PIN(GPIOZ_1),
  15. MESON_PIN(GPIOZ_2),
  16. MESON_PIN(GPIOZ_3),
  17. MESON_PIN(GPIOZ_4),
  18. MESON_PIN(GPIOZ_5),
  19. MESON_PIN(GPIOZ_6),
  20. MESON_PIN(GPIOZ_7),
  21. MESON_PIN(GPIOZ_8),
  22. MESON_PIN(GPIOZ_9),
  23. MESON_PIN(GPIOZ_10),
  24. MESON_PIN(GPIOZ_11),
  25. MESON_PIN(GPIOZ_12),
  26. MESON_PIN(GPIOZ_13),
  27. MESON_PIN(GPIOZ_14),
  28. MESON_PIN(GPIOZ_15),
  29. MESON_PIN(GPIOH_0),
  30. MESON_PIN(GPIOH_1),
  31. MESON_PIN(GPIOH_2),
  32. MESON_PIN(GPIOH_3),
  33. MESON_PIN(GPIOH_4),
  34. MESON_PIN(GPIOH_5),
  35. MESON_PIN(GPIOH_6),
  36. MESON_PIN(GPIOH_7),
  37. MESON_PIN(GPIOH_8),
  38. MESON_PIN(BOOT_0),
  39. MESON_PIN(BOOT_1),
  40. MESON_PIN(BOOT_2),
  41. MESON_PIN(BOOT_3),
  42. MESON_PIN(BOOT_4),
  43. MESON_PIN(BOOT_5),
  44. MESON_PIN(BOOT_6),
  45. MESON_PIN(BOOT_7),
  46. MESON_PIN(BOOT_8),
  47. MESON_PIN(BOOT_9),
  48. MESON_PIN(BOOT_10),
  49. MESON_PIN(BOOT_11),
  50. MESON_PIN(BOOT_12),
  51. MESON_PIN(BOOT_13),
  52. MESON_PIN(BOOT_14),
  53. MESON_PIN(BOOT_15),
  54. MESON_PIN(GPIOC_0),
  55. MESON_PIN(GPIOC_1),
  56. MESON_PIN(GPIOC_2),
  57. MESON_PIN(GPIOC_3),
  58. MESON_PIN(GPIOC_4),
  59. MESON_PIN(GPIOC_5),
  60. MESON_PIN(GPIOC_6),
  61. MESON_PIN(GPIOC_7),
  62. MESON_PIN(GPIOA_0),
  63. MESON_PIN(GPIOA_1),
  64. MESON_PIN(GPIOA_2),
  65. MESON_PIN(GPIOA_3),
  66. MESON_PIN(GPIOA_4),
  67. MESON_PIN(GPIOA_5),
  68. MESON_PIN(GPIOA_6),
  69. MESON_PIN(GPIOA_7),
  70. MESON_PIN(GPIOA_8),
  71. MESON_PIN(GPIOA_9),
  72. MESON_PIN(GPIOA_10),
  73. MESON_PIN(GPIOA_11),
  74. MESON_PIN(GPIOA_12),
  75. MESON_PIN(GPIOA_13),
  76. MESON_PIN(GPIOA_14),
  77. MESON_PIN(GPIOA_15),
  78. MESON_PIN(GPIOX_0),
  79. MESON_PIN(GPIOX_1),
  80. MESON_PIN(GPIOX_2),
  81. MESON_PIN(GPIOX_3),
  82. MESON_PIN(GPIOX_4),
  83. MESON_PIN(GPIOX_5),
  84. MESON_PIN(GPIOX_6),
  85. MESON_PIN(GPIOX_7),
  86. MESON_PIN(GPIOX_8),
  87. MESON_PIN(GPIOX_9),
  88. MESON_PIN(GPIOX_10),
  89. MESON_PIN(GPIOX_11),
  90. MESON_PIN(GPIOX_12),
  91. MESON_PIN(GPIOX_13),
  92. MESON_PIN(GPIOX_14),
  93. MESON_PIN(GPIOX_15),
  94. MESON_PIN(GPIOX_16),
  95. MESON_PIN(GPIOX_17),
  96. MESON_PIN(GPIOX_18),
  97. MESON_PIN(GPIOX_19),
  98. };
  99. static const struct pinctrl_pin_desc meson_g12a_aobus_pins[] = {
  100. MESON_PIN(GPIOAO_0),
  101. MESON_PIN(GPIOAO_1),
  102. MESON_PIN(GPIOAO_2),
  103. MESON_PIN(GPIOAO_3),
  104. MESON_PIN(GPIOAO_4),
  105. MESON_PIN(GPIOAO_5),
  106. MESON_PIN(GPIOAO_6),
  107. MESON_PIN(GPIOAO_7),
  108. MESON_PIN(GPIOAO_8),
  109. MESON_PIN(GPIOAO_9),
  110. MESON_PIN(GPIOAO_10),
  111. MESON_PIN(GPIOAO_11),
  112. MESON_PIN(GPIOE_0),
  113. MESON_PIN(GPIOE_1),
  114. MESON_PIN(GPIOE_2),
  115. };
  116. /* emmc */
  117. static const unsigned int emmc_nand_d0_pins[] = { BOOT_0 };
  118. static const unsigned int emmc_nand_d1_pins[] = { BOOT_1 };
  119. static const unsigned int emmc_nand_d2_pins[] = { BOOT_2 };
  120. static const unsigned int emmc_nand_d3_pins[] = { BOOT_3 };
  121. static const unsigned int emmc_nand_d4_pins[] = { BOOT_4 };
  122. static const unsigned int emmc_nand_d5_pins[] = { BOOT_5 };
  123. static const unsigned int emmc_nand_d6_pins[] = { BOOT_6 };
  124. static const unsigned int emmc_nand_d7_pins[] = { BOOT_7 };
  125. static const unsigned int emmc_clk_pins[] = { BOOT_8 };
  126. static const unsigned int emmc_cmd_pins[] = { BOOT_10 };
  127. static const unsigned int emmc_nand_ds_pins[] = { BOOT_13 };
  128. /* nand */
  129. static const unsigned int nand_wen_clk_pins[] = { BOOT_8 };
  130. static const unsigned int nand_ale_pins[] = { BOOT_9 };
  131. static const unsigned int nand_cle_pins[] = { BOOT_10 };
  132. static const unsigned int nand_ce0_pins[] = { BOOT_11 };
  133. static const unsigned int nand_ren_wr_pins[] = { BOOT_12 };
  134. static const unsigned int nand_rb0_pins[] = { BOOT_14 };
  135. static const unsigned int nand_ce1_pins[] = { BOOT_15 };
  136. /* nor */
  137. static const unsigned int nor_hold_pins[] = { BOOT_3 };
  138. static const unsigned int nor_d_pins[] = { BOOT_4 };
  139. static const unsigned int nor_q_pins[] = { BOOT_5 };
  140. static const unsigned int nor_c_pins[] = { BOOT_6 };
  141. static const unsigned int nor_wp_pins[] = { BOOT_7 };
  142. static const unsigned int nor_cs_pins[] = { BOOT_14 };
  143. /* sdio */
  144. static const unsigned int sdio_d0_pins[] = { GPIOX_0 };
  145. static const unsigned int sdio_d1_pins[] = { GPIOX_1 };
  146. static const unsigned int sdio_d2_pins[] = { GPIOX_2 };
  147. static const unsigned int sdio_d3_pins[] = { GPIOX_3 };
  148. static const unsigned int sdio_clk_pins[] = { GPIOX_4 };
  149. static const unsigned int sdio_cmd_pins[] = { GPIOX_5 };
  150. /* sdcard */
  151. static const unsigned int sdcard_d0_c_pins[] = { GPIOC_0 };
  152. static const unsigned int sdcard_d1_c_pins[] = { GPIOC_1 };
  153. static const unsigned int sdcard_d2_c_pins[] = { GPIOC_2 };
  154. static const unsigned int sdcard_d3_c_pins[] = { GPIOC_3 };
  155. static const unsigned int sdcard_clk_c_pins[] = { GPIOC_4 };
  156. static const unsigned int sdcard_cmd_c_pins[] = { GPIOC_5 };
  157. static const unsigned int sdcard_d0_z_pins[] = { GPIOZ_2 };
  158. static const unsigned int sdcard_d1_z_pins[] = { GPIOZ_3 };
  159. static const unsigned int sdcard_d2_z_pins[] = { GPIOZ_4 };
  160. static const unsigned int sdcard_d3_z_pins[] = { GPIOZ_5 };
  161. static const unsigned int sdcard_clk_z_pins[] = { GPIOZ_6 };
  162. static const unsigned int sdcard_cmd_z_pins[] = { GPIOZ_7 };
  163. /* spi0 */
  164. static const unsigned int spi0_mosi_c_pins[] = { GPIOC_0 };
  165. static const unsigned int spi0_miso_c_pins[] = { GPIOC_1 };
  166. static const unsigned int spi0_ss0_c_pins[] = { GPIOC_2 };
  167. static const unsigned int spi0_clk_c_pins[] = { GPIOC_3 };
  168. static const unsigned int spi0_mosi_x_pins[] = { GPIOX_8 };
  169. static const unsigned int spi0_miso_x_pins[] = { GPIOX_9 };
  170. static const unsigned int spi0_ss0_x_pins[] = { GPIOX_10 };
  171. static const unsigned int spi0_clk_x_pins[] = { GPIOX_11 };
  172. /* spi1 */
  173. static const unsigned int spi1_mosi_pins[] = { GPIOH_4 };
  174. static const unsigned int spi1_miso_pins[] = { GPIOH_5 };
  175. static const unsigned int spi1_ss0_pins[] = { GPIOH_6 };
  176. static const unsigned int spi1_clk_pins[] = { GPIOH_7 };
  177. /* i2c0 */
  178. static const unsigned int i2c0_sda_c_pins[] = { GPIOC_5 };
  179. static const unsigned int i2c0_sck_c_pins[] = { GPIOC_6 };
  180. static const unsigned int i2c0_sda_z0_pins[] = { GPIOZ_0 };
  181. static const unsigned int i2c0_sck_z1_pins[] = { GPIOZ_1 };
  182. static const unsigned int i2c0_sda_z7_pins[] = { GPIOZ_7 };
  183. static const unsigned int i2c0_sck_z8_pins[] = { GPIOZ_8 };
  184. /* i2c1 */
  185. static const unsigned int i2c1_sda_x_pins[] = { GPIOX_10 };
  186. static const unsigned int i2c1_sck_x_pins[] = { GPIOX_11 };
  187. static const unsigned int i2c1_sda_h2_pins[] = { GPIOH_2 };
  188. static const unsigned int i2c1_sck_h3_pins[] = { GPIOH_3 };
  189. static const unsigned int i2c1_sda_h6_pins[] = { GPIOH_6 };
  190. static const unsigned int i2c1_sck_h7_pins[] = { GPIOH_7 };
  191. /* i2c2 */
  192. static const unsigned int i2c2_sda_x_pins[] = { GPIOX_17 };
  193. static const unsigned int i2c2_sck_x_pins[] = { GPIOX_18 };
  194. static const unsigned int i2c2_sda_z_pins[] = { GPIOZ_14 };
  195. static const unsigned int i2c2_sck_z_pins[] = { GPIOZ_15 };
  196. /* i2c3 */
  197. static const unsigned int i2c3_sda_h_pins[] = { GPIOH_0 };
  198. static const unsigned int i2c3_sck_h_pins[] = { GPIOH_1 };
  199. static const unsigned int i2c3_sda_a_pins[] = { GPIOA_14 };
  200. static const unsigned int i2c3_sck_a_pins[] = { GPIOA_15 };
  201. /* uart_a */
  202. static const unsigned int uart_a_tx_pins[] = { GPIOX_12 };
  203. static const unsigned int uart_a_rx_pins[] = { GPIOX_13 };
  204. static const unsigned int uart_a_cts_pins[] = { GPIOX_14 };
  205. static const unsigned int uart_a_rts_pins[] = { GPIOX_15 };
  206. /* uart_b */
  207. static const unsigned int uart_b_tx_pins[] = { GPIOX_6 };
  208. static const unsigned int uart_b_rx_pins[] = { GPIOX_7 };
  209. /* uart_c */
  210. static const unsigned int uart_c_rts_pins[] = { GPIOH_4 };
  211. static const unsigned int uart_c_cts_pins[] = { GPIOH_5 };
  212. static const unsigned int uart_c_rx_pins[] = { GPIOH_6 };
  213. static const unsigned int uart_c_tx_pins[] = { GPIOH_7 };
  214. /* uart_ao_a_c */
  215. static const unsigned int uart_ao_a_rx_c_pins[] = { GPIOC_2 };
  216. static const unsigned int uart_ao_a_tx_c_pins[] = { GPIOC_3 };
  217. /* iso7816 */
  218. static const unsigned int iso7816_clk_c_pins[] = { GPIOC_5 };
  219. static const unsigned int iso7816_data_c_pins[] = { GPIOC_6 };
  220. static const unsigned int iso7816_clk_x_pins[] = { GPIOX_8 };
  221. static const unsigned int iso7816_data_x_pins[] = { GPIOX_9 };
  222. static const unsigned int iso7816_clk_h_pins[] = { GPIOH_6 };
  223. static const unsigned int iso7816_data_h_pins[] = { GPIOH_7 };
  224. static const unsigned int iso7816_clk_z_pins[] = { GPIOZ_0 };
  225. static const unsigned int iso7816_data_z_pins[] = { GPIOZ_1 };
  226. /* eth */
  227. static const unsigned int eth_mdio_pins[] = { GPIOZ_0 };
  228. static const unsigned int eth_mdc_pins[] = { GPIOZ_1 };
  229. static const unsigned int eth_rgmii_rx_clk_pins[] = { GPIOZ_2 };
  230. static const unsigned int eth_rx_dv_pins[] = { GPIOZ_3 };
  231. static const unsigned int eth_rxd0_pins[] = { GPIOZ_4 };
  232. static const unsigned int eth_rxd1_pins[] = { GPIOZ_5 };
  233. static const unsigned int eth_rxd2_rgmii_pins[] = { GPIOZ_6 };
  234. static const unsigned int eth_rxd3_rgmii_pins[] = { GPIOZ_7 };
  235. static const unsigned int eth_rgmii_tx_clk_pins[] = { GPIOZ_8 };
  236. static const unsigned int eth_txen_pins[] = { GPIOZ_9 };
  237. static const unsigned int eth_txd0_pins[] = { GPIOZ_10 };
  238. static const unsigned int eth_txd1_pins[] = { GPIOZ_11 };
  239. static const unsigned int eth_txd2_rgmii_pins[] = { GPIOZ_12 };
  240. static const unsigned int eth_txd3_rgmii_pins[] = { GPIOZ_13 };
  241. static const unsigned int eth_link_led_pins[] = { GPIOZ_14 };
  242. static const unsigned int eth_act_led_pins[] = { GPIOZ_15 };
  243. /* pwm_a */
  244. static const unsigned int pwm_a_pins[] = { GPIOX_6 };
  245. /* pwm_b */
  246. static const unsigned int pwm_b_x7_pins[] = { GPIOX_7 };
  247. static const unsigned int pwm_b_x19_pins[] = { GPIOX_19 };
  248. /* pwm_c */
  249. static const unsigned int pwm_c_c_pins[] = { GPIOC_4 };
  250. static const unsigned int pwm_c_x5_pins[] = { GPIOX_5 };
  251. static const unsigned int pwm_c_x8_pins[] = { GPIOX_8 };
  252. /* pwm_d */
  253. static const unsigned int pwm_d_x3_pins[] = { GPIOX_3 };
  254. static const unsigned int pwm_d_x6_pins[] = { GPIOX_6 };
  255. /* pwm_e */
  256. static const unsigned int pwm_e_pins[] = { GPIOX_16 };
  257. /* pwm_f */
  258. static const unsigned int pwm_f_z_pins[] = { GPIOZ_12 };
  259. static const unsigned int pwm_f_a_pins[] = { GPIOA_11 };
  260. static const unsigned int pwm_f_x_pins[] = { GPIOX_7 };
  261. static const unsigned int pwm_f_h_pins[] = { GPIOH_5 };
  262. /* cec_ao */
  263. static const unsigned int cec_ao_a_h_pins[] = { GPIOH_3 };
  264. static const unsigned int cec_ao_b_h_pins[] = { GPIOH_3 };
  265. /* jtag_b */
  266. static const unsigned int jtag_b_tdo_pins[] = { GPIOC_0 };
  267. static const unsigned int jtag_b_tdi_pins[] = { GPIOC_1 };
  268. static const unsigned int jtag_b_clk_pins[] = { GPIOC_4 };
  269. static const unsigned int jtag_b_tms_pins[] = { GPIOC_5 };
  270. /* bt565_a */
  271. static const unsigned int bt565_a_vs_pins[] = { GPIOZ_0 };
  272. static const unsigned int bt565_a_hs_pins[] = { GPIOZ_1 };
  273. static const unsigned int bt565_a_clk_pins[] = { GPIOZ_3 };
  274. static const unsigned int bt565_a_din0_pins[] = { GPIOZ_4 };
  275. static const unsigned int bt565_a_din1_pins[] = { GPIOZ_5 };
  276. static const unsigned int bt565_a_din2_pins[] = { GPIOZ_6 };
  277. static const unsigned int bt565_a_din3_pins[] = { GPIOZ_7 };
  278. static const unsigned int bt565_a_din4_pins[] = { GPIOZ_8 };
  279. static const unsigned int bt565_a_din5_pins[] = { GPIOZ_9 };
  280. static const unsigned int bt565_a_din6_pins[] = { GPIOZ_10 };
  281. static const unsigned int bt565_a_din7_pins[] = { GPIOZ_11 };
  282. /* tsin_a */
  283. static const unsigned int tsin_a_valid_pins[] = { GPIOX_2 };
  284. static const unsigned int tsin_a_sop_pins[] = { GPIOX_1 };
  285. static const unsigned int tsin_a_din0_pins[] = { GPIOX_0 };
  286. static const unsigned int tsin_a_clk_pins[] = { GPIOX_3 };
  287. /* tsin_b */
  288. static const unsigned int tsin_b_valid_x_pins[] = { GPIOX_9 };
  289. static const unsigned int tsin_b_sop_x_pins[] = { GPIOX_8 };
  290. static const unsigned int tsin_b_din0_x_pins[] = { GPIOX_10 };
  291. static const unsigned int tsin_b_clk_x_pins[] = { GPIOX_11 };
  292. static const unsigned int tsin_b_valid_z_pins[] = { GPIOZ_2 };
  293. static const unsigned int tsin_b_sop_z_pins[] = { GPIOZ_3 };
  294. static const unsigned int tsin_b_din0_z_pins[] = { GPIOZ_4 };
  295. static const unsigned int tsin_b_clk_z_pins[] = { GPIOZ_5 };
  296. static const unsigned int tsin_b_fail_pins[] = { GPIOZ_6 };
  297. static const unsigned int tsin_b_din1_pins[] = { GPIOZ_7 };
  298. static const unsigned int tsin_b_din2_pins[] = { GPIOZ_8 };
  299. static const unsigned int tsin_b_din3_pins[] = { GPIOZ_9 };
  300. static const unsigned int tsin_b_din4_pins[] = { GPIOZ_10 };
  301. static const unsigned int tsin_b_din5_pins[] = { GPIOZ_11 };
  302. static const unsigned int tsin_b_din6_pins[] = { GPIOZ_12 };
  303. static const unsigned int tsin_b_din7_pins[] = { GPIOZ_13 };
  304. /* hdmitx */
  305. static const unsigned int hdmitx_sda_pins[] = { GPIOH_0 };
  306. static const unsigned int hdmitx_sck_pins[] = { GPIOH_1 };
  307. static const unsigned int hdmitx_hpd_in_pins[] = { GPIOH_2 };
  308. /* pdm */
  309. static const unsigned int pdm_din0_c_pins[] = { GPIOC_0 };
  310. static const unsigned int pdm_din1_c_pins[] = { GPIOC_1 };
  311. static const unsigned int pdm_din2_c_pins[] = { GPIOC_2 };
  312. static const unsigned int pdm_din3_c_pins[] = { GPIOC_3 };
  313. static const unsigned int pdm_dclk_c_pins[] = { GPIOC_4 };
  314. static const unsigned int pdm_din0_x_pins[] = { GPIOX_0 };
  315. static const unsigned int pdm_din1_x_pins[] = { GPIOX_1 };
  316. static const unsigned int pdm_din2_x_pins[] = { GPIOX_2 };
  317. static const unsigned int pdm_din3_x_pins[] = { GPIOX_3 };
  318. static const unsigned int pdm_dclk_x_pins[] = { GPIOX_4 };
  319. static const unsigned int pdm_din0_z_pins[] = { GPIOZ_2 };
  320. static const unsigned int pdm_din1_z_pins[] = { GPIOZ_3 };
  321. static const unsigned int pdm_din2_z_pins[] = { GPIOZ_4 };
  322. static const unsigned int pdm_din3_z_pins[] = { GPIOZ_5 };
  323. static const unsigned int pdm_dclk_z_pins[] = { GPIOZ_6 };
  324. static const unsigned int pdm_din0_a_pins[] = { GPIOA_8 };
  325. static const unsigned int pdm_din1_a_pins[] = { GPIOA_9 };
  326. static const unsigned int pdm_din2_a_pins[] = { GPIOA_6 };
  327. static const unsigned int pdm_din3_a_pins[] = { GPIOA_5 };
  328. static const unsigned int pdm_dclk_a_pins[] = { GPIOA_7 };
  329. /* spdif_in */
  330. static const unsigned int spdif_in_h_pins[] = { GPIOH_5 };
  331. static const unsigned int spdif_in_a10_pins[] = { GPIOA_10 };
  332. static const unsigned int spdif_in_a12_pins[] = { GPIOA_12 };
  333. /* spdif_out */
  334. static const unsigned int spdif_out_h_pins[] = { GPIOH_4 };
  335. static const unsigned int spdif_out_a11_pins[] = { GPIOA_11 };
  336. static const unsigned int spdif_out_a13_pins[] = { GPIOA_13 };
  337. /* mclk0 */
  338. static const unsigned int mclk0_a_pins[] = { GPIOA_0 };
  339. /* mclk1 */
  340. static const unsigned int mclk1_x_pins[] = { GPIOX_5 };
  341. static const unsigned int mclk1_z_pins[] = { GPIOZ_8 };
  342. static const unsigned int mclk1_a_pins[] = { GPIOA_11 };
  343. /* tdm */
  344. static const unsigned int tdm_a_slv_sclk_pins[] = { GPIOX_11 };
  345. static const unsigned int tdm_a_slv_fs_pins[] = { GPIOX_10 };
  346. static const unsigned int tdm_a_sclk_pins[] = { GPIOX_11 };
  347. static const unsigned int tdm_a_fs_pins[] = { GPIOX_10 };
  348. static const unsigned int tdm_a_din0_pins[] = { GPIOX_9 };
  349. static const unsigned int tdm_a_din1_pins[] = { GPIOX_8 };
  350. static const unsigned int tdm_a_dout0_pins[] = { GPIOX_9 };
  351. static const unsigned int tdm_a_dout1_pins[] = { GPIOX_8 };
  352. static const unsigned int tdm_b_slv_sclk_pins[] = { GPIOA_1 };
  353. static const unsigned int tdm_b_slv_fs_pins[] = { GPIOA_2 };
  354. static const unsigned int tdm_b_sclk_pins[] = { GPIOA_1 };
  355. static const unsigned int tdm_b_fs_pins[] = { GPIOA_2 };
  356. static const unsigned int tdm_b_din0_pins[] = { GPIOA_3 };
  357. static const unsigned int tdm_b_din1_pins[] = { GPIOA_4 };
  358. static const unsigned int tdm_b_din2_pins[] = { GPIOA_5 };
  359. static const unsigned int tdm_b_din3_a_pins[] = { GPIOA_6 };
  360. static const unsigned int tdm_b_din3_h_pins[] = { GPIOH_5 };
  361. static const unsigned int tdm_b_dout0_pins[] = { GPIOA_3 };
  362. static const unsigned int tdm_b_dout1_pins[] = { GPIOA_4 };
  363. static const unsigned int tdm_b_dout2_pins[] = { GPIOA_5 };
  364. static const unsigned int tdm_b_dout3_a_pins[] = { GPIOA_6 };
  365. static const unsigned int tdm_b_dout3_h_pins[] = { GPIOH_5 };
  366. static const unsigned int tdm_c_slv_sclk_a_pins[] = { GPIOA_12 };
  367. static const unsigned int tdm_c_slv_fs_a_pins[] = { GPIOA_13 };
  368. static const unsigned int tdm_c_slv_sclk_z_pins[] = { GPIOZ_7 };
  369. static const unsigned int tdm_c_slv_fs_z_pins[] = { GPIOZ_6 };
  370. static const unsigned int tdm_c_sclk_a_pins[] = { GPIOA_12 };
  371. static const unsigned int tdm_c_fs_a_pins[] = { GPIOA_13 };
  372. static const unsigned int tdm_c_sclk_z_pins[] = { GPIOZ_7 };
  373. static const unsigned int tdm_c_fs_z_pins[] = { GPIOZ_6 };
  374. static const unsigned int tdm_c_din0_a_pins[] = { GPIOA_10 };
  375. static const unsigned int tdm_c_din1_a_pins[] = { GPIOA_9 };
  376. static const unsigned int tdm_c_din2_a_pins[] = { GPIOA_8 };
  377. static const unsigned int tdm_c_din3_a_pins[] = { GPIOA_7 };
  378. static const unsigned int tdm_c_din0_z_pins[] = { GPIOZ_2 };
  379. static const unsigned int tdm_c_din1_z_pins[] = { GPIOZ_3 };
  380. static const unsigned int tdm_c_din2_z_pins[] = { GPIOZ_4 };
  381. static const unsigned int tdm_c_din3_z_pins[] = { GPIOZ_5 };
  382. static const unsigned int tdm_c_dout0_a_pins[] = { GPIOA_10 };
  383. static const unsigned int tdm_c_dout1_a_pins[] = { GPIOA_9 };
  384. static const unsigned int tdm_c_dout2_a_pins[] = { GPIOA_8 };
  385. static const unsigned int tdm_c_dout3_a_pins[] = { GPIOA_7 };
  386. static const unsigned int tdm_c_dout0_z_pins[] = { GPIOZ_2 };
  387. static const unsigned int tdm_c_dout1_z_pins[] = { GPIOZ_3 };
  388. static const unsigned int tdm_c_dout2_z_pins[] = { GPIOZ_4 };
  389. static const unsigned int tdm_c_dout3_z_pins[] = { GPIOZ_5 };
  390. static struct meson_pmx_group meson_g12a_periphs_groups[] = {
  391. GPIO_GROUP(GPIOZ_0),
  392. GPIO_GROUP(GPIOZ_1),
  393. GPIO_GROUP(GPIOZ_2),
  394. GPIO_GROUP(GPIOZ_3),
  395. GPIO_GROUP(GPIOZ_4),
  396. GPIO_GROUP(GPIOZ_5),
  397. GPIO_GROUP(GPIOZ_6),
  398. GPIO_GROUP(GPIOZ_7),
  399. GPIO_GROUP(GPIOZ_8),
  400. GPIO_GROUP(GPIOZ_9),
  401. GPIO_GROUP(GPIOZ_10),
  402. GPIO_GROUP(GPIOZ_11),
  403. GPIO_GROUP(GPIOZ_12),
  404. GPIO_GROUP(GPIOZ_13),
  405. GPIO_GROUP(GPIOZ_14),
  406. GPIO_GROUP(GPIOZ_15),
  407. GPIO_GROUP(GPIOH_0),
  408. GPIO_GROUP(GPIOH_1),
  409. GPIO_GROUP(GPIOH_2),
  410. GPIO_GROUP(GPIOH_3),
  411. GPIO_GROUP(GPIOH_4),
  412. GPIO_GROUP(GPIOH_5),
  413. GPIO_GROUP(GPIOH_6),
  414. GPIO_GROUP(GPIOH_7),
  415. GPIO_GROUP(GPIOH_8),
  416. GPIO_GROUP(BOOT_0),
  417. GPIO_GROUP(BOOT_1),
  418. GPIO_GROUP(BOOT_2),
  419. GPIO_GROUP(BOOT_3),
  420. GPIO_GROUP(BOOT_4),
  421. GPIO_GROUP(BOOT_5),
  422. GPIO_GROUP(BOOT_6),
  423. GPIO_GROUP(BOOT_7),
  424. GPIO_GROUP(BOOT_8),
  425. GPIO_GROUP(BOOT_9),
  426. GPIO_GROUP(BOOT_10),
  427. GPIO_GROUP(BOOT_11),
  428. GPIO_GROUP(BOOT_12),
  429. GPIO_GROUP(BOOT_13),
  430. GPIO_GROUP(BOOT_14),
  431. GPIO_GROUP(BOOT_15),
  432. GPIO_GROUP(GPIOC_0),
  433. GPIO_GROUP(GPIOC_1),
  434. GPIO_GROUP(GPIOC_2),
  435. GPIO_GROUP(GPIOC_3),
  436. GPIO_GROUP(GPIOC_4),
  437. GPIO_GROUP(GPIOC_5),
  438. GPIO_GROUP(GPIOC_6),
  439. GPIO_GROUP(GPIOC_7),
  440. GPIO_GROUP(GPIOA_0),
  441. GPIO_GROUP(GPIOA_1),
  442. GPIO_GROUP(GPIOA_2),
  443. GPIO_GROUP(GPIOA_3),
  444. GPIO_GROUP(GPIOA_4),
  445. GPIO_GROUP(GPIOA_5),
  446. GPIO_GROUP(GPIOA_6),
  447. GPIO_GROUP(GPIOA_7),
  448. GPIO_GROUP(GPIOA_8),
  449. GPIO_GROUP(GPIOA_9),
  450. GPIO_GROUP(GPIOA_10),
  451. GPIO_GROUP(GPIOA_11),
  452. GPIO_GROUP(GPIOA_12),
  453. GPIO_GROUP(GPIOA_13),
  454. GPIO_GROUP(GPIOA_14),
  455. GPIO_GROUP(GPIOA_15),
  456. GPIO_GROUP(GPIOX_0),
  457. GPIO_GROUP(GPIOX_1),
  458. GPIO_GROUP(GPIOX_2),
  459. GPIO_GROUP(GPIOX_3),
  460. GPIO_GROUP(GPIOX_4),
  461. GPIO_GROUP(GPIOX_5),
  462. GPIO_GROUP(GPIOX_6),
  463. GPIO_GROUP(GPIOX_7),
  464. GPIO_GROUP(GPIOX_8),
  465. GPIO_GROUP(GPIOX_9),
  466. GPIO_GROUP(GPIOX_10),
  467. GPIO_GROUP(GPIOX_11),
  468. GPIO_GROUP(GPIOX_12),
  469. GPIO_GROUP(GPIOX_13),
  470. GPIO_GROUP(GPIOX_14),
  471. GPIO_GROUP(GPIOX_15),
  472. GPIO_GROUP(GPIOX_16),
  473. GPIO_GROUP(GPIOX_17),
  474. GPIO_GROUP(GPIOX_18),
  475. GPIO_GROUP(GPIOX_19),
  476. /* bank BOOT */
  477. GROUP(emmc_nand_d0, 1),
  478. GROUP(emmc_nand_d1, 1),
  479. GROUP(emmc_nand_d2, 1),
  480. GROUP(emmc_nand_d3, 1),
  481. GROUP(emmc_nand_d4, 1),
  482. GROUP(emmc_nand_d5, 1),
  483. GROUP(emmc_nand_d6, 1),
  484. GROUP(emmc_nand_d7, 1),
  485. GROUP(emmc_clk, 1),
  486. GROUP(emmc_cmd, 1),
  487. GROUP(emmc_nand_ds, 1),
  488. GROUP(nand_ce0, 2),
  489. GROUP(nand_ale, 2),
  490. GROUP(nand_cle, 2),
  491. GROUP(nand_wen_clk, 2),
  492. GROUP(nand_ren_wr, 2),
  493. GROUP(nand_rb0, 2),
  494. GROUP(nand_ce1, 2),
  495. GROUP(nor_hold, 3),
  496. GROUP(nor_d, 3),
  497. GROUP(nor_q, 3),
  498. GROUP(nor_c, 3),
  499. GROUP(nor_wp, 3),
  500. GROUP(nor_cs, 3),
  501. /* bank GPIOZ */
  502. GROUP(sdcard_d0_z, 5),
  503. GROUP(sdcard_d1_z, 5),
  504. GROUP(sdcard_d2_z, 5),
  505. GROUP(sdcard_d3_z, 5),
  506. GROUP(sdcard_clk_z, 5),
  507. GROUP(sdcard_cmd_z, 5),
  508. GROUP(i2c0_sda_z0, 4),
  509. GROUP(i2c0_sck_z1, 4),
  510. GROUP(i2c0_sda_z7, 7),
  511. GROUP(i2c0_sck_z8, 7),
  512. GROUP(i2c2_sda_z, 3),
  513. GROUP(i2c2_sck_z, 3),
  514. GROUP(iso7816_clk_z, 3),
  515. GROUP(iso7816_data_z, 3),
  516. GROUP(eth_mdio, 1),
  517. GROUP(eth_mdc, 1),
  518. GROUP(eth_rgmii_rx_clk, 1),
  519. GROUP(eth_rx_dv, 1),
  520. GROUP(eth_rxd0, 1),
  521. GROUP(eth_rxd1, 1),
  522. GROUP(eth_rxd2_rgmii, 1),
  523. GROUP(eth_rxd3_rgmii, 1),
  524. GROUP(eth_rgmii_tx_clk, 1),
  525. GROUP(eth_txen, 1),
  526. GROUP(eth_txd0, 1),
  527. GROUP(eth_txd1, 1),
  528. GROUP(eth_txd2_rgmii, 1),
  529. GROUP(eth_txd3_rgmii, 1),
  530. GROUP(eth_link_led, 1),
  531. GROUP(eth_act_led, 1),
  532. GROUP(bt565_a_vs, 2),
  533. GROUP(bt565_a_hs, 2),
  534. GROUP(bt565_a_clk, 2),
  535. GROUP(bt565_a_din0, 2),
  536. GROUP(bt565_a_din1, 2),
  537. GROUP(bt565_a_din2, 2),
  538. GROUP(bt565_a_din3, 2),
  539. GROUP(bt565_a_din4, 2),
  540. GROUP(bt565_a_din5, 2),
  541. GROUP(bt565_a_din6, 2),
  542. GROUP(bt565_a_din7, 2),
  543. GROUP(tsin_b_valid_z, 3),
  544. GROUP(tsin_b_sop_z, 3),
  545. GROUP(tsin_b_din0_z, 3),
  546. GROUP(tsin_b_clk_z, 3),
  547. GROUP(tsin_b_fail, 3),
  548. GROUP(tsin_b_din1, 3),
  549. GROUP(tsin_b_din2, 3),
  550. GROUP(tsin_b_din3, 3),
  551. GROUP(tsin_b_din4, 3),
  552. GROUP(tsin_b_din5, 3),
  553. GROUP(tsin_b_din6, 3),
  554. GROUP(tsin_b_din7, 3),
  555. GROUP(pdm_din0_z, 7),
  556. GROUP(pdm_din1_z, 7),
  557. GROUP(pdm_din2_z, 7),
  558. GROUP(pdm_din3_z, 7),
  559. GROUP(pdm_dclk_z, 7),
  560. GROUP(tdm_c_slv_sclk_z, 6),
  561. GROUP(tdm_c_slv_fs_z, 6),
  562. GROUP(tdm_c_din0_z, 6),
  563. GROUP(tdm_c_din1_z, 6),
  564. GROUP(tdm_c_din2_z, 6),
  565. GROUP(tdm_c_din3_z, 6),
  566. GROUP(tdm_c_sclk_z, 4),
  567. GROUP(tdm_c_fs_z, 4),
  568. GROUP(tdm_c_dout0_z, 4),
  569. GROUP(tdm_c_dout1_z, 4),
  570. GROUP(tdm_c_dout2_z, 4),
  571. GROUP(tdm_c_dout3_z, 4),
  572. GROUP(mclk1_z, 4),
  573. GROUP(pwm_f_z, 5),
  574. /* bank GPIOX */
  575. GROUP(sdio_d0, 1),
  576. GROUP(sdio_d1, 1),
  577. GROUP(sdio_d2, 1),
  578. GROUP(sdio_d3, 1),
  579. GROUP(sdio_clk, 1),
  580. GROUP(sdio_cmd, 1),
  581. GROUP(spi0_mosi_x, 4),
  582. GROUP(spi0_miso_x, 4),
  583. GROUP(spi0_ss0_x, 4),
  584. GROUP(spi0_clk_x, 4),
  585. GROUP(i2c1_sda_x, 5),
  586. GROUP(i2c1_sck_x, 5),
  587. GROUP(i2c2_sda_x, 1),
  588. GROUP(i2c2_sck_x, 1),
  589. GROUP(uart_a_tx, 1),
  590. GROUP(uart_a_rx, 1),
  591. GROUP(uart_a_cts, 1),
  592. GROUP(uart_a_rts, 1),
  593. GROUP(uart_b_tx, 2),
  594. GROUP(uart_b_rx, 2),
  595. GROUP(iso7816_clk_x, 6),
  596. GROUP(iso7816_data_x, 6),
  597. GROUP(pwm_a, 1),
  598. GROUP(pwm_b_x7, 4),
  599. GROUP(pwm_b_x19, 1),
  600. GROUP(pwm_c_x5, 4),
  601. GROUP(pwm_c_x8, 5),
  602. GROUP(pwm_d_x3, 4),
  603. GROUP(pwm_d_x6, 4),
  604. GROUP(pwm_e, 1),
  605. GROUP(pwm_f_x, 1),
  606. GROUP(tsin_a_valid, 3),
  607. GROUP(tsin_a_sop, 3),
  608. GROUP(tsin_a_din0, 3),
  609. GROUP(tsin_a_clk, 3),
  610. GROUP(tsin_b_valid_x, 3),
  611. GROUP(tsin_b_sop_x, 3),
  612. GROUP(tsin_b_din0_x, 3),
  613. GROUP(tsin_b_clk_x, 3),
  614. GROUP(pdm_din0_x, 2),
  615. GROUP(pdm_din1_x, 2),
  616. GROUP(pdm_din2_x, 2),
  617. GROUP(pdm_din3_x, 2),
  618. GROUP(pdm_dclk_x, 2),
  619. GROUP(tdm_a_slv_sclk, 2),
  620. GROUP(tdm_a_slv_fs, 2),
  621. GROUP(tdm_a_din0, 2),
  622. GROUP(tdm_a_din1, 2),
  623. GROUP(tdm_a_sclk, 1),
  624. GROUP(tdm_a_fs, 1),
  625. GROUP(tdm_a_dout0, 1),
  626. GROUP(tdm_a_dout1, 1),
  627. GROUP(mclk1_x, 2),
  628. /* bank GPIOC */
  629. GROUP(sdcard_d0_c, 1),
  630. GROUP(sdcard_d1_c, 1),
  631. GROUP(sdcard_d2_c, 1),
  632. GROUP(sdcard_d3_c, 1),
  633. GROUP(sdcard_clk_c, 1),
  634. GROUP(sdcard_cmd_c, 1),
  635. GROUP(spi0_mosi_c, 5),
  636. GROUP(spi0_miso_c, 5),
  637. GROUP(spi0_ss0_c, 5),
  638. GROUP(spi0_clk_c, 5),
  639. GROUP(i2c0_sda_c, 3),
  640. GROUP(i2c0_sck_c, 3),
  641. GROUP(uart_ao_a_rx_c, 2),
  642. GROUP(uart_ao_a_tx_c, 2),
  643. GROUP(iso7816_clk_c, 5),
  644. GROUP(iso7816_data_c, 5),
  645. GROUP(pwm_c_c, 5),
  646. GROUP(jtag_b_tdo, 2),
  647. GROUP(jtag_b_tdi, 2),
  648. GROUP(jtag_b_clk, 2),
  649. GROUP(jtag_b_tms, 2),
  650. GROUP(pdm_din0_c, 4),
  651. GROUP(pdm_din1_c, 4),
  652. GROUP(pdm_din2_c, 4),
  653. GROUP(pdm_din3_c, 4),
  654. GROUP(pdm_dclk_c, 4),
  655. /* bank GPIOH */
  656. GROUP(spi1_mosi, 3),
  657. GROUP(spi1_miso, 3),
  658. GROUP(spi1_ss0, 3),
  659. GROUP(spi1_clk, 3),
  660. GROUP(i2c1_sda_h2, 2),
  661. GROUP(i2c1_sck_h3, 2),
  662. GROUP(i2c1_sda_h6, 4),
  663. GROUP(i2c1_sck_h7, 4),
  664. GROUP(i2c3_sda_h, 2),
  665. GROUP(i2c3_sck_h, 2),
  666. GROUP(uart_c_tx, 2),
  667. GROUP(uart_c_rx, 2),
  668. GROUP(uart_c_cts, 2),
  669. GROUP(uart_c_rts, 2),
  670. GROUP(iso7816_clk_h, 1),
  671. GROUP(iso7816_data_h, 1),
  672. GROUP(pwm_f_h, 4),
  673. GROUP(cec_ao_a_h, 4),
  674. GROUP(cec_ao_b_h, 5),
  675. GROUP(hdmitx_sda, 1),
  676. GROUP(hdmitx_sck, 1),
  677. GROUP(hdmitx_hpd_in, 1),
  678. GROUP(spdif_out_h, 1),
  679. GROUP(spdif_in_h, 1),
  680. GROUP(tdm_b_din3_h, 6),
  681. GROUP(tdm_b_dout3_h, 5),
  682. /* bank GPIOA */
  683. GROUP(i2c3_sda_a, 2),
  684. GROUP(i2c3_sck_a, 2),
  685. GROUP(pdm_din0_a, 1),
  686. GROUP(pdm_din1_a, 1),
  687. GROUP(pdm_din2_a, 1),
  688. GROUP(pdm_din3_a, 1),
  689. GROUP(pdm_dclk_a, 1),
  690. GROUP(spdif_in_a10, 1),
  691. GROUP(spdif_in_a12, 1),
  692. GROUP(spdif_out_a11, 1),
  693. GROUP(spdif_out_a13, 1),
  694. GROUP(tdm_b_slv_sclk, 2),
  695. GROUP(tdm_b_slv_fs, 2),
  696. GROUP(tdm_b_din0, 2),
  697. GROUP(tdm_b_din1, 2),
  698. GROUP(tdm_b_din2, 2),
  699. GROUP(tdm_b_din3_a, 2),
  700. GROUP(tdm_b_sclk, 1),
  701. GROUP(tdm_b_fs, 1),
  702. GROUP(tdm_b_dout0, 1),
  703. GROUP(tdm_b_dout1, 1),
  704. GROUP(tdm_b_dout2, 3),
  705. GROUP(tdm_b_dout3_a, 3),
  706. GROUP(tdm_c_slv_sclk_a, 3),
  707. GROUP(tdm_c_slv_fs_a, 3),
  708. GROUP(tdm_c_din0_a, 3),
  709. GROUP(tdm_c_din1_a, 3),
  710. GROUP(tdm_c_din2_a, 3),
  711. GROUP(tdm_c_din3_a, 3),
  712. GROUP(tdm_c_sclk_a, 2),
  713. GROUP(tdm_c_fs_a, 2),
  714. GROUP(tdm_c_dout0_a, 2),
  715. GROUP(tdm_c_dout1_a, 2),
  716. GROUP(tdm_c_dout2_a, 2),
  717. GROUP(tdm_c_dout3_a, 2),
  718. GROUP(mclk0_a, 1),
  719. GROUP(mclk1_a, 2),
  720. GROUP(pwm_f_a, 3),
  721. };
  722. /* uart_ao_a */
  723. static const unsigned int uart_ao_a_tx_pins[] = { GPIOAO_0 };
  724. static const unsigned int uart_ao_a_rx_pins[] = { GPIOAO_1 };
  725. static const unsigned int uart_ao_a_cts_pins[] = { GPIOE_0 };
  726. static const unsigned int uart_ao_a_rts_pins[] = { GPIOE_1 };
  727. /* uart_ao_b */
  728. static const unsigned int uart_ao_b_tx_2_pins[] = { GPIOAO_2 };
  729. static const unsigned int uart_ao_b_rx_3_pins[] = { GPIOAO_3 };
  730. static const unsigned int uart_ao_b_tx_8_pins[] = { GPIOAO_8 };
  731. static const unsigned int uart_ao_b_rx_9_pins[] = { GPIOAO_9 };
  732. static const unsigned int uart_ao_b_cts_pins[] = { GPIOE_0 };
  733. static const unsigned int uart_ao_b_rts_pins[] = { GPIOE_1 };
  734. /* i2c_ao */
  735. static const unsigned int i2c_ao_sck_pins[] = { GPIOAO_2 };
  736. static const unsigned int i2c_ao_sda_pins[] = { GPIOAO_3 };
  737. static const unsigned int i2c_ao_sck_e_pins[] = { GPIOE_0 };
  738. static const unsigned int i2c_ao_sda_e_pins[] = { GPIOE_1 };
  739. /* i2c_ao_slave */
  740. static const unsigned int i2c_ao_slave_sck_pins[] = { GPIOAO_2 };
  741. static const unsigned int i2c_ao_slave_sda_pins[] = { GPIOAO_3 };
  742. /* ir_in */
  743. static const unsigned int remote_ao_input_pins[] = { GPIOAO_5 };
  744. /* ir_out */
  745. static const unsigned int remote_ao_out_pins[] = { GPIOAO_4 };
  746. /* pwm_a_e */
  747. static const unsigned int pwm_a_e_pins[] = { GPIOE_2 };
  748. /* pwm_ao_a */
  749. static const unsigned int pwm_ao_a_pins[] = { GPIOAO_11 };
  750. static const unsigned int pwm_ao_a_hiz_pins[] = { GPIOAO_11 };
  751. /* pwm_ao_b */
  752. static const unsigned int pwm_ao_b_pins[] = { GPIOE_0 };
  753. /* pwm_ao_c */
  754. static const unsigned int pwm_ao_c_4_pins[] = { GPIOAO_4 };
  755. static const unsigned int pwm_ao_c_hiz_pins[] = { GPIOAO_4 };
  756. static const unsigned int pwm_ao_c_6_pins[] = { GPIOAO_6 };
  757. /* pwm_ao_d */
  758. static const unsigned int pwm_ao_d_5_pins[] = { GPIOAO_5 };
  759. static const unsigned int pwm_ao_d_10_pins[] = { GPIOAO_10 };
  760. static const unsigned int pwm_ao_d_e_pins[] = { GPIOE_1 };
  761. /* jtag_a */
  762. static const unsigned int jtag_a_tdi_pins[] = { GPIOAO_8 };
  763. static const unsigned int jtag_a_tdo_pins[] = { GPIOAO_9 };
  764. static const unsigned int jtag_a_clk_pins[] = { GPIOAO_6 };
  765. static const unsigned int jtag_a_tms_pins[] = { GPIOAO_7 };
  766. /* cec_ao */
  767. static const unsigned int cec_ao_a_pins[] = { GPIOAO_10 };
  768. static const unsigned int cec_ao_b_pins[] = { GPIOAO_10 };
  769. /* tsin_ao_a */
  770. static const unsigned int tsin_ao_asop_pins[] = { GPIOAO_6 };
  771. static const unsigned int tsin_ao_adin0_pins[] = { GPIOAO_7 };
  772. static const unsigned int tsin_ao_aclk_pins[] = { GPIOAO_8 };
  773. static const unsigned int tsin_ao_a_valid_pins[] = { GPIOAO_9 };
  774. /* spdif_ao_out */
  775. static const unsigned int spdif_ao_out_pins[] = { GPIOAO_10 };
  776. /* tdm_ao_b */
  777. static const unsigned int tdm_ao_b_slv_fs_pins[] = { GPIOAO_7 };
  778. static const unsigned int tdm_ao_b_slv_sclk_pins[] = { GPIOAO_8 };
  779. static const unsigned int tdm_ao_b_fs_pins[] = { GPIOAO_7 };
  780. static const unsigned int tdm_ao_b_sclk_pins[] = { GPIOAO_8 };
  781. static const unsigned int tdm_ao_b_din0_pins[] = { GPIOAO_4 };
  782. static const unsigned int tdm_ao_b_din1_pins[] = { GPIOAO_10 };
  783. static const unsigned int tdm_ao_b_din2_pins[] = { GPIOAO_6 };
  784. static const unsigned int tdm_ao_b_dout0_pins[] = { GPIOAO_4 };
  785. static const unsigned int tdm_ao_b_dout1_pins[] = { GPIOAO_10 };
  786. static const unsigned int tdm_ao_b_dout2_pins[] = { GPIOAO_6 };
  787. /* mclk0_ao */
  788. static const unsigned int mclk0_ao_pins[] = { GPIOAO_9 };
  789. static struct meson_pmx_group meson_g12a_aobus_groups[] = {
  790. GPIO_GROUP(GPIOAO_0),
  791. GPIO_GROUP(GPIOAO_1),
  792. GPIO_GROUP(GPIOAO_2),
  793. GPIO_GROUP(GPIOAO_3),
  794. GPIO_GROUP(GPIOAO_4),
  795. GPIO_GROUP(GPIOAO_5),
  796. GPIO_GROUP(GPIOAO_6),
  797. GPIO_GROUP(GPIOAO_7),
  798. GPIO_GROUP(GPIOAO_8),
  799. GPIO_GROUP(GPIOAO_9),
  800. GPIO_GROUP(GPIOAO_10),
  801. GPIO_GROUP(GPIOAO_11),
  802. GPIO_GROUP(GPIOE_0),
  803. GPIO_GROUP(GPIOE_1),
  804. GPIO_GROUP(GPIOE_2),
  805. /* bank AO */
  806. GROUP(uart_ao_a_tx, 1),
  807. GROUP(uart_ao_a_rx, 1),
  808. GROUP(uart_ao_a_cts, 1),
  809. GROUP(uart_ao_a_rts, 1),
  810. GROUP(uart_ao_b_tx_2, 2),
  811. GROUP(uart_ao_b_rx_3, 2),
  812. GROUP(uart_ao_b_tx_8, 3),
  813. GROUP(uart_ao_b_rx_9, 3),
  814. GROUP(uart_ao_b_cts, 2),
  815. GROUP(uart_ao_b_rts, 2),
  816. GROUP(i2c_ao_sck, 1),
  817. GROUP(i2c_ao_sda, 1),
  818. GROUP(i2c_ao_sck_e, 4),
  819. GROUP(i2c_ao_sda_e, 4),
  820. GROUP(i2c_ao_slave_sck, 3),
  821. GROUP(i2c_ao_slave_sda, 3),
  822. GROUP(remote_ao_input, 1),
  823. GROUP(remote_ao_out, 1),
  824. GROUP(pwm_a_e, 3),
  825. GROUP(pwm_ao_a, 3),
  826. GROUP(pwm_ao_a_hiz, 2),
  827. GROUP(pwm_ao_b, 3),
  828. GROUP(pwm_ao_c_4, 3),
  829. GROUP(pwm_ao_c_hiz, 4),
  830. GROUP(pwm_ao_c_6, 3),
  831. GROUP(pwm_ao_d_5, 3),
  832. GROUP(pwm_ao_d_10, 3),
  833. GROUP(pwm_ao_d_e, 3),
  834. GROUP(jtag_a_tdi, 1),
  835. GROUP(jtag_a_tdo, 1),
  836. GROUP(jtag_a_clk, 1),
  837. GROUP(jtag_a_tms, 1),
  838. GROUP(cec_ao_a, 1),
  839. GROUP(cec_ao_b, 2),
  840. GROUP(tsin_ao_asop, 4),
  841. GROUP(tsin_ao_adin0, 4),
  842. GROUP(tsin_ao_aclk, 4),
  843. GROUP(tsin_ao_a_valid, 4),
  844. GROUP(spdif_ao_out, 4),
  845. GROUP(tdm_ao_b_dout0, 5),
  846. GROUP(tdm_ao_b_dout1, 5),
  847. GROUP(tdm_ao_b_dout2, 5),
  848. GROUP(tdm_ao_b_fs, 5),
  849. GROUP(tdm_ao_b_sclk, 5),
  850. GROUP(tdm_ao_b_din0, 6),
  851. GROUP(tdm_ao_b_din1, 6),
  852. GROUP(tdm_ao_b_din2, 6),
  853. GROUP(tdm_ao_b_slv_fs, 6),
  854. GROUP(tdm_ao_b_slv_sclk, 6),
  855. GROUP(mclk0_ao, 5),
  856. };
  857. static const char * const gpio_periphs_groups[] = {
  858. "GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4",
  859. "GPIOZ_5", "GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9",
  860. "GPIOZ_10", "GPIOZ_11", "GPIOZ_12", "GPIOZ_13", "GPIOZ_14",
  861. "GPIOZ_15",
  862. "GPIOH_0", "GPIOH_1", "GPIOH_2", "GPIOH_3", "GPIOH_4",
  863. "GPIOH_5", "GPIOH_6", "GPIOH_7", "GPIOH_8",
  864. "BOOT_0", "BOOT_1", "BOOT_2", "BOOT_3", "BOOT_4",
  865. "BOOT_5", "BOOT_6", "BOOT_7", "BOOT_8", "BOOT_9",
  866. "BOOT_10", "BOOT_11", "BOOT_12", "BOOT_13", "BOOT_14",
  867. "BOOT_15",
  868. "GPIOC_0", "GPIOC_1", "GPIOC_2", "GPIOC_3", "GPIOC_4",
  869. "GPIOC_5", "GPIOC_6", "GPIOC_7",
  870. "GPIOA_0", "GPIOA_1", "GPIOA_2", "GPIOA_3", "GPIOA_4",
  871. "GPIOA_5", "GPIOA_6", "GPIOA_7", "GPIOA_8", "GPIOA_9",
  872. "GPIOA_10", "GPIOA_11", "GPIOA_12", "GPIOA_13", "GPIOA_14",
  873. "GPIOA_15",
  874. "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4",
  875. "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9",
  876. "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14",
  877. "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18", "GPIOX_19",
  878. };
  879. static const char * const emmc_groups[] = {
  880. "emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2",
  881. "emmc_nand_d3", "emmc_nand_d4", "emmc_nand_d5",
  882. "emmc_nand_d6", "emmc_nand_d7",
  883. "emmc_clk", "emmc_cmd", "emmc_nand_ds",
  884. };
  885. static const char * const nand_groups[] = {
  886. "emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2",
  887. "emmc_nand_d3", "emmc_nand_d4", "emmc_nand_d5",
  888. "emmc_nand_d6", "emmc_nand_d7",
  889. "nand_ce0", "nand_ale", "nand_cle",
  890. "nand_wen_clk", "nand_ren_wr", "nand_rb0",
  891. "emmc_nand_ds", "nand_ce1",
  892. };
  893. static const char * const nor_groups[] = {
  894. "nor_d", "nor_q", "nor_c", "nor_cs",
  895. "nor_hold", "nor_wp",
  896. };
  897. static const char * const sdio_groups[] = {
  898. "sdio_d0", "sdio_d1", "sdio_d2", "sdio_d3",
  899. "sdio_cmd", "sdio_clk", "sdio_dummy",
  900. };
  901. static const char * const sdcard_groups[] = {
  902. "sdcard_d0_c", "sdcard_d1_c", "sdcard_d2_c", "sdcard_d3_c",
  903. "sdcard_clk_c", "sdcard_cmd_c",
  904. "sdcard_d0_z", "sdcard_d1_z", "sdcard_d2_z", "sdcard_d3_z",
  905. "sdcard_clk_z", "sdcard_cmd_z",
  906. };
  907. static const char * const spi0_groups[] = {
  908. "spi0_mosi_c", "spi0_miso_c", "spi0_ss0_c", "spi0_clk_c",
  909. "spi0_mosi_x", "spi0_miso_x", "spi0_ss0_x", "spi0_clk_x",
  910. };
  911. static const char * const spi1_groups[] = {
  912. "spi1_mosi", "spi1_miso", "spi1_ss0", "spi1_clk",
  913. };
  914. static const char * const i2c0_groups[] = {
  915. "i2c0_sda_c", "i2c0_sck_c",
  916. "i2c0_sda_z0", "i2c0_sck_z1",
  917. "i2c0_sda_z7", "i2c0_sck_z8",
  918. };
  919. static const char * const i2c1_groups[] = {
  920. "i2c1_sda_x", "i2c1_sck_x",
  921. "i2c1_sda_h2", "i2c1_sck_h3",
  922. "i2c1_sda_h6", "i2c1_sck_h7",
  923. };
  924. static const char * const i2c2_groups[] = {
  925. "i2c2_sda_x", "i2c2_sck_x",
  926. "i2c2_sda_z", "i2c2_sck_z",
  927. };
  928. static const char * const i2c3_groups[] = {
  929. "i2c3_sda_h", "i2c3_sck_h",
  930. "i2c3_sda_a", "i2c3_sck_a",
  931. };
  932. static const char * const uart_a_groups[] = {
  933. "uart_a_tx", "uart_a_rx", "uart_a_cts", "uart_a_rts",
  934. };
  935. static const char * const uart_b_groups[] = {
  936. "uart_b_tx", "uart_b_rx",
  937. };
  938. static const char * const uart_c_groups[] = {
  939. "uart_c_tx", "uart_c_rx", "uart_c_cts", "uart_c_rts",
  940. };
  941. static const char * const uart_ao_a_c_groups[] = {
  942. "uart_ao_a_rx_c", "uart_ao_a_tx_c",
  943. };
  944. static const char * const iso7816_groups[] = {
  945. "iso7816_clk_c", "iso7816_data_c",
  946. "iso7816_clk_x", "iso7816_data_x",
  947. "iso7816_clk_h", "iso7816_data_h",
  948. "iso7816_clk_z", "iso7816_data_z",
  949. };
  950. static const char * const eth_groups[] = {
  951. "eth_rxd2_rgmii", "eth_rxd3_rgmii", "eth_rgmii_tx_clk",
  952. "eth_txd2_rgmii", "eth_txd3_rgmii", "eth_rgmii_rx_clk",
  953. "eth_txd0", "eth_txd1", "eth_txen", "eth_mdc",
  954. "eth_rxd0", "eth_rxd1", "eth_rx_dv", "eth_mdio",
  955. "eth_link_led", "eth_act_led",
  956. };
  957. static const char * const pwm_a_groups[] = {
  958. "pwm_a",
  959. };
  960. static const char * const pwm_b_groups[] = {
  961. "pwm_b_x7", "pwm_b_x19",
  962. };
  963. static const char * const pwm_c_groups[] = {
  964. "pwm_c_c", "pwm_c_x5", "pwm_c_x8",
  965. };
  966. static const char * const pwm_d_groups[] = {
  967. "pwm_d_x3", "pwm_d_x6",
  968. };
  969. static const char * const pwm_e_groups[] = {
  970. "pwm_e",
  971. };
  972. static const char * const pwm_f_groups[] = {
  973. "pwm_f_z", "pwm_f_a", "pwm_f_x", "pwm_f_h",
  974. };
  975. static const char * const cec_ao_a_h_groups[] = {
  976. "cec_ao_a_h",
  977. };
  978. static const char * const cec_ao_b_h_groups[] = {
  979. "cec_ao_b_h",
  980. };
  981. static const char * const jtag_b_groups[] = {
  982. "jtag_b_tdi", "jtag_b_tdo", "jtag_b_clk", "jtag_b_tms",
  983. };
  984. static const char * const bt565_a_groups[] = {
  985. "bt565_a_vs", "bt565_a_hs", "bt565_a_clk",
  986. "bt565_a_din0", "bt565_a_din1", "bt565_a_din2",
  987. "bt565_a_din3", "bt565_a_din4", "bt565_a_din5",
  988. "bt565_a_din6", "bt565_a_din7",
  989. };
  990. static const char * const tsin_a_groups[] = {
  991. "tsin_a_valid", "tsin_a_sop", "tsin_a_din0",
  992. "tsin_a_clk",
  993. };
  994. static const char * const tsin_b_groups[] = {
  995. "tsin_b_valid_x", "tsin_b_sop_x", "tsin_b_din0_x", "tsin_b_clk_x",
  996. "tsin_b_valid_z", "tsin_b_sop_z", "tsin_b_din0_z", "tsin_b_clk_z",
  997. "tsin_b_fail", "tsin_b_din1", "tsin_b_din2", "tsin_b_din3",
  998. "tsin_b_din4", "tsin_b_din5", "tsin_b_din6", "tsin_b_din7",
  999. };
  1000. static const char * const hdmitx_groups[] = {
  1001. "hdmitx_sda", "hdmitx_sck", "hdmitx_hpd_in",
  1002. };
  1003. static const char * const pdm_groups[] = {
  1004. "pdm_din0_c", "pdm_din1_c", "pdm_din2_c", "pdm_din3_c",
  1005. "pdm_dclk_c",
  1006. "pdm_din0_x", "pdm_din1_x", "pdm_din2_x", "pdm_din3_x",
  1007. "pdm_dclk_x",
  1008. "pdm_din0_z", "pdm_din1_z", "pdm_din2_z", "pdm_din3_z",
  1009. "pdm_dclk_z",
  1010. "pdm_din0_a", "pdm_din1_a", "pdm_din2_a", "pdm_din3_a",
  1011. "pdm_dclk_a",
  1012. };
  1013. static const char * const spdif_in_groups[] = {
  1014. "spdif_in_h", "spdif_in_a10", "spdif_in_a12",
  1015. };
  1016. static const char * const spdif_out_groups[] = {
  1017. "spdif_out_h", "spdif_out_a11", "spdif_out_a13",
  1018. };
  1019. static const char * const mclk0_groups[] = {
  1020. "mclk0_a",
  1021. };
  1022. static const char * const mclk1_groups[] = {
  1023. "mclk1_x", "mclk1_z", "mclk1_a",
  1024. };
  1025. static const char * const tdm_a_groups[] = {
  1026. "tdm_a_slv_sclk", "tdm_a_slv_fs", "tdm_a_sclk", "tdm_a_fs",
  1027. "tdm_a_din0", "tdm_a_din1", "tdm_a_dout0", "tdm_a_dout1",
  1028. };
  1029. static const char * const tdm_b_groups[] = {
  1030. "tdm_b_slv_sclk", "tdm_b_slv_fs", "tdm_b_sclk", "tdm_b_fs",
  1031. "tdm_b_din0", "tdm_b_din1", "tdm_b_din2",
  1032. "tdm_b_din3_a", "tdm_b_din3_h",
  1033. "tdm_b_dout0", "tdm_b_dout1", "tdm_b_dout2",
  1034. "tdm_b_dout3_a", "tdm_b_dout3_h",
  1035. };
  1036. static const char * const tdm_c_groups[] = {
  1037. "tdm_c_slv_sclk_a", "tdm_c_slv_fs_a",
  1038. "tdm_c_slv_sclk_z", "tdm_c_slv_fs_z",
  1039. "tdm_c_sclk_a", "tdm_c_fs_a",
  1040. "tdm_c_sclk_z", "tdm_c_fs_z",
  1041. "tdm_c_din0_a", "tdm_c_din1_a",
  1042. "tdm_c_din2_a", "tdm_c_din3_a",
  1043. "tdm_c_din0_z", "tdm_c_din1_z",
  1044. "tdm_c_din2_z", "tdm_c_din3_z",
  1045. "tdm_c_dout0_a", "tdm_c_dout1_a",
  1046. "tdm_c_dout2_a", "tdm_c_dout3_a",
  1047. "tdm_c_dout0_z", "tdm_c_dout1_z",
  1048. "tdm_c_dout2_z", "tdm_c_dout3_z",
  1049. };
  1050. static const char * const gpio_aobus_groups[] = {
  1051. "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4",
  1052. "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9",
  1053. "GPIOAO_10", "GPIOAO_11", "GPIOE_0", "GPIOE_1", "GPIOE_2",
  1054. };
  1055. static const char * const uart_ao_a_groups[] = {
  1056. "uart_ao_a_tx", "uart_ao_a_rx",
  1057. "uart_ao_a_cts", "uart_ao_a_rts",
  1058. };
  1059. static const char * const uart_ao_b_groups[] = {
  1060. "uart_ao_b_tx_2", "uart_ao_b_rx_3",
  1061. "uart_ao_b_tx_8", "uart_ao_b_rx_9",
  1062. "uart_ao_b_cts", "uart_ao_b_rts",
  1063. };
  1064. static const char * const i2c_ao_groups[] = {
  1065. "i2c_ao_sck", "i2c_ao_sda",
  1066. "i2c_ao_sck_e", "i2c_ao_sda_e",
  1067. };
  1068. static const char * const i2c_ao_slave_groups[] = {
  1069. "i2c_ao_slave_sck", "i2c_ao_slave_sda",
  1070. };
  1071. static const char * const remote_ao_input_groups[] = {
  1072. "remote_ao_input",
  1073. };
  1074. static const char * const remote_ao_out_groups[] = {
  1075. "remote_ao_out",
  1076. };
  1077. static const char * const pwm_a_e_groups[] = {
  1078. "pwm_a_e",
  1079. };
  1080. static const char * const pwm_ao_a_groups[] = {
  1081. "pwm_ao_a", "pwm_ao_a_hiz",
  1082. };
  1083. static const char * const pwm_ao_b_groups[] = {
  1084. "pwm_ao_b",
  1085. };
  1086. static const char * const pwm_ao_c_groups[] = {
  1087. "pwm_ao_c_4", "pwm_ao_c_hiz",
  1088. "pwm_ao_c_6",
  1089. };
  1090. static const char * const pwm_ao_d_groups[] = {
  1091. "pwm_ao_d_5", "pwm_ao_d_10", "pwm_ao_d_e",
  1092. };
  1093. static const char * const jtag_a_groups[] = {
  1094. "jtag_a_tdi", "jtag_a_tdo", "jtag_a_clk", "jtag_a_tms",
  1095. };
  1096. static const char * const cec_ao_a_groups[] = {
  1097. "cec_ao_a",
  1098. };
  1099. static const char * const cec_ao_b_groups[] = {
  1100. "cec_ao_b",
  1101. };
  1102. static const char * const tsin_ao_a_groups[] = {
  1103. "tsin_ao_asop", "tsin_ao_adin0", "tsin_ao_aclk", "tsin_ao_a_valid",
  1104. };
  1105. static const char * const spdif_ao_out_groups[] = {
  1106. "spdif_ao_out",
  1107. };
  1108. static const char * const tdm_ao_b_groups[] = {
  1109. "tdm_ao_b_dout0", "tdm_ao_b_dout1", "tdm_ao_b_dout2",
  1110. "tdm_ao_b_fs", "tdm_ao_b_sclk",
  1111. "tdm_ao_b_din0", "tdm_ao_b_din1", "tdm_ao_b_din2",
  1112. "tdm_ao_b_slv_fs", "tdm_ao_b_slv_sclk",
  1113. };
  1114. static const char * const mclk0_ao_groups[] = {
  1115. "mclk0_ao",
  1116. };
  1117. static struct meson_pmx_func meson_g12a_periphs_functions[] = {
  1118. FUNCTION(gpio_periphs),
  1119. FUNCTION(emmc),
  1120. FUNCTION(nor),
  1121. FUNCTION(spi0),
  1122. FUNCTION(spi1),
  1123. FUNCTION(sdio),
  1124. FUNCTION(nand),
  1125. FUNCTION(sdcard),
  1126. FUNCTION(i2c0),
  1127. FUNCTION(i2c1),
  1128. FUNCTION(i2c2),
  1129. FUNCTION(i2c3),
  1130. FUNCTION(uart_a),
  1131. FUNCTION(uart_b),
  1132. FUNCTION(uart_c),
  1133. FUNCTION(uart_ao_a_c),
  1134. FUNCTION(iso7816),
  1135. FUNCTION(eth),
  1136. FUNCTION(pwm_a),
  1137. FUNCTION(pwm_b),
  1138. FUNCTION(pwm_c),
  1139. FUNCTION(pwm_d),
  1140. FUNCTION(pwm_e),
  1141. FUNCTION(pwm_f),
  1142. FUNCTION(cec_ao_a_h),
  1143. FUNCTION(cec_ao_b_h),
  1144. FUNCTION(jtag_b),
  1145. FUNCTION(bt565_a),
  1146. FUNCTION(tsin_a),
  1147. FUNCTION(tsin_b),
  1148. FUNCTION(hdmitx),
  1149. FUNCTION(pdm),
  1150. FUNCTION(spdif_out),
  1151. FUNCTION(spdif_in),
  1152. FUNCTION(mclk0),
  1153. FUNCTION(mclk1),
  1154. FUNCTION(tdm_a),
  1155. FUNCTION(tdm_b),
  1156. FUNCTION(tdm_c),
  1157. };
  1158. static struct meson_pmx_func meson_g12a_aobus_functions[] = {
  1159. FUNCTION(gpio_aobus),
  1160. FUNCTION(uart_ao_a),
  1161. FUNCTION(uart_ao_b),
  1162. FUNCTION(i2c_ao),
  1163. FUNCTION(i2c_ao_slave),
  1164. FUNCTION(remote_ao_input),
  1165. FUNCTION(remote_ao_out),
  1166. FUNCTION(pwm_a_e),
  1167. FUNCTION(pwm_ao_a),
  1168. FUNCTION(pwm_ao_b),
  1169. FUNCTION(pwm_ao_c),
  1170. FUNCTION(pwm_ao_d),
  1171. FUNCTION(jtag_a),
  1172. FUNCTION(cec_ao_a),
  1173. FUNCTION(cec_ao_b),
  1174. FUNCTION(tsin_ao_a),
  1175. FUNCTION(spdif_ao_out),
  1176. FUNCTION(tdm_ao_b),
  1177. FUNCTION(mclk0_ao),
  1178. };
  1179. static struct meson_bank meson_g12a_periphs_banks[] = {
  1180. /* name first last irq pullen pull dir out in ds */
  1181. BANK_DS("Z", GPIOZ_0, GPIOZ_15, 12, 27,
  1182. 4, 0, 4, 0, 12, 0, 13, 0, 14, 0, 5, 0),
  1183. BANK_DS("H", GPIOH_0, GPIOH_8, 28, 36,
  1184. 3, 0, 3, 0, 9, 0, 10, 0, 11, 0, 4, 0),
  1185. BANK_DS("BOOT", BOOT_0, BOOT_15, 37, 52,
  1186. 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0),
  1187. BANK_DS("C", GPIOC_0, GPIOC_7, 53, 60,
  1188. 1, 0, 1, 0, 3, 0, 4, 0, 5, 0, 1, 0),
  1189. BANK_DS("A", GPIOA_0, GPIOA_15, 61, 76,
  1190. 5, 0, 5, 0, 16, 0, 17, 0, 18, 0, 6, 0),
  1191. BANK_DS("X", GPIOX_0, GPIOX_19, 77, 96,
  1192. 2, 0, 2, 0, 6, 0, 7, 0, 8, 0, 2, 0),
  1193. };
  1194. static struct meson_bank meson_g12a_aobus_banks[] = {
  1195. /* name first last irq pullen pull dir out in ds */
  1196. BANK_DS("AO", GPIOAO_0, GPIOAO_11, 0, 11, 3, 0, 2, 0, 0, 0, 4, 0, 1, 0,
  1197. 0, 0),
  1198. /* GPIOE actually located in the AO bank */
  1199. BANK_DS("E", GPIOE_0, GPIOE_2, 97, 99, 3, 16, 2, 16, 0, 16, 4, 16, 1,
  1200. 16, 1, 0),
  1201. };
  1202. static struct meson_pmx_bank meson_g12a_periphs_pmx_banks[] = {
  1203. /* name first lask reg offset */
  1204. BANK_PMX("Z", GPIOZ_0, GPIOZ_15, 0x6, 0),
  1205. BANK_PMX("H", GPIOH_0, GPIOH_8, 0xb, 0),
  1206. BANK_PMX("BOOT", BOOT_0, BOOT_15, 0x0, 0),
  1207. BANK_PMX("C", GPIOC_0, GPIOC_7, 0x9, 0),
  1208. BANK_PMX("A", GPIOA_0, GPIOA_15, 0xd, 0),
  1209. BANK_PMX("X", GPIOX_0, GPIOX_19, 0x3, 0),
  1210. };
  1211. static struct meson_axg_pmx_data meson_g12a_periphs_pmx_banks_data = {
  1212. .pmx_banks = meson_g12a_periphs_pmx_banks,
  1213. .num_pmx_banks = ARRAY_SIZE(meson_g12a_periphs_pmx_banks),
  1214. };
  1215. static struct meson_pmx_bank meson_g12a_aobus_pmx_banks[] = {
  1216. BANK_PMX("AO", GPIOAO_0, GPIOAO_11, 0x0, 0),
  1217. BANK_PMX("E", GPIOE_0, GPIOE_2, 0x1, 16),
  1218. };
  1219. static struct meson_axg_pmx_data meson_g12a_aobus_pmx_banks_data = {
  1220. .pmx_banks = meson_g12a_aobus_pmx_banks,
  1221. .num_pmx_banks = ARRAY_SIZE(meson_g12a_aobus_pmx_banks),
  1222. };
  1223. static int meson_g12a_aobus_parse_dt_extra(struct meson_pinctrl *pc)
  1224. {
  1225. pc->reg_pull = pc->reg_gpio;
  1226. pc->reg_pullen = pc->reg_gpio;
  1227. return 0;
  1228. }
  1229. static struct meson_pinctrl_data meson_g12a_periphs_pinctrl_data = {
  1230. .name = "periphs-banks",
  1231. .pins = meson_g12a_periphs_pins,
  1232. .groups = meson_g12a_periphs_groups,
  1233. .funcs = meson_g12a_periphs_functions,
  1234. .banks = meson_g12a_periphs_banks,
  1235. .num_pins = ARRAY_SIZE(meson_g12a_periphs_pins),
  1236. .num_groups = ARRAY_SIZE(meson_g12a_periphs_groups),
  1237. .num_funcs = ARRAY_SIZE(meson_g12a_periphs_functions),
  1238. .num_banks = ARRAY_SIZE(meson_g12a_periphs_banks),
  1239. .pmx_ops = &meson_axg_pmx_ops,
  1240. .pmx_data = &meson_g12a_periphs_pmx_banks_data,
  1241. };
  1242. static struct meson_pinctrl_data meson_g12a_aobus_pinctrl_data = {
  1243. .name = "aobus-banks",
  1244. .pins = meson_g12a_aobus_pins,
  1245. .groups = meson_g12a_aobus_groups,
  1246. .funcs = meson_g12a_aobus_functions,
  1247. .banks = meson_g12a_aobus_banks,
  1248. .num_pins = ARRAY_SIZE(meson_g12a_aobus_pins),
  1249. .num_groups = ARRAY_SIZE(meson_g12a_aobus_groups),
  1250. .num_funcs = ARRAY_SIZE(meson_g12a_aobus_functions),
  1251. .num_banks = ARRAY_SIZE(meson_g12a_aobus_banks),
  1252. .pmx_ops = &meson_axg_pmx_ops,
  1253. .pmx_data = &meson_g12a_aobus_pmx_banks_data,
  1254. .parse_dt = meson_g12a_aobus_parse_dt_extra,
  1255. };
  1256. static const struct of_device_id meson_g12a_pinctrl_dt_match[] = {
  1257. {
  1258. .compatible = "amlogic,meson-g12a-periphs-pinctrl",
  1259. .data = &meson_g12a_periphs_pinctrl_data,
  1260. },
  1261. {
  1262. .compatible = "amlogic,meson-g12a-aobus-pinctrl",
  1263. .data = &meson_g12a_aobus_pinctrl_data,
  1264. },
  1265. { },
  1266. };
  1267. MODULE_DEVICE_TABLE(of, meson_g12a_pinctrl_dt_match);
  1268. static struct platform_driver meson_g12a_pinctrl_driver = {
  1269. .probe = meson_pinctrl_probe,
  1270. .driver = {
  1271. .name = "meson-g12a-pinctrl",
  1272. .of_match_table = meson_g12a_pinctrl_dt_match,
  1273. },
  1274. };
  1275. module_platform_driver(meson_g12a_pinctrl_driver);
  1276. MODULE_LICENSE("Dual BSD/GPL");