pinctrl-meson-g12a.c 44 KB

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