pinctrl-meson-g12a.c 43 KB

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