pinctrl-meson-axg.c 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975
  1. /*
  2. * Pin controller and GPIO driver for Amlogic Meson AXG SoC.
  3. *
  4. * Copyright (c) 2017 Amlogic, Inc. All rights reserved.
  5. * Author: Xingyu Chen <xingyu.chen@amlogic.com>
  6. *
  7. * SPDX-License-Identifier: (GPL-2.0+ or MIT)
  8. */
  9. #include <dt-bindings/gpio/meson-axg-gpio.h>
  10. #include "pinctrl-meson.h"
  11. #include "pinctrl-meson-axg-pmx.h"
  12. static const struct pinctrl_pin_desc meson_axg_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(BOOT_0),
  25. MESON_PIN(BOOT_1),
  26. MESON_PIN(BOOT_2),
  27. MESON_PIN(BOOT_3),
  28. MESON_PIN(BOOT_4),
  29. MESON_PIN(BOOT_5),
  30. MESON_PIN(BOOT_6),
  31. MESON_PIN(BOOT_7),
  32. MESON_PIN(BOOT_8),
  33. MESON_PIN(BOOT_9),
  34. MESON_PIN(BOOT_10),
  35. MESON_PIN(BOOT_11),
  36. MESON_PIN(BOOT_12),
  37. MESON_PIN(BOOT_13),
  38. MESON_PIN(BOOT_14),
  39. MESON_PIN(GPIOA_0),
  40. MESON_PIN(GPIOA_1),
  41. MESON_PIN(GPIOA_2),
  42. MESON_PIN(GPIOA_3),
  43. MESON_PIN(GPIOA_4),
  44. MESON_PIN(GPIOA_5),
  45. MESON_PIN(GPIOA_6),
  46. MESON_PIN(GPIOA_7),
  47. MESON_PIN(GPIOA_8),
  48. MESON_PIN(GPIOA_9),
  49. MESON_PIN(GPIOA_10),
  50. MESON_PIN(GPIOA_11),
  51. MESON_PIN(GPIOA_12),
  52. MESON_PIN(GPIOA_13),
  53. MESON_PIN(GPIOA_14),
  54. MESON_PIN(GPIOA_15),
  55. MESON_PIN(GPIOA_16),
  56. MESON_PIN(GPIOA_17),
  57. MESON_PIN(GPIOA_18),
  58. MESON_PIN(GPIOA_19),
  59. MESON_PIN(GPIOA_20),
  60. MESON_PIN(GPIOX_0),
  61. MESON_PIN(GPIOX_1),
  62. MESON_PIN(GPIOX_2),
  63. MESON_PIN(GPIOX_3),
  64. MESON_PIN(GPIOX_4),
  65. MESON_PIN(GPIOX_5),
  66. MESON_PIN(GPIOX_6),
  67. MESON_PIN(GPIOX_7),
  68. MESON_PIN(GPIOX_8),
  69. MESON_PIN(GPIOX_9),
  70. MESON_PIN(GPIOX_10),
  71. MESON_PIN(GPIOX_11),
  72. MESON_PIN(GPIOX_12),
  73. MESON_PIN(GPIOX_13),
  74. MESON_PIN(GPIOX_14),
  75. MESON_PIN(GPIOX_15),
  76. MESON_PIN(GPIOX_16),
  77. MESON_PIN(GPIOX_17),
  78. MESON_PIN(GPIOX_18),
  79. MESON_PIN(GPIOX_19),
  80. MESON_PIN(GPIOX_20),
  81. MESON_PIN(GPIOX_21),
  82. MESON_PIN(GPIOX_22),
  83. MESON_PIN(GPIOY_0),
  84. MESON_PIN(GPIOY_1),
  85. MESON_PIN(GPIOY_2),
  86. MESON_PIN(GPIOY_3),
  87. MESON_PIN(GPIOY_4),
  88. MESON_PIN(GPIOY_5),
  89. MESON_PIN(GPIOY_6),
  90. MESON_PIN(GPIOY_7),
  91. MESON_PIN(GPIOY_8),
  92. MESON_PIN(GPIOY_9),
  93. MESON_PIN(GPIOY_10),
  94. MESON_PIN(GPIOY_11),
  95. MESON_PIN(GPIOY_12),
  96. MESON_PIN(GPIOY_13),
  97. MESON_PIN(GPIOY_14),
  98. MESON_PIN(GPIOY_15),
  99. };
  100. static const struct pinctrl_pin_desc meson_axg_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(GPIOAO_12),
  114. MESON_PIN(GPIOAO_13),
  115. MESON_PIN(GPIO_TEST_N),
  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_ds_pins[] = {BOOT_13};
  129. /* nand */
  130. static const unsigned int nand_ce0_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_wen_clk_pins[] = {BOOT_11};
  134. static const unsigned int nand_ren_wr_pins[] = {BOOT_12};
  135. static const unsigned int nand_rb0_pins[] = {BOOT_13};
  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_9};
  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. /* spi0 */
  151. static const unsigned int spi0_clk_pins[] = {GPIOZ_0};
  152. static const unsigned int spi0_mosi_pins[] = {GPIOZ_1};
  153. static const unsigned int spi0_miso_pins[] = {GPIOZ_2};
  154. static const unsigned int spi0_ss0_pins[] = {GPIOZ_3};
  155. static const unsigned int spi0_ss1_pins[] = {GPIOZ_4};
  156. static const unsigned int spi0_ss2_pins[] = {GPIOZ_5};
  157. /* spi1 */
  158. static const unsigned int spi1_clk_x_pins[] = {GPIOX_19};
  159. static const unsigned int spi1_mosi_x_pins[] = {GPIOX_17};
  160. static const unsigned int spi1_miso_x_pins[] = {GPIOX_18};
  161. static const unsigned int spi1_ss0_x_pins[] = {GPIOX_16};
  162. static const unsigned int spi1_clk_a_pins[] = {GPIOA_4};
  163. static const unsigned int spi1_mosi_a_pins[] = {GPIOA_2};
  164. static const unsigned int spi1_miso_a_pins[] = {GPIOA_3};
  165. static const unsigned int spi1_ss0_a_pins[] = {GPIOA_5};
  166. static const unsigned int spi1_ss1_pins[] = {GPIOA_6};
  167. /* i2c0 */
  168. static const unsigned int i2c0_sck_pins[] = {GPIOZ_6};
  169. static const unsigned int i2c0_sda_pins[] = {GPIOZ_7};
  170. /* i2c1 */
  171. static const unsigned int i2c1_sck_z_pins[] = {GPIOZ_8};
  172. static const unsigned int i2c1_sda_z_pins[] = {GPIOZ_9};
  173. static const unsigned int i2c1_sck_x_pins[] = {GPIOX_16};
  174. static const unsigned int i2c1_sda_x_pins[] = {GPIOX_17};
  175. /* i2c2 */
  176. static const unsigned int i2c2_sck_x_pins[] = {GPIOX_18};
  177. static const unsigned int i2c2_sda_x_pins[] = {GPIOX_19};
  178. static const unsigned int i2c2_sda_a_pins[] = {GPIOA_17};
  179. static const unsigned int i2c2_sck_a_pins[] = {GPIOA_18};
  180. /* i2c3 */
  181. static const unsigned int i2c3_sda_a6_pins[] = {GPIOA_6};
  182. static const unsigned int i2c3_sck_a7_pins[] = {GPIOA_7};
  183. static const unsigned int i2c3_sda_a12_pins[] = {GPIOA_12};
  184. static const unsigned int i2c3_sck_a13_pins[] = {GPIOA_13};
  185. static const unsigned int i2c3_sda_a19_pins[] = {GPIOA_19};
  186. static const unsigned int i2c3_sck_a20_pins[] = {GPIOA_20};
  187. /* uart_a */
  188. static const unsigned int uart_rts_a_pins[] = {GPIOX_11};
  189. static const unsigned int uart_cts_a_pins[] = {GPIOX_10};
  190. static const unsigned int uart_tx_a_pins[] = {GPIOX_8};
  191. static const unsigned int uart_rx_a_pins[] = {GPIOX_9};
  192. /* uart_b */
  193. static const unsigned int uart_rts_b_z_pins[] = {GPIOZ_0};
  194. static const unsigned int uart_cts_b_z_pins[] = {GPIOZ_1};
  195. static const unsigned int uart_tx_b_z_pins[] = {GPIOZ_2};
  196. static const unsigned int uart_rx_b_z_pins[] = {GPIOZ_3};
  197. static const unsigned int uart_rts_b_x_pins[] = {GPIOX_18};
  198. static const unsigned int uart_cts_b_x_pins[] = {GPIOX_19};
  199. static const unsigned int uart_tx_b_x_pins[] = {GPIOX_16};
  200. static const unsigned int uart_rx_b_x_pins[] = {GPIOX_17};
  201. /* uart_ao_b */
  202. static const unsigned int uart_ao_tx_b_z_pins[] = {GPIOZ_8};
  203. static const unsigned int uart_ao_rx_b_z_pins[] = {GPIOZ_9};
  204. static const unsigned int uart_ao_cts_b_z_pins[] = {GPIOZ_6};
  205. static const unsigned int uart_ao_rts_b_z_pins[] = {GPIOZ_7};
  206. /* pwm_a */
  207. static const unsigned int pwm_a_z_pins[] = {GPIOZ_5};
  208. static const unsigned int pwm_a_x18_pins[] = {GPIOX_18};
  209. static const unsigned int pwm_a_x20_pins[] = {GPIOX_20};
  210. static const unsigned int pwm_a_a_pins[] = {GPIOA_14};
  211. /* pwm_b */
  212. static const unsigned int pwm_b_z_pins[] = {GPIOZ_4};
  213. static const unsigned int pwm_b_x_pins[] = {GPIOX_19};
  214. static const unsigned int pwm_b_a_pins[] = {GPIOA_15};
  215. /* pwm_c */
  216. static const unsigned int pwm_c_x10_pins[] = {GPIOX_10};
  217. static const unsigned int pwm_c_x17_pins[] = {GPIOX_17};
  218. static const unsigned int pwm_c_a_pins[] = {GPIOA_16};
  219. /* pwm_d */
  220. static const unsigned int pwm_d_x11_pins[] = {GPIOX_11};
  221. static const unsigned int pwm_d_x16_pins[] = {GPIOX_16};
  222. /* pwm_vs */
  223. static const unsigned int pwm_vs_pins[] = {GPIOA_0};
  224. /* spdif_in */
  225. static const unsigned int spdif_in_z_pins[] = {GPIOZ_4};
  226. static const unsigned int spdif_in_a1_pins[] = {GPIOA_1};
  227. static const unsigned int spdif_in_a7_pins[] = {GPIOA_7};
  228. static const unsigned int spdif_in_a19_pins[] = {GPIOA_19};
  229. static const unsigned int spdif_in_a20_pins[] = {GPIOA_20};
  230. /* spdif_out */
  231. static const unsigned int spdif_out_z_pins[] = {GPIOZ_5};
  232. static const unsigned int spdif_out_a1_pins[] = {GPIOA_1};
  233. static const unsigned int spdif_out_a11_pins[] = {GPIOA_11};
  234. static const unsigned int spdif_out_a19_pins[] = {GPIOA_19};
  235. static const unsigned int spdif_out_a20_pins[] = {GPIOA_20};
  236. /* jtag_ee */
  237. static const unsigned int jtag_tdo_x_pins[] = {GPIOX_0};
  238. static const unsigned int jtag_tdi_x_pins[] = {GPIOX_1};
  239. static const unsigned int jtag_clk_x_pins[] = {GPIOX_4};
  240. static const unsigned int jtag_tms_x_pins[] = {GPIOX_5};
  241. /* eth */
  242. static const unsigned int eth_txd0_x_pins[] = {GPIOX_8};
  243. static const unsigned int eth_txd1_x_pins[] = {GPIOX_9};
  244. static const unsigned int eth_txen_x_pins[] = {GPIOX_10};
  245. static const unsigned int eth_rgmii_rx_clk_x_pins[] = {GPIOX_12};
  246. static const unsigned int eth_rxd0_x_pins[] = {GPIOX_13};
  247. static const unsigned int eth_rxd1_x_pins[] = {GPIOX_14};
  248. static const unsigned int eth_rx_dv_x_pins[] = {GPIOX_15};
  249. static const unsigned int eth_mdio_x_pins[] = {GPIOX_21};
  250. static const unsigned int eth_mdc_x_pins[] = {GPIOX_22};
  251. static const unsigned int eth_txd0_y_pins[] = {GPIOY_10};
  252. static const unsigned int eth_txd1_y_pins[] = {GPIOY_11};
  253. static const unsigned int eth_txen_y_pins[] = {GPIOY_9};
  254. static const unsigned int eth_rgmii_rx_clk_y_pins[] = {GPIOY_2};
  255. static const unsigned int eth_rxd0_y_pins[] = {GPIOY_4};
  256. static const unsigned int eth_rxd1_y_pins[] = {GPIOY_5};
  257. static const unsigned int eth_rx_dv_y_pins[] = {GPIOY_3};
  258. static const unsigned int eth_mdio_y_pins[] = {GPIOY_0};
  259. static const unsigned int eth_mdc_y_pins[] = {GPIOY_1};
  260. static const unsigned int eth_rxd2_rgmii_pins[] = {GPIOY_6};
  261. static const unsigned int eth_rxd3_rgmii_pins[] = {GPIOY_7};
  262. static const unsigned int eth_rgmii_tx_clk_pins[] = {GPIOY_8};
  263. static const unsigned int eth_txd2_rgmii_pins[] = {GPIOY_12};
  264. static const unsigned int eth_txd3_rgmii_pins[] = {GPIOY_13};
  265. /* pdm */
  266. static const unsigned int pdm_dclk_a14_pins[] = {GPIOA_14};
  267. static const unsigned int pdm_dclk_a19_pins[] = {GPIOA_19};
  268. static const unsigned int pdm_din0_pins[] = {GPIOA_15};
  269. static const unsigned int pdm_din1_pins[] = {GPIOA_16};
  270. static const unsigned int pdm_din2_pins[] = {GPIOA_17};
  271. static const unsigned int pdm_din3_pins[] = {GPIOA_18};
  272. static struct meson_pmx_group meson_axg_periphs_groups[] = {
  273. GPIO_GROUP(GPIOZ_0),
  274. GPIO_GROUP(GPIOZ_1),
  275. GPIO_GROUP(GPIOZ_2),
  276. GPIO_GROUP(GPIOZ_3),
  277. GPIO_GROUP(GPIOZ_4),
  278. GPIO_GROUP(GPIOZ_5),
  279. GPIO_GROUP(GPIOZ_6),
  280. GPIO_GROUP(GPIOZ_7),
  281. GPIO_GROUP(GPIOZ_8),
  282. GPIO_GROUP(GPIOZ_9),
  283. GPIO_GROUP(GPIOZ_10),
  284. GPIO_GROUP(BOOT_0),
  285. GPIO_GROUP(BOOT_1),
  286. GPIO_GROUP(BOOT_2),
  287. GPIO_GROUP(BOOT_3),
  288. GPIO_GROUP(BOOT_4),
  289. GPIO_GROUP(BOOT_5),
  290. GPIO_GROUP(BOOT_6),
  291. GPIO_GROUP(BOOT_7),
  292. GPIO_GROUP(BOOT_8),
  293. GPIO_GROUP(BOOT_9),
  294. GPIO_GROUP(BOOT_10),
  295. GPIO_GROUP(BOOT_11),
  296. GPIO_GROUP(BOOT_12),
  297. GPIO_GROUP(BOOT_13),
  298. GPIO_GROUP(BOOT_14),
  299. GPIO_GROUP(GPIOA_0),
  300. GPIO_GROUP(GPIOA_1),
  301. GPIO_GROUP(GPIOA_2),
  302. GPIO_GROUP(GPIOA_3),
  303. GPIO_GROUP(GPIOA_4),
  304. GPIO_GROUP(GPIOA_5),
  305. GPIO_GROUP(GPIOA_6),
  306. GPIO_GROUP(GPIOA_7),
  307. GPIO_GROUP(GPIOA_8),
  308. GPIO_GROUP(GPIOA_9),
  309. GPIO_GROUP(GPIOA_10),
  310. GPIO_GROUP(GPIOA_11),
  311. GPIO_GROUP(GPIOA_12),
  312. GPIO_GROUP(GPIOA_13),
  313. GPIO_GROUP(GPIOA_14),
  314. GPIO_GROUP(GPIOA_15),
  315. GPIO_GROUP(GPIOA_16),
  316. GPIO_GROUP(GPIOA_17),
  317. GPIO_GROUP(GPIOA_19),
  318. GPIO_GROUP(GPIOA_20),
  319. GPIO_GROUP(GPIOX_0),
  320. GPIO_GROUP(GPIOX_1),
  321. GPIO_GROUP(GPIOX_2),
  322. GPIO_GROUP(GPIOX_3),
  323. GPIO_GROUP(GPIOX_4),
  324. GPIO_GROUP(GPIOX_5),
  325. GPIO_GROUP(GPIOX_6),
  326. GPIO_GROUP(GPIOX_7),
  327. GPIO_GROUP(GPIOX_8),
  328. GPIO_GROUP(GPIOX_9),
  329. GPIO_GROUP(GPIOX_10),
  330. GPIO_GROUP(GPIOX_11),
  331. GPIO_GROUP(GPIOX_12),
  332. GPIO_GROUP(GPIOX_13),
  333. GPIO_GROUP(GPIOX_14),
  334. GPIO_GROUP(GPIOX_15),
  335. GPIO_GROUP(GPIOX_16),
  336. GPIO_GROUP(GPIOX_17),
  337. GPIO_GROUP(GPIOX_18),
  338. GPIO_GROUP(GPIOX_19),
  339. GPIO_GROUP(GPIOX_20),
  340. GPIO_GROUP(GPIOX_21),
  341. GPIO_GROUP(GPIOX_22),
  342. GPIO_GROUP(GPIOY_0),
  343. GPIO_GROUP(GPIOY_1),
  344. GPIO_GROUP(GPIOY_2),
  345. GPIO_GROUP(GPIOY_3),
  346. GPIO_GROUP(GPIOY_4),
  347. GPIO_GROUP(GPIOY_5),
  348. GPIO_GROUP(GPIOY_6),
  349. GPIO_GROUP(GPIOY_7),
  350. GPIO_GROUP(GPIOY_8),
  351. GPIO_GROUP(GPIOY_9),
  352. GPIO_GROUP(GPIOY_10),
  353. GPIO_GROUP(GPIOY_11),
  354. GPIO_GROUP(GPIOY_12),
  355. GPIO_GROUP(GPIOY_13),
  356. GPIO_GROUP(GPIOY_14),
  357. GPIO_GROUP(GPIOY_15),
  358. /* bank BOOT */
  359. GROUP(emmc_nand_d0, 1),
  360. GROUP(emmc_nand_d1, 1),
  361. GROUP(emmc_nand_d2, 1),
  362. GROUP(emmc_nand_d3, 1),
  363. GROUP(emmc_nand_d4, 1),
  364. GROUP(emmc_nand_d5, 1),
  365. GROUP(emmc_nand_d6, 1),
  366. GROUP(emmc_nand_d7, 1),
  367. GROUP(emmc_clk, 1),
  368. GROUP(emmc_cmd, 1),
  369. GROUP(emmc_ds, 1),
  370. GROUP(nand_ce0, 2),
  371. GROUP(nand_ale, 2),
  372. GROUP(nand_cle, 2),
  373. GROUP(nand_wen_clk, 2),
  374. GROUP(nand_ren_wr, 2),
  375. GROUP(nand_rb0, 2),
  376. GROUP(nor_hold, 3),
  377. GROUP(nor_d, 3),
  378. GROUP(nor_q, 3),
  379. GROUP(nor_c, 3),
  380. GROUP(nor_wp, 3),
  381. GROUP(nor_cs, 3),
  382. /* bank GPIOZ */
  383. GROUP(spi0_clk, 1),
  384. GROUP(spi0_mosi, 1),
  385. GROUP(spi0_miso, 1),
  386. GROUP(spi0_ss0, 1),
  387. GROUP(spi0_ss1, 1),
  388. GROUP(spi0_ss2, 1),
  389. GROUP(i2c0_sck, 1),
  390. GROUP(i2c0_sda, 1),
  391. GROUP(i2c1_sck_z, 1),
  392. GROUP(i2c1_sda_z, 1),
  393. GROUP(uart_rts_b_z, 2),
  394. GROUP(uart_cts_b_z, 2),
  395. GROUP(uart_tx_b_z, 2),
  396. GROUP(uart_rx_b_z, 2),
  397. GROUP(pwm_a_z, 2),
  398. GROUP(pwm_b_z, 2),
  399. GROUP(spdif_in_z, 3),
  400. GROUP(spdif_out_z, 3),
  401. GROUP(uart_ao_tx_b_z, 2),
  402. GROUP(uart_ao_rx_b_z, 2),
  403. GROUP(uart_ao_cts_b_z, 2),
  404. GROUP(uart_ao_rts_b_z, 2),
  405. /* bank GPIOX */
  406. GROUP(sdio_d0, 1),
  407. GROUP(sdio_d1, 1),
  408. GROUP(sdio_d2, 1),
  409. GROUP(sdio_d3, 1),
  410. GROUP(sdio_clk, 1),
  411. GROUP(sdio_cmd, 1),
  412. GROUP(i2c1_sck_x, 1),
  413. GROUP(i2c1_sda_x, 1),
  414. GROUP(i2c2_sck_x, 1),
  415. GROUP(i2c2_sda_x, 1),
  416. GROUP(uart_rts_a, 1),
  417. GROUP(uart_cts_a, 1),
  418. GROUP(uart_tx_a, 1),
  419. GROUP(uart_rx_a, 1),
  420. GROUP(uart_rts_b_x, 2),
  421. GROUP(uart_cts_b_x, 2),
  422. GROUP(uart_tx_b_x, 2),
  423. GROUP(uart_rx_b_x, 2),
  424. GROUP(jtag_tdo_x, 2),
  425. GROUP(jtag_tdi_x, 2),
  426. GROUP(jtag_clk_x, 2),
  427. GROUP(jtag_tms_x, 2),
  428. GROUP(spi1_clk_x, 4),
  429. GROUP(spi1_mosi_x, 4),
  430. GROUP(spi1_miso_x, 4),
  431. GROUP(spi1_ss0_x, 4),
  432. GROUP(pwm_a_x18, 3),
  433. GROUP(pwm_a_x20, 1),
  434. GROUP(pwm_b_x, 3),
  435. GROUP(pwm_c_x10, 3),
  436. GROUP(pwm_c_x17, 3),
  437. GROUP(pwm_d_x11, 3),
  438. GROUP(pwm_d_x16, 3),
  439. GROUP(eth_txd0_x, 4),
  440. GROUP(eth_txd1_x, 4),
  441. GROUP(eth_txen_x, 4),
  442. GROUP(eth_rgmii_rx_clk_x, 4),
  443. GROUP(eth_rxd0_x, 4),
  444. GROUP(eth_rxd1_x, 4),
  445. GROUP(eth_rx_dv_x, 4),
  446. GROUP(eth_mdio_x, 4),
  447. GROUP(eth_mdc_x, 4),
  448. /* bank GPIOY */
  449. GROUP(eth_txd0_y, 1),
  450. GROUP(eth_txd1_y, 1),
  451. GROUP(eth_txen_y, 1),
  452. GROUP(eth_rgmii_rx_clk_y, 1),
  453. GROUP(eth_rxd0_y, 1),
  454. GROUP(eth_rxd1_y, 1),
  455. GROUP(eth_rx_dv_y, 1),
  456. GROUP(eth_mdio_y, 1),
  457. GROUP(eth_mdc_y, 1),
  458. GROUP(eth_rxd2_rgmii, 1),
  459. GROUP(eth_rxd3_rgmii, 1),
  460. GROUP(eth_rgmii_tx_clk, 1),
  461. GROUP(eth_txd2_rgmii, 1),
  462. GROUP(eth_txd3_rgmii, 1),
  463. /* bank GPIOA */
  464. GROUP(spdif_out_a1, 4),
  465. GROUP(spdif_out_a11, 3),
  466. GROUP(spdif_out_a19, 2),
  467. GROUP(spdif_out_a20, 1),
  468. GROUP(spdif_in_a1, 3),
  469. GROUP(spdif_in_a7, 3),
  470. GROUP(spdif_in_a19, 1),
  471. GROUP(spdif_in_a20, 2),
  472. GROUP(spi1_clk_a, 3),
  473. GROUP(spi1_mosi_a, 3),
  474. GROUP(spi1_miso_a, 3),
  475. GROUP(spi1_ss0_a, 3),
  476. GROUP(spi1_ss1, 3),
  477. GROUP(pwm_a_a, 3),
  478. GROUP(pwm_b_a, 3),
  479. GROUP(pwm_c_a, 3),
  480. GROUP(pwm_vs, 2),
  481. GROUP(i2c2_sda_a, 3),
  482. GROUP(i2c2_sck_a, 3),
  483. GROUP(i2c3_sda_a6, 4),
  484. GROUP(i2c3_sck_a7, 4),
  485. GROUP(i2c3_sda_a12, 4),
  486. GROUP(i2c3_sck_a13, 4),
  487. GROUP(i2c3_sda_a19, 4),
  488. GROUP(i2c3_sck_a20, 4),
  489. GROUP(pdm_dclk_a14, 1),
  490. GROUP(pdm_dclk_a19, 3),
  491. GROUP(pdm_din0, 1),
  492. GROUP(pdm_din1, 1),
  493. GROUP(pdm_din2, 1),
  494. GROUP(pdm_din3, 1),
  495. };
  496. /* uart_ao_a */
  497. static const unsigned int uart_ao_tx_a_pins[] = {GPIOAO_0};
  498. static const unsigned int uart_ao_rx_a_pins[] = {GPIOAO_1};
  499. static const unsigned int uart_ao_cts_a_pins[] = {GPIOAO_2};
  500. static const unsigned int uart_ao_rts_a_pins[] = {GPIOAO_3};
  501. /* uart_ao_b */
  502. static const unsigned int uart_ao_tx_b_pins[] = {GPIOAO_4};
  503. static const unsigned int uart_ao_rx_b_pins[] = {GPIOAO_5};
  504. static const unsigned int uart_ao_cts_b_pins[] = {GPIOAO_2};
  505. static const unsigned int uart_ao_rts_b_pins[] = {GPIOAO_3};
  506. /* i2c_ao */
  507. static const unsigned int i2c_ao_sck_4_pins[] = {GPIOAO_4};
  508. static const unsigned int i2c_ao_sda_5_pins[] = {GPIOAO_5};
  509. static const unsigned int i2c_ao_sck_8_pins[] = {GPIOAO_8};
  510. static const unsigned int i2c_ao_sda_9_pins[] = {GPIOAO_9};
  511. static const unsigned int i2c_ao_sck_10_pins[] = {GPIOAO_10};
  512. static const unsigned int i2c_ao_sda_11_pins[] = {GPIOAO_11};
  513. /* i2c_ao_slave */
  514. static const unsigned int i2c_ao_slave_sck_pins[] = {GPIOAO_10};
  515. static const unsigned int i2c_ao_slave_sda_pins[] = {GPIOAO_11};
  516. /* ir_in */
  517. static const unsigned int remote_input_ao_pins[] = {GPIOAO_6};
  518. /* ir_out */
  519. static const unsigned int remote_out_ao_pins[] = {GPIOAO_7};
  520. /* pwm_ao_a */
  521. static const unsigned int pwm_ao_a_pins[] = {GPIOAO_3};
  522. /* pwm_ao_b */
  523. static const unsigned int pwm_ao_b_ao2_pins[] = {GPIOAO_2};
  524. static const unsigned int pwm_ao_b_ao12_pins[] = {GPIOAO_12};
  525. /* pwm_ao_c */
  526. static const unsigned int pwm_ao_c_ao8_pins[] = {GPIOAO_8};
  527. static const unsigned int pwm_ao_c_ao13_pins[] = {GPIOAO_13};
  528. /* pwm_ao_d */
  529. static const unsigned int pwm_ao_d_pins[] = {GPIOAO_9};
  530. /* jtag_ao */
  531. static const unsigned int jtag_ao_tdi_pins[] = {GPIOAO_3};
  532. static const unsigned int jtag_ao_tdo_pins[] = {GPIOAO_4};
  533. static const unsigned int jtag_ao_clk_pins[] = {GPIOAO_5};
  534. static const unsigned int jtag_ao_tms_pins[] = {GPIOAO_7};
  535. static struct meson_pmx_group meson_axg_aobus_groups[] = {
  536. GPIO_GROUP(GPIOAO_0),
  537. GPIO_GROUP(GPIOAO_1),
  538. GPIO_GROUP(GPIOAO_2),
  539. GPIO_GROUP(GPIOAO_3),
  540. GPIO_GROUP(GPIOAO_4),
  541. GPIO_GROUP(GPIOAO_5),
  542. GPIO_GROUP(GPIOAO_6),
  543. GPIO_GROUP(GPIOAO_7),
  544. GPIO_GROUP(GPIOAO_8),
  545. GPIO_GROUP(GPIOAO_9),
  546. GPIO_GROUP(GPIOAO_10),
  547. GPIO_GROUP(GPIOAO_11),
  548. GPIO_GROUP(GPIOAO_12),
  549. GPIO_GROUP(GPIOAO_13),
  550. GPIO_GROUP(GPIO_TEST_N),
  551. /* bank AO */
  552. GROUP(uart_ao_tx_a, 1),
  553. GROUP(uart_ao_rx_a, 1),
  554. GROUP(uart_ao_cts_a, 2),
  555. GROUP(uart_ao_rts_a, 2),
  556. GROUP(uart_ao_tx_b, 1),
  557. GROUP(uart_ao_rx_b, 1),
  558. GROUP(uart_ao_cts_b, 1),
  559. GROUP(uart_ao_rts_b, 1),
  560. GROUP(i2c_ao_sck_4, 2),
  561. GROUP(i2c_ao_sda_5, 2),
  562. GROUP(i2c_ao_sck_8, 2),
  563. GROUP(i2c_ao_sda_9, 2),
  564. GROUP(i2c_ao_sck_10, 2),
  565. GROUP(i2c_ao_sda_11, 2),
  566. GROUP(i2c_ao_slave_sck, 1),
  567. GROUP(i2c_ao_slave_sda, 1),
  568. GROUP(remote_input_ao, 1),
  569. GROUP(remote_out_ao, 1),
  570. GROUP(pwm_ao_a, 3),
  571. GROUP(pwm_ao_b_ao2, 3),
  572. GROUP(pwm_ao_b_ao12, 3),
  573. GROUP(pwm_ao_c_ao8, 3),
  574. GROUP(pwm_ao_c_ao13, 3),
  575. GROUP(pwm_ao_d, 3),
  576. GROUP(jtag_ao_tdi, 4),
  577. GROUP(jtag_ao_tdo, 4),
  578. GROUP(jtag_ao_clk, 4),
  579. GROUP(jtag_ao_tms, 4),
  580. };
  581. static const char * const gpio_periphs_groups[] = {
  582. "GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4",
  583. "GPIOZ_5", "GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9",
  584. "GPIOZ_10",
  585. "BOOT_0", "BOOT_1", "BOOT_2", "BOOT_3", "BOOT_4",
  586. "BOOT_5", "BOOT_6", "BOOT_7", "BOOT_8", "BOOT_9",
  587. "BOOT_10", "BOOT_11", "BOOT_12", "BOOT_13", "BOOT_14",
  588. "GPIOA_0", "GPIOA_1", "GPIOA_2", "GPIOA_3", "GPIOA_4",
  589. "GPIOA_5", "GPIOA_6", "GPIOA_7", "GPIOA_8", "GPIOA_9",
  590. "GPIOA_10", "GPIOA_11", "GPIOA_12", "GPIOA_13", "GPIOA_14",
  591. "GPIOA_15", "GPIOA_16", "GPIOA_17", "GPIOA_18", "GPIOA_19",
  592. "GPIOA_20",
  593. "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4",
  594. "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9",
  595. "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14",
  596. "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18", "GPIOX_19",
  597. "GPIOX_20", "GPIOX_21", "GPIOX_22",
  598. "GPIOY_0", "GPIOY_1", "GPIOY_2", "GPIOY_3", "GPIOY_4",
  599. "GPIOY_5", "GPIOY_6", "GPIOY_7", "GPIOY_8", "GPIOY_9",
  600. "GPIOY_10", "GPIOY_11", "GPIOY_12", "GPIOY_13", "GPIOY_14",
  601. "GPIOY_15",
  602. };
  603. static const char * const emmc_groups[] = {
  604. "emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2",
  605. "emmc_nand_d3", "emmc_nand_d4", "emmc_nand_d5",
  606. "emmc_nand_d6", "emmc_nand_d7",
  607. "emmc_clk", "emmc_cmd", "emmc_ds",
  608. };
  609. static const char * const nand_groups[] = {
  610. "emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2",
  611. "emmc_nand_d3", "emmc_nand_d4", "emmc_nand_d5",
  612. "emmc_nand_d6", "emmc_nand_d7",
  613. "nand_ce0", "nand_ale", "nand_cle",
  614. "nand_wen_clk", "nand_ren_wr", "nand_rb0",
  615. };
  616. static const char * const nor_groups[] = {
  617. "nor_d", "nor_q", "nor_c", "nor_cs",
  618. "nor_hold", "nor_wp",
  619. };
  620. static const char * const sdio_groups[] = {
  621. "sdio_d0", "sdio_d1", "sdio_d2", "sdio_d3",
  622. "sdio_cmd", "sdio_clk",
  623. };
  624. static const char * const spi0_groups[] = {
  625. "spi0_clk", "spi0_mosi", "spi0_miso", "spi0_ss0",
  626. "spi0_ss1", "spi0_ss2"
  627. };
  628. static const char * const spi1_groups[] = {
  629. "spi1_clk_x", "spi1_mosi_x", "spi1_miso_x", "spi1_ss0_x",
  630. "spi1_clk_a", "spi1_mosi_a", "spi1_miso_a", "spi1_ss0_a",
  631. "spi1_ss1"
  632. };
  633. static const char * const uart_a_groups[] = {
  634. "uart_tx_a", "uart_rx_a", "uart_cts_a", "uart_rts_a",
  635. };
  636. static const char * const uart_b_groups[] = {
  637. "uart_tx_b_z", "uart_rx_b_z", "uart_cts_b_z", "uart_rts_b_z",
  638. "uart_tx_b_x", "uart_rx_b_x", "uart_cts_b_x", "uart_rts_b_x",
  639. };
  640. static const char * const uart_ao_b_z_groups[] = {
  641. "uart_ao_tx_b_z", "uart_ao_rx_b_z",
  642. "uart_ao_cts_b_z", "uart_ao_rts_b_z",
  643. };
  644. static const char * const i2c0_groups[] = {
  645. "i2c0_sck", "i2c0_sda",
  646. };
  647. static const char * const i2c1_groups[] = {
  648. "i2c1_sck_z", "i2c1_sda_z",
  649. "i2c1_sck_x", "i2c1_sda_x",
  650. };
  651. static const char * const i2c2_groups[] = {
  652. "i2c2_sck_x", "i2c2_sda_x",
  653. "i2c2_sda_a", "i2c2_sck_a",
  654. };
  655. static const char * const i2c3_groups[] = {
  656. "i2c3_sda_a6", "i2c3_sck_a7",
  657. "i2c3_sda_a12", "i2c3_sck_a13",
  658. "i2c3_sda_a19", "i2c3_sck_a20",
  659. };
  660. static const char * const eth_groups[] = {
  661. "eth_rxd2_rgmii", "eth_rxd3_rgmii", "eth_rgmii_tx_clk",
  662. "eth_txd2_rgmii", "eth_txd3_rgmii",
  663. "eth_txd0_x", "eth_txd1_x", "eth_txen_x", "eth_rgmii_rx_clk_x",
  664. "eth_rxd0_x", "eth_rxd1_x", "eth_rx_dv_x", "eth_mdio_x",
  665. "eth_mdc_x",
  666. "eth_txd0_y", "eth_txd1_y", "eth_txen_y", "eth_rgmii_rx_clk_y",
  667. "eth_rxd0_y", "eth_rxd1_y", "eth_rx_dv_y", "eth_mdio_y",
  668. "eth_mdc_y",
  669. };
  670. static const char * const pwm_a_groups[] = {
  671. "pwm_a_z", "pwm_a_x18", "pwm_a_x20", "pwm_a_a",
  672. };
  673. static const char * const pwm_b_groups[] = {
  674. "pwm_b_z", "pwm_b_x", "pwm_b_a",
  675. };
  676. static const char * const pwm_c_groups[] = {
  677. "pwm_c_x10", "pwm_c_x17", "pwm_c_a",
  678. };
  679. static const char * const pwm_d_groups[] = {
  680. "pwm_d_x11", "pwm_d_x16",
  681. };
  682. static const char * const pwm_vs_groups[] = {
  683. "pwm_vs",
  684. };
  685. static const char * const spdif_out_groups[] = {
  686. "spdif_out_z", "spdif_out_a1", "spdif_out_a11",
  687. "spdif_out_a19", "spdif_out_a20",
  688. };
  689. static const char * const spdif_in_groups[] = {
  690. "spdif_in_z", "spdif_in_a1", "spdif_in_a7",
  691. "spdif_in_a19", "spdif_in_a20",
  692. };
  693. static const char * const jtag_ee_groups[] = {
  694. "jtag_tdo_x", "jtag_tdi_x", "jtag_clk_x",
  695. "jtag_tms_x",
  696. };
  697. static const char * const pdm_groups[] = {
  698. "pdm_din0", "pdm_din1", "pdm_din2", "pdm_din3",
  699. "pdm_dclk_a14", "pdm_dclk_a19",
  700. };
  701. static const char * const gpio_aobus_groups[] = {
  702. "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4",
  703. "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9",
  704. "GPIOAO_10", "GPIOAO_11", "GPIOAO_12", "GPIOAO_13",
  705. "GPIO_TEST_N",
  706. };
  707. static const char * const uart_ao_a_groups[] = {
  708. "uart_ao_tx_a", "uart_ao_rx_a", "uart_ao_cts_a", "uart_ao_rts_a",
  709. };
  710. static const char * const uart_ao_b_groups[] = {
  711. "uart_ao_tx_b", "uart_ao_rx_b", "uart_ao_cts_b", "uart_ao_rts_b",
  712. };
  713. static const char * const i2c_ao_groups[] = {
  714. "i2c_ao_sck_4", "i2c_ao_sda_5",
  715. "i2c_ao_sck_8", "i2c_ao_sda_9",
  716. "i2c_ao_sck_10", "i2c_ao_sda_11",
  717. };
  718. static const char * const i2c_ao_slave_groups[] = {
  719. "i2c_ao_slave_sck", "i2c_ao_slave_sda",
  720. };
  721. static const char * const remote_input_ao_groups[] = {
  722. "remote_input_ao",
  723. };
  724. static const char * const remote_out_ao_groups[] = {
  725. "remote_out_ao",
  726. };
  727. static const char * const pwm_ao_a_groups[] = {
  728. "pwm_ao_a",
  729. };
  730. static const char * const pwm_ao_b_groups[] = {
  731. "pwm_ao_b_ao2", "pwm_ao_b_ao12",
  732. };
  733. static const char * const pwm_ao_c_groups[] = {
  734. "pwm_ao_c_ao8", "pwm_ao_c_ao13",
  735. };
  736. static const char * const pwm_ao_d_groups[] = {
  737. "pwm_ao_d",
  738. };
  739. static const char * const jtag_ao_groups[] = {
  740. "jtag_ao_tdi", "jtag_ao_tdo", "jtag_ao_clk", "jtag_ao_tms",
  741. };
  742. static struct meson_pmx_func meson_axg_periphs_functions[] = {
  743. FUNCTION(gpio_periphs),
  744. FUNCTION(emmc),
  745. FUNCTION(nor),
  746. FUNCTION(spi0),
  747. FUNCTION(spi1),
  748. FUNCTION(sdio),
  749. FUNCTION(nand),
  750. FUNCTION(uart_a),
  751. FUNCTION(uart_b),
  752. FUNCTION(uart_ao_b_z),
  753. FUNCTION(i2c0),
  754. FUNCTION(i2c1),
  755. FUNCTION(i2c2),
  756. FUNCTION(i2c3),
  757. FUNCTION(eth),
  758. FUNCTION(pwm_a),
  759. FUNCTION(pwm_b),
  760. FUNCTION(pwm_c),
  761. FUNCTION(pwm_d),
  762. FUNCTION(pwm_vs),
  763. FUNCTION(spdif_out),
  764. FUNCTION(spdif_in),
  765. FUNCTION(jtag_ee),
  766. FUNCTION(pdm),
  767. };
  768. static struct meson_pmx_func meson_axg_aobus_functions[] = {
  769. FUNCTION(gpio_aobus),
  770. FUNCTION(uart_ao_a),
  771. FUNCTION(uart_ao_b),
  772. FUNCTION(i2c_ao),
  773. FUNCTION(i2c_ao_slave),
  774. FUNCTION(remote_input_ao),
  775. FUNCTION(remote_out_ao),
  776. FUNCTION(pwm_ao_a),
  777. FUNCTION(pwm_ao_b),
  778. FUNCTION(pwm_ao_c),
  779. FUNCTION(pwm_ao_d),
  780. FUNCTION(jtag_ao),
  781. };
  782. static struct meson_bank meson_axg_periphs_banks[] = {
  783. /* name first last irq pullen pull dir out in */
  784. BANK("Z", GPIOZ_0, GPIOZ_10, 14, 24, 3, 0, 3, 0, 9, 0, 10, 0, 11, 0),
  785. BANK("BOOT", BOOT_0, BOOT_14, 25, 39, 4, 0, 4, 0, 12, 0, 13, 0, 14, 0),
  786. BANK("A", GPIOA_0, GPIOA_20, 40, 60, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0),
  787. BANK("X", GPIOX_0, GPIOX_22, 61, 83, 2, 0, 2, 0, 6, 0, 7, 0, 8, 0),
  788. BANK("Y", GPIOY_0, GPIOY_15, 84, 99, 1, 0, 1, 0, 3, 0, 4, 0, 5, 0),
  789. };
  790. static struct meson_bank meson_axg_aobus_banks[] = {
  791. /* name first last irq pullen pull dir out in */
  792. BANK("AO", GPIOAO_0, GPIOAO_9, 0, 13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
  793. };
  794. static struct meson_pmx_bank meson_axg_periphs_pmx_banks[] = {
  795. /* name first lask reg offset */
  796. BANK_PMX("Z", GPIOZ_0, GPIOZ_10, 0x2, 0),
  797. BANK_PMX("BOOT", BOOT_0, BOOT_14, 0x0, 0),
  798. BANK_PMX("A", GPIOA_0, GPIOA_20, 0xb, 0),
  799. BANK_PMX("X", GPIOX_0, GPIOX_22, 0x4, 0),
  800. BANK_PMX("Y", GPIOY_0, GPIOY_15, 0x8, 0),
  801. };
  802. static struct meson_axg_pmx_data meson_axg_periphs_pmx_banks_data = {
  803. .pmx_banks = meson_axg_periphs_pmx_banks,
  804. .num_pmx_banks = ARRAY_SIZE(meson_axg_periphs_pmx_banks),
  805. };
  806. static struct meson_pmx_bank meson_axg_aobus_pmx_banks[] = {
  807. BANK_PMX("AO", GPIOAO_0, GPIOAO_13, 0x0, 0),
  808. };
  809. static struct meson_axg_pmx_data meson_axg_aobus_pmx_banks_data = {
  810. .pmx_banks = meson_axg_aobus_pmx_banks,
  811. .num_pmx_banks = ARRAY_SIZE(meson_axg_aobus_pmx_banks),
  812. };
  813. static struct meson_pinctrl_data meson_axg_periphs_pinctrl_data = {
  814. .name = "periphs-banks",
  815. .pins = meson_axg_periphs_pins,
  816. .groups = meson_axg_periphs_groups,
  817. .funcs = meson_axg_periphs_functions,
  818. .banks = meson_axg_periphs_banks,
  819. .num_pins = ARRAY_SIZE(meson_axg_periphs_pins),
  820. .num_groups = ARRAY_SIZE(meson_axg_periphs_groups),
  821. .num_funcs = ARRAY_SIZE(meson_axg_periphs_functions),
  822. .num_banks = ARRAY_SIZE(meson_axg_periphs_banks),
  823. .pmx_ops = &meson_axg_pmx_ops,
  824. .pmx_data = &meson_axg_periphs_pmx_banks_data,
  825. };
  826. static struct meson_pinctrl_data meson_axg_aobus_pinctrl_data = {
  827. .name = "aobus-banks",
  828. .pins = meson_axg_aobus_pins,
  829. .groups = meson_axg_aobus_groups,
  830. .funcs = meson_axg_aobus_functions,
  831. .banks = meson_axg_aobus_banks,
  832. .num_pins = ARRAY_SIZE(meson_axg_aobus_pins),
  833. .num_groups = ARRAY_SIZE(meson_axg_aobus_groups),
  834. .num_funcs = ARRAY_SIZE(meson_axg_aobus_functions),
  835. .num_banks = ARRAY_SIZE(meson_axg_aobus_banks),
  836. .pmx_ops = &meson_axg_pmx_ops,
  837. .pmx_data = &meson_axg_aobus_pmx_banks_data,
  838. };
  839. static const struct of_device_id meson_axg_pinctrl_dt_match[] = {
  840. {
  841. .compatible = "amlogic,meson-axg-periphs-pinctrl",
  842. .data = &meson_axg_periphs_pinctrl_data,
  843. },
  844. {
  845. .compatible = "amlogic,meson-axg-aobus-pinctrl",
  846. .data = &meson_axg_aobus_pinctrl_data,
  847. },
  848. { },
  849. };
  850. static struct platform_driver meson_axg_pinctrl_driver = {
  851. .probe = meson_pinctrl_probe,
  852. .driver = {
  853. .name = "meson-axg-pinctrl",
  854. .of_match_table = meson_axg_pinctrl_dt_match,
  855. },
  856. };
  857. builtin_platform_driver(meson_axg_pinctrl_driver);