pinctrl-meson-g12a.c 45 KB

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