pinctrl-meson-g12a.c 43 KB

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