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