pinctrl-meson-g12a.c 45 KB

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