1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
3 * Pin controller and GPIO driver for Amlogic Meson G12A SoC.
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>
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"
15 static const struct pinctrl_pin_desc meson_g12a_periphs_pins
[] = {
103 static const struct pinctrl_pin_desc meson_g12a_aobus_pins
[] = {
114 MESON_PIN(GPIOAO_10
),
115 MESON_PIN(GPIOAO_11
),
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
};
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
};
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
};
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
};
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
};
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
};
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
};
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
};
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
};
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
};
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
};
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
};
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
};
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
};
226 static const unsigned int uart_b_tx_pins
[] = { GPIOX_6
};
227 static const unsigned int uart_b_rx_pins
[] = { GPIOX_7
};
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
};
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
};
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
};
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
};
268 static const unsigned int pwm_a_pins
[] = { GPIOX_6
};
271 static const unsigned int pwm_b_x7_pins
[] = { GPIOX_7
};
272 static const unsigned int pwm_b_x19_pins
[] = { GPIOX_19
};
275 static const unsigned int pwm_c_c_pins
[] = { GPIOC_4
};
276 static const unsigned int pwm_c_x5_pins
[] = { GPIOX_5
};
277 static const unsigned int pwm_c_x8_pins
[] = { GPIOX_8
};
280 static const unsigned int pwm_d_x3_pins
[] = { GPIOX_3
};
281 static const unsigned int pwm_d_x6_pins
[] = { GPIOX_6
};
284 static const unsigned int pwm_e_pins
[] = { GPIOX_16
};
287 static const unsigned int pwm_f_z_pins
[] = { GPIOZ_12
};
288 static const unsigned int pwm_f_a_pins
[] = { GPIOA_11
};
289 static const unsigned int pwm_f_x_pins
[] = { GPIOX_7
};
290 static const unsigned int pwm_f_h_pins
[] = { GPIOH_5
};
293 static const unsigned int cec_ao_a_h_pins
[] = { GPIOH_3
};
294 static const unsigned int cec_ao_b_h_pins
[] = { GPIOH_3
};
297 static const unsigned int jtag_b_tdo_pins
[] = { GPIOC_0
};
298 static const unsigned int jtag_b_tdi_pins
[] = { GPIOC_1
};
299 static const unsigned int jtag_b_clk_pins
[] = { GPIOC_4
};
300 static const unsigned int jtag_b_tms_pins
[] = { GPIOC_5
};
303 static const unsigned int bt565_a_vs_pins
[] = { GPIOZ_0
};
304 static const unsigned int bt565_a_hs_pins
[] = { GPIOZ_1
};
305 static const unsigned int bt565_a_clk_pins
[] = { GPIOZ_3
};
306 static const unsigned int bt565_a_din0_pins
[] = { GPIOZ_4
};
307 static const unsigned int bt565_a_din1_pins
[] = { GPIOZ_5
};
308 static const unsigned int bt565_a_din2_pins
[] = { GPIOZ_6
};
309 static const unsigned int bt565_a_din3_pins
[] = { GPIOZ_7
};
310 static const unsigned int bt565_a_din4_pins
[] = { GPIOZ_8
};
311 static const unsigned int bt565_a_din5_pins
[] = { GPIOZ_9
};
312 static const unsigned int bt565_a_din6_pins
[] = { GPIOZ_10
};
313 static const unsigned int bt565_a_din7_pins
[] = { GPIOZ_11
};
316 static const unsigned int tsin_a_valid_pins
[] = { GPIOX_2
};
317 static const unsigned int tsin_a_sop_pins
[] = { GPIOX_1
};
318 static const unsigned int tsin_a_din0_pins
[] = { GPIOX_0
};
319 static const unsigned int tsin_a_clk_pins
[] = { GPIOX_3
};
322 static const unsigned int tsin_b_valid_x_pins
[] = { GPIOX_9
};
323 static const unsigned int tsin_b_sop_x_pins
[] = { GPIOX_8
};
324 static const unsigned int tsin_b_din0_x_pins
[] = { GPIOX_10
};
325 static const unsigned int tsin_b_clk_x_pins
[] = { GPIOX_11
};
327 static const unsigned int tsin_b_valid_z_pins
[] = { GPIOZ_2
};
328 static const unsigned int tsin_b_sop_z_pins
[] = { GPIOZ_3
};
329 static const unsigned int tsin_b_din0_z_pins
[] = { GPIOZ_4
};
330 static const unsigned int tsin_b_clk_z_pins
[] = { GPIOZ_5
};
332 static const unsigned int tsin_b_fail_pins
[] = { GPIOZ_6
};
333 static const unsigned int tsin_b_din1_pins
[] = { GPIOZ_7
};
334 static const unsigned int tsin_b_din2_pins
[] = { GPIOZ_8
};
335 static const unsigned int tsin_b_din3_pins
[] = { GPIOZ_9
};
336 static const unsigned int tsin_b_din4_pins
[] = { GPIOZ_10
};
337 static const unsigned int tsin_b_din5_pins
[] = { GPIOZ_11
};
338 static const unsigned int tsin_b_din6_pins
[] = { GPIOZ_12
};
339 static const unsigned int tsin_b_din7_pins
[] = { GPIOZ_13
};
342 static const unsigned int hdmitx_sda_pins
[] = { GPIOH_0
};
343 static const unsigned int hdmitx_sck_pins
[] = { GPIOH_1
};
344 static const unsigned int hdmitx_hpd_in_pins
[] = { GPIOH_2
};
347 static const unsigned int pdm_din0_c_pins
[] = { GPIOC_0
};
348 static const unsigned int pdm_din1_c_pins
[] = { GPIOC_1
};
349 static const unsigned int pdm_din2_c_pins
[] = { GPIOC_2
};
350 static const unsigned int pdm_din3_c_pins
[] = { GPIOC_3
};
351 static const unsigned int pdm_dclk_c_pins
[] = { GPIOC_4
};
353 static const unsigned int pdm_din0_x_pins
[] = { GPIOX_0
};
354 static const unsigned int pdm_din1_x_pins
[] = { GPIOX_1
};
355 static const unsigned int pdm_din2_x_pins
[] = { GPIOX_2
};
356 static const unsigned int pdm_din3_x_pins
[] = { GPIOX_3
};
357 static const unsigned int pdm_dclk_x_pins
[] = { GPIOX_4
};
359 static const unsigned int pdm_din0_z_pins
[] = { GPIOZ_2
};
360 static const unsigned int pdm_din1_z_pins
[] = { GPIOZ_3
};
361 static const unsigned int pdm_din2_z_pins
[] = { GPIOZ_4
};
362 static const unsigned int pdm_din3_z_pins
[] = { GPIOZ_5
};
363 static const unsigned int pdm_dclk_z_pins
[] = { GPIOZ_6
};
365 static const unsigned int pdm_din0_a_pins
[] = { GPIOA_8
};
366 static const unsigned int pdm_din1_a_pins
[] = { GPIOA_9
};
367 static const unsigned int pdm_din2_a_pins
[] = { GPIOA_6
};
368 static const unsigned int pdm_din3_a_pins
[] = { GPIOA_5
};
369 static const unsigned int pdm_dclk_a_pins
[] = { GPIOA_7
};
372 static const unsigned int spdif_in_h_pins
[] = { GPIOH_5
};
373 static const unsigned int spdif_in_a10_pins
[] = { GPIOA_10
};
374 static const unsigned int spdif_in_a12_pins
[] = { GPIOA_12
};
377 static const unsigned int spdif_out_h_pins
[] = { GPIOH_4
};
378 static const unsigned int spdif_out_a11_pins
[] = { GPIOA_11
};
379 static const unsigned int spdif_out_a13_pins
[] = { GPIOA_13
};
382 static const unsigned int mclk0_a_pins
[] = { GPIOA_0
};
385 static const unsigned int mclk1_x_pins
[] = { GPIOX_5
};
386 static const unsigned int mclk1_z_pins
[] = { GPIOZ_8
};
387 static const unsigned int mclk1_a_pins
[] = { GPIOA_11
};
390 static const unsigned int tdm_a_slv_sclk_pins
[] = { GPIOX_11
};
391 static const unsigned int tdm_a_slv_fs_pins
[] = { GPIOX_10
};
392 static const unsigned int tdm_a_sclk_pins
[] = { GPIOX_11
};
393 static const unsigned int tdm_a_fs_pins
[] = { GPIOX_10
};
394 static const unsigned int tdm_a_din0_pins
[] = { GPIOX_9
};
395 static const unsigned int tdm_a_din1_pins
[] = { GPIOX_8
};
396 static const unsigned int tdm_a_dout0_pins
[] = { GPIOX_9
};
397 static const unsigned int tdm_a_dout1_pins
[] = { GPIOX_8
};
399 static const unsigned int tdm_b_slv_sclk_pins
[] = { GPIOA_1
};
400 static const unsigned int tdm_b_slv_fs_pins
[] = { GPIOA_2
};
401 static const unsigned int tdm_b_sclk_pins
[] = { GPIOA_1
};
402 static const unsigned int tdm_b_fs_pins
[] = { GPIOA_2
};
403 static const unsigned int tdm_b_din0_pins
[] = { GPIOA_3
};
404 static const unsigned int tdm_b_din1_pins
[] = { GPIOA_4
};
405 static const unsigned int tdm_b_din2_pins
[] = { GPIOA_5
};
406 static const unsigned int tdm_b_din3_a_pins
[] = { GPIOA_6
};
407 static const unsigned int tdm_b_din3_h_pins
[] = { GPIOH_5
};
408 static const unsigned int tdm_b_dout0_pins
[] = { GPIOA_3
};
409 static const unsigned int tdm_b_dout1_pins
[] = { GPIOA_4
};
410 static const unsigned int tdm_b_dout2_pins
[] = { GPIOA_5
};
411 static const unsigned int tdm_b_dout3_a_pins
[] = { GPIOA_6
};
412 static const unsigned int tdm_b_dout3_h_pins
[] = { GPIOH_5
};
414 static const unsigned int tdm_c_slv_sclk_a_pins
[] = { GPIOA_12
};
415 static const unsigned int tdm_c_slv_fs_a_pins
[] = { GPIOA_13
};
416 static const unsigned int tdm_c_slv_sclk_z_pins
[] = { GPIOZ_7
};
417 static const unsigned int tdm_c_slv_fs_z_pins
[] = { GPIOZ_6
};
418 static const unsigned int tdm_c_sclk_a_pins
[] = { GPIOA_12
};
419 static const unsigned int tdm_c_fs_a_pins
[] = { GPIOA_13
};
420 static const unsigned int tdm_c_sclk_z_pins
[] = { GPIOZ_7
};
421 static const unsigned int tdm_c_fs_z_pins
[] = { GPIOZ_6
};
422 static const unsigned int tdm_c_din0_a_pins
[] = { GPIOA_10
};
423 static const unsigned int tdm_c_din1_a_pins
[] = { GPIOA_9
};
424 static const unsigned int tdm_c_din2_a_pins
[] = { GPIOA_8
};
425 static const unsigned int tdm_c_din3_a_pins
[] = { GPIOA_7
};
426 static const unsigned int tdm_c_din0_z_pins
[] = { GPIOZ_2
};
427 static const unsigned int tdm_c_din1_z_pins
[] = { GPIOZ_3
};
428 static const unsigned int tdm_c_din2_z_pins
[] = { GPIOZ_4
};
429 static const unsigned int tdm_c_din3_z_pins
[] = { GPIOZ_5
};
430 static const unsigned int tdm_c_dout0_a_pins
[] = { GPIOA_10
};
431 static const unsigned int tdm_c_dout1_a_pins
[] = { GPIOA_9
};
432 static const unsigned int tdm_c_dout2_a_pins
[] = { GPIOA_8
};
433 static const unsigned int tdm_c_dout3_a_pins
[] = { GPIOA_7
};
434 static const unsigned int tdm_c_dout0_z_pins
[] = { GPIOZ_2
};
435 static const unsigned int tdm_c_dout1_z_pins
[] = { GPIOZ_3
};
436 static const unsigned int tdm_c_dout2_z_pins
[] = { GPIOZ_4
};
437 static const unsigned int tdm_c_dout3_z_pins
[] = { GPIOZ_5
};
439 static const struct meson_pmx_group meson_g12a_periphs_groups
[] = {
450 GPIO_GROUP(GPIOZ_10
),
451 GPIO_GROUP(GPIOZ_11
),
452 GPIO_GROUP(GPIOZ_12
),
453 GPIO_GROUP(GPIOZ_13
),
454 GPIO_GROUP(GPIOZ_14
),
455 GPIO_GROUP(GPIOZ_15
),
499 GPIO_GROUP(GPIOA_10
),
500 GPIO_GROUP(GPIOA_11
),
501 GPIO_GROUP(GPIOA_12
),
502 GPIO_GROUP(GPIOA_13
),
503 GPIO_GROUP(GPIOA_14
),
504 GPIO_GROUP(GPIOA_15
),
515 GPIO_GROUP(GPIOX_10
),
516 GPIO_GROUP(GPIOX_11
),
517 GPIO_GROUP(GPIOX_12
),
518 GPIO_GROUP(GPIOX_13
),
519 GPIO_GROUP(GPIOX_14
),
520 GPIO_GROUP(GPIOX_15
),
521 GPIO_GROUP(GPIOX_16
),
522 GPIO_GROUP(GPIOX_17
),
523 GPIO_GROUP(GPIOX_18
),
524 GPIO_GROUP(GPIOX_19
),
527 GROUP(emmc_nand_d0
, 1),
528 GROUP(emmc_nand_d1
, 1),
529 GROUP(emmc_nand_d2
, 1),
530 GROUP(emmc_nand_d3
, 1),
531 GROUP(emmc_nand_d4
, 1),
532 GROUP(emmc_nand_d5
, 1),
533 GROUP(emmc_nand_d6
, 1),
534 GROUP(emmc_nand_d7
, 1),
537 GROUP(emmc_nand_ds
, 1),
541 GROUP(nand_wen_clk
, 2),
542 GROUP(nand_ren_wr
, 2),
553 GROUP(sdcard_d0_z
, 5),
554 GROUP(sdcard_d1_z
, 5),
555 GROUP(sdcard_d2_z
, 5),
556 GROUP(sdcard_d3_z
, 5),
557 GROUP(sdcard_clk_z
, 5),
558 GROUP(sdcard_cmd_z
, 5),
559 GROUP(i2c0_sda_z0
, 4),
560 GROUP(i2c0_sck_z1
, 4),
561 GROUP(i2c0_sda_z7
, 7),
562 GROUP(i2c0_sck_z8
, 7),
563 GROUP(i2c2_sda_z
, 3),
564 GROUP(i2c2_sck_z
, 3),
565 GROUP(iso7816_clk_z
, 3),
566 GROUP(iso7816_data_z
, 3),
569 GROUP(eth_rgmii_rx_clk
, 1),
573 GROUP(eth_rxd2_rgmii
, 1),
574 GROUP(eth_rxd3_rgmii
, 1),
575 GROUP(eth_rgmii_tx_clk
, 1),
579 GROUP(eth_txd2_rgmii
, 1),
580 GROUP(eth_txd3_rgmii
, 1),
581 GROUP(eth_link_led
, 1),
582 GROUP(eth_act_led
, 1),
583 GROUP(bt565_a_vs
, 2),
584 GROUP(bt565_a_hs
, 2),
585 GROUP(bt565_a_clk
, 2),
586 GROUP(bt565_a_din0
, 2),
587 GROUP(bt565_a_din1
, 2),
588 GROUP(bt565_a_din2
, 2),
589 GROUP(bt565_a_din3
, 2),
590 GROUP(bt565_a_din4
, 2),
591 GROUP(bt565_a_din5
, 2),
592 GROUP(bt565_a_din6
, 2),
593 GROUP(bt565_a_din7
, 2),
594 GROUP(tsin_b_valid_z
, 3),
595 GROUP(tsin_b_sop_z
, 3),
596 GROUP(tsin_b_din0_z
, 3),
597 GROUP(tsin_b_clk_z
, 3),
598 GROUP(tsin_b_fail
, 3),
599 GROUP(tsin_b_din1
, 3),
600 GROUP(tsin_b_din2
, 3),
601 GROUP(tsin_b_din3
, 3),
602 GROUP(tsin_b_din4
, 3),
603 GROUP(tsin_b_din5
, 3),
604 GROUP(tsin_b_din6
, 3),
605 GROUP(tsin_b_din7
, 3),
606 GROUP(pdm_din0_z
, 7),
607 GROUP(pdm_din1_z
, 7),
608 GROUP(pdm_din2_z
, 7),
609 GROUP(pdm_din3_z
, 7),
610 GROUP(pdm_dclk_z
, 7),
611 GROUP(tdm_c_slv_sclk_z
, 6),
612 GROUP(tdm_c_slv_fs_z
, 6),
613 GROUP(tdm_c_din0_z
, 6),
614 GROUP(tdm_c_din1_z
, 6),
615 GROUP(tdm_c_din2_z
, 6),
616 GROUP(tdm_c_din3_z
, 6),
617 GROUP(tdm_c_sclk_z
, 4),
618 GROUP(tdm_c_fs_z
, 4),
619 GROUP(tdm_c_dout0_z
, 4),
620 GROUP(tdm_c_dout1_z
, 4),
621 GROUP(tdm_c_dout2_z
, 4),
622 GROUP(tdm_c_dout3_z
, 4),
633 GROUP(spi0_mosi_x
, 4),
634 GROUP(spi0_miso_x
, 4),
635 GROUP(spi0_ss0_x
, 4),
636 GROUP(spi0_clk_x
, 4),
637 GROUP(i2c1_sda_x
, 5),
638 GROUP(i2c1_sck_x
, 5),
639 GROUP(i2c2_sda_x
, 1),
640 GROUP(i2c2_sck_x
, 1),
643 GROUP(uart_a_cts
, 1),
644 GROUP(uart_a_rts
, 1),
647 GROUP(iso7816_clk_x
, 6),
648 GROUP(iso7816_data_x
, 6),
658 GROUP(tsin_a_valid
, 3),
659 GROUP(tsin_a_sop
, 3),
660 GROUP(tsin_a_din0
, 3),
661 GROUP(tsin_a_clk
, 3),
662 GROUP(tsin_b_valid_x
, 3),
663 GROUP(tsin_b_sop_x
, 3),
664 GROUP(tsin_b_din0_x
, 3),
665 GROUP(tsin_b_clk_x
, 3),
666 GROUP(pdm_din0_x
, 2),
667 GROUP(pdm_din1_x
, 2),
668 GROUP(pdm_din2_x
, 2),
669 GROUP(pdm_din3_x
, 2),
670 GROUP(pdm_dclk_x
, 2),
671 GROUP(tdm_a_slv_sclk
, 2),
672 GROUP(tdm_a_slv_fs
, 2),
673 GROUP(tdm_a_din0
, 2),
674 GROUP(tdm_a_din1
, 2),
675 GROUP(tdm_a_sclk
, 1),
677 GROUP(tdm_a_dout0
, 1),
678 GROUP(tdm_a_dout1
, 1),
682 GROUP(sdcard_d0_c
, 1),
683 GROUP(sdcard_d1_c
, 1),
684 GROUP(sdcard_d2_c
, 1),
685 GROUP(sdcard_d3_c
, 1),
686 GROUP(sdcard_clk_c
, 1),
687 GROUP(sdcard_cmd_c
, 1),
688 GROUP(spi0_mosi_c
, 5),
689 GROUP(spi0_miso_c
, 5),
690 GROUP(spi0_ss0_c
, 5),
691 GROUP(spi0_clk_c
, 5),
692 GROUP(i2c0_sda_c
, 3),
693 GROUP(i2c0_sck_c
, 3),
694 GROUP(uart_ao_a_rx_c
, 2),
695 GROUP(uart_ao_a_tx_c
, 2),
696 GROUP(iso7816_clk_c
, 5),
697 GROUP(iso7816_data_c
, 5),
699 GROUP(jtag_b_tdo
, 2),
700 GROUP(jtag_b_tdi
, 2),
701 GROUP(jtag_b_clk
, 2),
702 GROUP(jtag_b_tms
, 2),
703 GROUP(pdm_din0_c
, 4),
704 GROUP(pdm_din1_c
, 4),
705 GROUP(pdm_din2_c
, 4),
706 GROUP(pdm_din3_c
, 4),
707 GROUP(pdm_dclk_c
, 4),
714 GROUP(i2c1_sda_h2
, 2),
715 GROUP(i2c1_sck_h3
, 2),
716 GROUP(i2c1_sda_h6
, 4),
717 GROUP(i2c1_sck_h7
, 4),
718 GROUP(i2c3_sda_h
, 2),
719 GROUP(i2c3_sck_h
, 2),
722 GROUP(uart_c_cts
, 2),
723 GROUP(uart_c_rts
, 2),
724 GROUP(iso7816_clk_h
, 1),
725 GROUP(iso7816_data_h
, 1),
727 GROUP(cec_ao_a_h
, 4),
728 GROUP(cec_ao_b_h
, 5),
729 GROUP(hdmitx_sda
, 1),
730 GROUP(hdmitx_sck
, 1),
731 GROUP(hdmitx_hpd_in
, 1),
732 GROUP(spdif_out_h
, 1),
733 GROUP(spdif_in_h
, 1),
734 GROUP(tdm_b_din3_h
, 6),
735 GROUP(tdm_b_dout3_h
, 5),
738 GROUP(i2c3_sda_a
, 2),
739 GROUP(i2c3_sck_a
, 2),
740 GROUP(pdm_din0_a
, 1),
741 GROUP(pdm_din1_a
, 1),
742 GROUP(pdm_din2_a
, 1),
743 GROUP(pdm_din3_a
, 1),
744 GROUP(pdm_dclk_a
, 1),
745 GROUP(spdif_in_a10
, 1),
746 GROUP(spdif_in_a12
, 1),
747 GROUP(spdif_out_a11
, 1),
748 GROUP(spdif_out_a13
, 1),
749 GROUP(tdm_b_slv_sclk
, 2),
750 GROUP(tdm_b_slv_fs
, 2),
751 GROUP(tdm_b_din0
, 2),
752 GROUP(tdm_b_din1
, 2),
753 GROUP(tdm_b_din2
, 2),
754 GROUP(tdm_b_din3_a
, 2),
755 GROUP(tdm_b_sclk
, 1),
757 GROUP(tdm_b_dout0
, 1),
758 GROUP(tdm_b_dout1
, 1),
759 GROUP(tdm_b_dout2
, 3),
760 GROUP(tdm_b_dout3_a
, 3),
761 GROUP(tdm_c_slv_sclk_a
, 3),
762 GROUP(tdm_c_slv_fs_a
, 3),
763 GROUP(tdm_c_din0_a
, 3),
764 GROUP(tdm_c_din1_a
, 3),
765 GROUP(tdm_c_din2_a
, 3),
766 GROUP(tdm_c_din3_a
, 3),
767 GROUP(tdm_c_sclk_a
, 2),
768 GROUP(tdm_c_fs_a
, 2),
769 GROUP(tdm_c_dout0_a
, 2),
770 GROUP(tdm_c_dout1_a
, 2),
771 GROUP(tdm_c_dout2_a
, 2),
772 GROUP(tdm_c_dout3_a
, 2),
779 static const unsigned int uart_ao_a_tx_pins
[] = { GPIOAO_0
};
780 static const unsigned int uart_ao_a_rx_pins
[] = { GPIOAO_1
};
781 static const unsigned int uart_ao_a_cts_pins
[] = { GPIOE_0
};
782 static const unsigned int uart_ao_a_rts_pins
[] = { GPIOE_1
};
785 static const unsigned int uart_ao_b_tx_2_pins
[] = { GPIOAO_2
};
786 static const unsigned int uart_ao_b_rx_3_pins
[] = { GPIOAO_3
};
787 static const unsigned int uart_ao_b_tx_8_pins
[] = { GPIOAO_8
};
788 static const unsigned int uart_ao_b_rx_9_pins
[] = { GPIOAO_9
};
789 static const unsigned int uart_ao_b_cts_pins
[] = { GPIOE_0
};
790 static const unsigned int uart_ao_b_rts_pins
[] = { GPIOE_1
};
793 static const unsigned int i2c_ao_sck_pins
[] = { GPIOAO_2
};
794 static const unsigned int i2c_ao_sda_pins
[] = { GPIOAO_3
};
796 static const unsigned int i2c_ao_sck_e_pins
[] = { GPIOE_0
};
797 static const unsigned int i2c_ao_sda_e_pins
[] = { GPIOE_1
};
800 static const unsigned int i2c_ao_slave_sck_pins
[] = { GPIOAO_2
};
801 static const unsigned int i2c_ao_slave_sda_pins
[] = { GPIOAO_3
};
804 static const unsigned int remote_ao_input_pins
[] = { GPIOAO_5
};
807 static const unsigned int remote_ao_out_pins
[] = { GPIOAO_4
};
810 static const unsigned int pwm_a_e_pins
[] = { GPIOE_2
};
813 static const unsigned int pwm_ao_a_pins
[] = { GPIOAO_11
};
814 static const unsigned int pwm_ao_a_hiz_pins
[] = { GPIOAO_11
};
817 static const unsigned int pwm_ao_b_pins
[] = { GPIOE_0
};
820 static const unsigned int pwm_ao_c_4_pins
[] = { GPIOAO_4
};
821 static const unsigned int pwm_ao_c_hiz_pins
[] = { GPIOAO_4
};
822 static const unsigned int pwm_ao_c_6_pins
[] = { GPIOAO_6
};
825 static const unsigned int pwm_ao_d_5_pins
[] = { GPIOAO_5
};
826 static const unsigned int pwm_ao_d_10_pins
[] = { GPIOAO_10
};
827 static const unsigned int pwm_ao_d_e_pins
[] = { GPIOE_1
};
830 static const unsigned int jtag_a_tdi_pins
[] = { GPIOAO_8
};
831 static const unsigned int jtag_a_tdo_pins
[] = { GPIOAO_9
};
832 static const unsigned int jtag_a_clk_pins
[] = { GPIOAO_6
};
833 static const unsigned int jtag_a_tms_pins
[] = { GPIOAO_7
};
836 static const unsigned int cec_ao_a_pins
[] = { GPIOAO_10
};
837 static const unsigned int cec_ao_b_pins
[] = { GPIOAO_10
};
840 static const unsigned int tsin_ao_asop_pins
[] = { GPIOAO_6
};
841 static const unsigned int tsin_ao_adin0_pins
[] = { GPIOAO_7
};
842 static const unsigned int tsin_ao_aclk_pins
[] = { GPIOAO_8
};
843 static const unsigned int tsin_ao_a_valid_pins
[] = { GPIOAO_9
};
846 static const unsigned int spdif_ao_out_pins
[] = { GPIOAO_10
};
849 static const unsigned int tdm_ao_b_slv_fs_pins
[] = { GPIOAO_7
};
850 static const unsigned int tdm_ao_b_slv_sclk_pins
[] = { GPIOAO_8
};
851 static const unsigned int tdm_ao_b_fs_pins
[] = { GPIOAO_7
};
852 static const unsigned int tdm_ao_b_sclk_pins
[] = { GPIOAO_8
};
853 static const unsigned int tdm_ao_b_din0_pins
[] = { GPIOAO_4
};
854 static const unsigned int tdm_ao_b_din1_pins
[] = { GPIOAO_10
};
855 static const unsigned int tdm_ao_b_din2_pins
[] = { GPIOAO_6
};
856 static const unsigned int tdm_ao_b_dout0_pins
[] = { GPIOAO_4
};
857 static const unsigned int tdm_ao_b_dout1_pins
[] = { GPIOAO_10
};
858 static const unsigned int tdm_ao_b_dout2_pins
[] = { GPIOAO_6
};
861 static const unsigned int mclk0_ao_pins
[] = { GPIOAO_9
};
863 static const struct meson_pmx_group meson_g12a_aobus_groups
[] = {
864 GPIO_GROUP(GPIOAO_0
),
865 GPIO_GROUP(GPIOAO_1
),
866 GPIO_GROUP(GPIOAO_2
),
867 GPIO_GROUP(GPIOAO_3
),
868 GPIO_GROUP(GPIOAO_4
),
869 GPIO_GROUP(GPIOAO_5
),
870 GPIO_GROUP(GPIOAO_6
),
871 GPIO_GROUP(GPIOAO_7
),
872 GPIO_GROUP(GPIOAO_8
),
873 GPIO_GROUP(GPIOAO_9
),
874 GPIO_GROUP(GPIOAO_10
),
875 GPIO_GROUP(GPIOAO_11
),
881 GROUP(uart_ao_a_tx
, 1),
882 GROUP(uart_ao_a_rx
, 1),
883 GROUP(uart_ao_a_cts
, 1),
884 GROUP(uart_ao_a_rts
, 1),
885 GROUP(uart_ao_b_tx_2
, 2),
886 GROUP(uart_ao_b_rx_3
, 2),
887 GROUP(uart_ao_b_tx_8
, 3),
888 GROUP(uart_ao_b_rx_9
, 3),
889 GROUP(uart_ao_b_cts
, 2),
890 GROUP(uart_ao_b_rts
, 2),
891 GROUP(i2c_ao_sck
, 1),
892 GROUP(i2c_ao_sda
, 1),
893 GROUP(i2c_ao_sck_e
, 4),
894 GROUP(i2c_ao_sda_e
, 4),
895 GROUP(i2c_ao_slave_sck
, 3),
896 GROUP(i2c_ao_slave_sda
, 3),
897 GROUP(remote_ao_input
, 1),
898 GROUP(remote_ao_out
, 1),
901 GROUP(pwm_ao_a_hiz
, 2),
903 GROUP(pwm_ao_c_4
, 3),
904 GROUP(pwm_ao_c_hiz
, 4),
905 GROUP(pwm_ao_c_6
, 3),
906 GROUP(pwm_ao_d_5
, 3),
907 GROUP(pwm_ao_d_10
, 3),
908 GROUP(pwm_ao_d_e
, 3),
909 GROUP(jtag_a_tdi
, 1),
910 GROUP(jtag_a_tdo
, 1),
911 GROUP(jtag_a_clk
, 1),
912 GROUP(jtag_a_tms
, 1),
915 GROUP(tsin_ao_asop
, 4),
916 GROUP(tsin_ao_adin0
, 4),
917 GROUP(tsin_ao_aclk
, 4),
918 GROUP(tsin_ao_a_valid
, 4),
919 GROUP(spdif_ao_out
, 4),
920 GROUP(tdm_ao_b_dout0
, 5),
921 GROUP(tdm_ao_b_dout1
, 5),
922 GROUP(tdm_ao_b_dout2
, 5),
923 GROUP(tdm_ao_b_fs
, 5),
924 GROUP(tdm_ao_b_sclk
, 5),
925 GROUP(tdm_ao_b_din0
, 6),
926 GROUP(tdm_ao_b_din1
, 6),
927 GROUP(tdm_ao_b_din2
, 6),
928 GROUP(tdm_ao_b_slv_fs
, 6),
929 GROUP(tdm_ao_b_slv_sclk
, 6),
933 static const char * const gpio_periphs_groups
[] = {
934 "GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4",
935 "GPIOZ_5", "GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9",
936 "GPIOZ_10", "GPIOZ_11", "GPIOZ_12", "GPIOZ_13", "GPIOZ_14",
939 "GPIOH_0", "GPIOH_1", "GPIOH_2", "GPIOH_3", "GPIOH_4",
940 "GPIOH_5", "GPIOH_6", "GPIOH_7", "GPIOH_8",
942 "BOOT_0", "BOOT_1", "BOOT_2", "BOOT_3", "BOOT_4",
943 "BOOT_5", "BOOT_6", "BOOT_7", "BOOT_8", "BOOT_9",
944 "BOOT_10", "BOOT_11", "BOOT_12", "BOOT_13", "BOOT_14",
947 "GPIOC_0", "GPIOC_1", "GPIOC_2", "GPIOC_3", "GPIOC_4",
948 "GPIOC_5", "GPIOC_6", "GPIOC_7",
950 "GPIOA_0", "GPIOA_1", "GPIOA_2", "GPIOA_3", "GPIOA_4",
951 "GPIOA_5", "GPIOA_6", "GPIOA_7", "GPIOA_8", "GPIOA_9",
952 "GPIOA_10", "GPIOA_11", "GPIOA_12", "GPIOA_13", "GPIOA_14",
955 "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4",
956 "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9",
957 "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14",
958 "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18", "GPIOX_19",
961 static const char * const emmc_groups
[] = {
962 "emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2",
963 "emmc_nand_d3", "emmc_nand_d4", "emmc_nand_d5",
964 "emmc_nand_d6", "emmc_nand_d7",
965 "emmc_clk", "emmc_cmd", "emmc_nand_ds",
968 static const char * const nand_groups
[] = {
969 "emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2",
970 "emmc_nand_d3", "emmc_nand_d4", "emmc_nand_d5",
971 "emmc_nand_d6", "emmc_nand_d7",
972 "nand_ce0", "nand_ale", "nand_cle",
973 "nand_wen_clk", "nand_ren_wr", "nand_rb0",
974 "emmc_nand_ds", "nand_ce1",
977 static const char * const nor_groups
[] = {
978 "nor_d", "nor_q", "nor_c", "nor_cs",
979 "nor_hold", "nor_wp",
982 static const char * const sdio_groups
[] = {
983 "sdio_d0", "sdio_d1", "sdio_d2", "sdio_d3",
984 "sdio_cmd", "sdio_clk", "sdio_dummy",
987 static const char * const sdcard_groups
[] = {
988 "sdcard_d0_c", "sdcard_d1_c", "sdcard_d2_c", "sdcard_d3_c",
989 "sdcard_clk_c", "sdcard_cmd_c",
990 "sdcard_d0_z", "sdcard_d1_z", "sdcard_d2_z", "sdcard_d3_z",
991 "sdcard_clk_z", "sdcard_cmd_z",
994 static const char * const spi0_groups
[] = {
995 "spi0_mosi_c", "spi0_miso_c", "spi0_ss0_c", "spi0_clk_c",
996 "spi0_mosi_x", "spi0_miso_x", "spi0_ss0_x", "spi0_clk_x",
999 static const char * const spi1_groups
[] = {
1000 "spi1_mosi", "spi1_miso", "spi1_ss0", "spi1_clk",
1003 static const char * const i2c0_groups
[] = {
1004 "i2c0_sda_c", "i2c0_sck_c",
1005 "i2c0_sda_z0", "i2c0_sck_z1",
1006 "i2c0_sda_z7", "i2c0_sck_z8",
1009 static const char * const i2c1_groups
[] = {
1010 "i2c1_sda_x", "i2c1_sck_x",
1011 "i2c1_sda_h2", "i2c1_sck_h3",
1012 "i2c1_sda_h6", "i2c1_sck_h7",
1015 static const char * const i2c2_groups
[] = {
1016 "i2c2_sda_x", "i2c2_sck_x",
1017 "i2c2_sda_z", "i2c2_sck_z",
1020 static const char * const i2c3_groups
[] = {
1021 "i2c3_sda_h", "i2c3_sck_h",
1022 "i2c3_sda_a", "i2c3_sck_a",
1025 static const char * const uart_a_groups
[] = {
1026 "uart_a_tx", "uart_a_rx", "uart_a_cts", "uart_a_rts",
1029 static const char * const uart_b_groups
[] = {
1030 "uart_b_tx", "uart_b_rx",
1033 static const char * const uart_c_groups
[] = {
1034 "uart_c_tx", "uart_c_rx", "uart_c_cts", "uart_c_rts",
1037 static const char * const uart_ao_a_c_groups
[] = {
1038 "uart_ao_a_rx_c", "uart_ao_a_tx_c",
1041 static const char * const iso7816_groups
[] = {
1042 "iso7816_clk_c", "iso7816_data_c",
1043 "iso7816_clk_x", "iso7816_data_x",
1044 "iso7816_clk_h", "iso7816_data_h",
1045 "iso7816_clk_z", "iso7816_data_z",
1048 static const char * const eth_groups
[] = {
1049 "eth_rxd2_rgmii", "eth_rxd3_rgmii", "eth_rgmii_tx_clk",
1050 "eth_txd2_rgmii", "eth_txd3_rgmii", "eth_rgmii_rx_clk",
1051 "eth_txd0", "eth_txd1", "eth_txen", "eth_mdc",
1052 "eth_rxd0", "eth_rxd1", "eth_rx_dv", "eth_mdio",
1053 "eth_link_led", "eth_act_led",
1056 static const char * const pwm_a_groups
[] = {
1060 static const char * const pwm_b_groups
[] = {
1061 "pwm_b_x7", "pwm_b_x19",
1064 static const char * const pwm_c_groups
[] = {
1065 "pwm_c_c", "pwm_c_x5", "pwm_c_x8",
1068 static const char * const pwm_d_groups
[] = {
1069 "pwm_d_x3", "pwm_d_x6",
1072 static const char * const pwm_e_groups
[] = {
1076 static const char * const pwm_f_groups
[] = {
1077 "pwm_f_z", "pwm_f_a", "pwm_f_x", "pwm_f_h",
1080 static const char * const cec_ao_a_h_groups
[] = {
1084 static const char * const cec_ao_b_h_groups
[] = {
1088 static const char * const jtag_b_groups
[] = {
1089 "jtag_b_tdi", "jtag_b_tdo", "jtag_b_clk", "jtag_b_tms",
1092 static const char * const bt565_a_groups
[] = {
1093 "bt565_a_vs", "bt565_a_hs", "bt565_a_clk",
1094 "bt565_a_din0", "bt565_a_din1", "bt565_a_din2",
1095 "bt565_a_din3", "bt565_a_din4", "bt565_a_din5",
1096 "bt565_a_din6", "bt565_a_din7",
1099 static const char * const tsin_a_groups
[] = {
1100 "tsin_a_valid", "tsin_a_sop", "tsin_a_din0",
1104 static const char * const tsin_b_groups
[] = {
1105 "tsin_b_valid_x", "tsin_b_sop_x", "tsin_b_din0_x", "tsin_b_clk_x",
1106 "tsin_b_valid_z", "tsin_b_sop_z", "tsin_b_din0_z", "tsin_b_clk_z",
1107 "tsin_b_fail", "tsin_b_din1", "tsin_b_din2", "tsin_b_din3",
1108 "tsin_b_din4", "tsin_b_din5", "tsin_b_din6", "tsin_b_din7",
1111 static const char * const hdmitx_groups
[] = {
1112 "hdmitx_sda", "hdmitx_sck", "hdmitx_hpd_in",
1115 static const char * const pdm_groups
[] = {
1116 "pdm_din0_c", "pdm_din1_c", "pdm_din2_c", "pdm_din3_c",
1118 "pdm_din0_x", "pdm_din1_x", "pdm_din2_x", "pdm_din3_x",
1120 "pdm_din0_z", "pdm_din1_z", "pdm_din2_z", "pdm_din3_z",
1122 "pdm_din0_a", "pdm_din1_a", "pdm_din2_a", "pdm_din3_a",
1126 static const char * const spdif_in_groups
[] = {
1127 "spdif_in_h", "spdif_in_a10", "spdif_in_a12",
1130 static const char * const spdif_out_groups
[] = {
1131 "spdif_out_h", "spdif_out_a11", "spdif_out_a13",
1134 static const char * const mclk0_groups
[] = {
1138 static const char * const mclk1_groups
[] = {
1139 "mclk1_x", "mclk1_z", "mclk1_a",
1142 static const char * const tdm_a_groups
[] = {
1143 "tdm_a_slv_sclk", "tdm_a_slv_fs", "tdm_a_sclk", "tdm_a_fs",
1144 "tdm_a_din0", "tdm_a_din1", "tdm_a_dout0", "tdm_a_dout1",
1147 static const char * const tdm_b_groups
[] = {
1148 "tdm_b_slv_sclk", "tdm_b_slv_fs", "tdm_b_sclk", "tdm_b_fs",
1149 "tdm_b_din0", "tdm_b_din1", "tdm_b_din2",
1150 "tdm_b_din3_a", "tdm_b_din3_h",
1151 "tdm_b_dout0", "tdm_b_dout1", "tdm_b_dout2",
1152 "tdm_b_dout3_a", "tdm_b_dout3_h",
1155 static const char * const tdm_c_groups
[] = {
1156 "tdm_c_slv_sclk_a", "tdm_c_slv_fs_a",
1157 "tdm_c_slv_sclk_z", "tdm_c_slv_fs_z",
1158 "tdm_c_sclk_a", "tdm_c_fs_a",
1159 "tdm_c_sclk_z", "tdm_c_fs_z",
1160 "tdm_c_din0_a", "tdm_c_din1_a",
1161 "tdm_c_din2_a", "tdm_c_din3_a",
1162 "tdm_c_din0_z", "tdm_c_din1_z",
1163 "tdm_c_din2_z", "tdm_c_din3_z",
1164 "tdm_c_dout0_a", "tdm_c_dout1_a",
1165 "tdm_c_dout2_a", "tdm_c_dout3_a",
1166 "tdm_c_dout0_z", "tdm_c_dout1_z",
1167 "tdm_c_dout2_z", "tdm_c_dout3_z",
1170 static const char * const gpio_aobus_groups
[] = {
1171 "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4",
1172 "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9",
1173 "GPIOAO_10", "GPIOAO_11", "GPIOE_0", "GPIOE_1", "GPIOE_2",
1176 static const char * const uart_ao_a_groups
[] = {
1177 "uart_ao_a_tx", "uart_ao_a_rx",
1178 "uart_ao_a_cts", "uart_ao_a_rts",
1181 static const char * const uart_ao_b_groups
[] = {
1182 "uart_ao_b_tx_2", "uart_ao_b_rx_3",
1183 "uart_ao_b_tx_8", "uart_ao_b_rx_9",
1184 "uart_ao_b_cts", "uart_ao_b_rts",
1187 static const char * const i2c_ao_groups
[] = {
1188 "i2c_ao_sck", "i2c_ao_sda",
1189 "i2c_ao_sck_e", "i2c_ao_sda_e",
1192 static const char * const i2c_ao_slave_groups
[] = {
1193 "i2c_ao_slave_sck", "i2c_ao_slave_sda",
1196 static const char * const remote_ao_input_groups
[] = {
1200 static const char * const remote_ao_out_groups
[] = {
1204 static const char * const pwm_a_e_groups
[] = {
1208 static const char * const pwm_ao_a_groups
[] = {
1209 "pwm_ao_a", "pwm_ao_a_hiz",
1212 static const char * const pwm_ao_b_groups
[] = {
1216 static const char * const pwm_ao_c_groups
[] = {
1217 "pwm_ao_c_4", "pwm_ao_c_hiz",
1221 static const char * const pwm_ao_d_groups
[] = {
1222 "pwm_ao_d_5", "pwm_ao_d_10", "pwm_ao_d_e",
1225 static const char * const jtag_a_groups
[] = {
1226 "jtag_a_tdi", "jtag_a_tdo", "jtag_a_clk", "jtag_a_tms",
1229 static const char * const cec_ao_a_groups
[] = {
1233 static const char * const cec_ao_b_groups
[] = {
1237 static const char * const tsin_ao_a_groups
[] = {
1238 "tsin_ao_asop", "tsin_ao_adin0", "tsin_ao_aclk", "tsin_ao_a_valid",
1241 static const char * const spdif_ao_out_groups
[] = {
1245 static const char * const tdm_ao_b_groups
[] = {
1246 "tdm_ao_b_dout0", "tdm_ao_b_dout1", "tdm_ao_b_dout2",
1247 "tdm_ao_b_fs", "tdm_ao_b_sclk",
1248 "tdm_ao_b_din0", "tdm_ao_b_din1", "tdm_ao_b_din2",
1249 "tdm_ao_b_slv_fs", "tdm_ao_b_slv_sclk",
1252 static const char * const mclk0_ao_groups
[] = {
1256 static const struct meson_pmx_func meson_g12a_periphs_functions
[] = {
1257 FUNCTION(gpio_periphs
),
1272 FUNCTION(uart_ao_a_c
),
1281 FUNCTION(cec_ao_a_h
),
1282 FUNCTION(cec_ao_b_h
),
1289 FUNCTION(spdif_out
),
1298 static const struct meson_pmx_func meson_g12a_aobus_functions
[] = {
1299 FUNCTION(gpio_aobus
),
1300 FUNCTION(uart_ao_a
),
1301 FUNCTION(uart_ao_b
),
1303 FUNCTION(i2c_ao_slave
),
1304 FUNCTION(remote_ao_input
),
1305 FUNCTION(remote_ao_out
),
1314 FUNCTION(tsin_ao_a
),
1315 FUNCTION(spdif_ao_out
),
1320 static const struct meson_bank meson_g12a_periphs_banks
[] = {
1321 /* name first last irq pullen pull dir out in ds */
1322 BANK_DS("Z", GPIOZ_0
, GPIOZ_15
, IRQID_GPIOZ_0
, IRQID_GPIOZ_15
,
1323 4, 0, 4, 0, 12, 0, 13, 0, 14, 0, 5, 0),
1324 BANK_DS("H", GPIOH_0
, GPIOH_8
, IRQID_GPIOH_0
, IRQID_GPIOH_8
,
1325 3, 0, 3, 0, 9, 0, 10, 0, 11, 0, 4, 0),
1326 BANK_DS("BOOT", BOOT_0
, BOOT_15
, IRQID_BOOT_0
, IRQID_BOOT_15
,
1327 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0),
1328 BANK_DS("C", GPIOC_0
, GPIOC_7
, IRQID_GPIOC_0
, IRQID_GPIOC_7
,
1329 1, 0, 1, 0, 3, 0, 4, 0, 5, 0, 1, 0),
1330 BANK_DS("A", GPIOA_0
, GPIOA_15
, IRQID_GPIOA_0
, IRQID_GPIOA_15
,
1331 5, 0, 5, 0, 16, 0, 17, 0, 18, 0, 6, 0),
1332 BANK_DS("X", GPIOX_0
, GPIOX_19
, IRQID_GPIOX_0
, IRQID_GPIOX_19
,
1333 2, 0, 2, 0, 6, 0, 7, 0, 8, 0, 2, 0),
1336 static const struct meson_bank meson_g12a_aobus_banks
[] = {
1337 /* name first last irq pullen pull dir out in ds */
1338 BANK_DS("AO", GPIOAO_0
, GPIOAO_11
, IRQID_GPIOAO_0
, IRQID_GPIOAO_11
,
1339 3, 0, 2, 0, 0, 0, 4, 0, 1, 0, 0, 0),
1340 /* GPIOE actually located in the AO bank */
1341 BANK_DS("E", GPIOE_0
, GPIOE_2
, IRQID_GPIOE_0
, IRQID_GPIOE_2
,
1342 3, 16, 2, 16, 0, 16, 4, 16, 1, 16, 1, 0),
1345 static const struct meson_pmx_bank meson_g12a_periphs_pmx_banks
[] = {
1346 /* name first last reg offset */
1347 BANK_PMX("Z", GPIOZ_0
, GPIOZ_15
, 0x6, 0),
1348 BANK_PMX("H", GPIOH_0
, GPIOH_8
, 0xb, 0),
1349 BANK_PMX("BOOT", BOOT_0
, BOOT_15
, 0x0, 0),
1350 BANK_PMX("C", GPIOC_0
, GPIOC_7
, 0x9, 0),
1351 BANK_PMX("A", GPIOA_0
, GPIOA_15
, 0xd, 0),
1352 BANK_PMX("X", GPIOX_0
, GPIOX_19
, 0x3, 0),
1355 static const struct meson_axg_pmx_data meson_g12a_periphs_pmx_banks_data
= {
1356 .pmx_banks
= meson_g12a_periphs_pmx_banks
,
1357 .num_pmx_banks
= ARRAY_SIZE(meson_g12a_periphs_pmx_banks
),
1360 static const struct meson_pmx_bank meson_g12a_aobus_pmx_banks
[] = {
1361 BANK_PMX("AO", GPIOAO_0
, GPIOAO_11
, 0x0, 0),
1362 BANK_PMX("E", GPIOE_0
, GPIOE_2
, 0x1, 16),
1365 static const struct meson_axg_pmx_data meson_g12a_aobus_pmx_banks_data
= {
1366 .pmx_banks
= meson_g12a_aobus_pmx_banks
,
1367 .num_pmx_banks
= ARRAY_SIZE(meson_g12a_aobus_pmx_banks
),
1370 static int meson_g12a_aobus_parse_dt_extra(struct meson_pinctrl
*pc
)
1372 pc
->reg_pull
= pc
->reg_gpio
;
1373 pc
->reg_pullen
= pc
->reg_gpio
;
1378 static const struct meson_pinctrl_data meson_g12a_periphs_pinctrl_data
= {
1379 .name
= "periphs-banks",
1380 .pins
= meson_g12a_periphs_pins
,
1381 .groups
= meson_g12a_periphs_groups
,
1382 .funcs
= meson_g12a_periphs_functions
,
1383 .banks
= meson_g12a_periphs_banks
,
1384 .num_pins
= ARRAY_SIZE(meson_g12a_periphs_pins
),
1385 .num_groups
= ARRAY_SIZE(meson_g12a_periphs_groups
),
1386 .num_funcs
= ARRAY_SIZE(meson_g12a_periphs_functions
),
1387 .num_banks
= ARRAY_SIZE(meson_g12a_periphs_banks
),
1388 .pmx_ops
= &meson_axg_pmx_ops
,
1389 .pmx_data
= &meson_g12a_periphs_pmx_banks_data
,
1392 static const struct meson_pinctrl_data meson_g12a_aobus_pinctrl_data
= {
1393 .name
= "aobus-banks",
1394 .pins
= meson_g12a_aobus_pins
,
1395 .groups
= meson_g12a_aobus_groups
,
1396 .funcs
= meson_g12a_aobus_functions
,
1397 .banks
= meson_g12a_aobus_banks
,
1398 .num_pins
= ARRAY_SIZE(meson_g12a_aobus_pins
),
1399 .num_groups
= ARRAY_SIZE(meson_g12a_aobus_groups
),
1400 .num_funcs
= ARRAY_SIZE(meson_g12a_aobus_functions
),
1401 .num_banks
= ARRAY_SIZE(meson_g12a_aobus_banks
),
1402 .pmx_ops
= &meson_axg_pmx_ops
,
1403 .pmx_data
= &meson_g12a_aobus_pmx_banks_data
,
1404 .parse_dt
= meson_g12a_aobus_parse_dt_extra
,
1407 static const struct of_device_id meson_g12a_pinctrl_dt_match
[] = {
1409 .compatible
= "amlogic,meson-g12a-periphs-pinctrl",
1410 .data
= &meson_g12a_periphs_pinctrl_data
,
1413 .compatible
= "amlogic,meson-g12a-aobus-pinctrl",
1414 .data
= &meson_g12a_aobus_pinctrl_data
,
1418 MODULE_DEVICE_TABLE(of
, meson_g12a_pinctrl_dt_match
);
1420 static struct platform_driver meson_g12a_pinctrl_driver
= {
1421 .probe
= meson_pinctrl_probe
,
1423 .name
= "meson-g12a-pinctrl",
1424 .of_match_table
= meson_g12a_pinctrl_dt_match
,
1428 module_platform_driver(meson_g12a_pinctrl_driver
);
1429 MODULE_DESCRIPTION("Amlogic Meson G12A SoC pinctrl driver");
1430 MODULE_LICENSE("Dual BSD/GPL");