2 * Pin controller and GPIO driver for Amlogic Meson AXG SoC.
4 * Copyright (c) 2017 Amlogic, Inc. All rights reserved.
5 * Author: Xingyu Chen <xingyu.chen@amlogic.com>
7 * SPDX-License-Identifier: (GPL-2.0+ or MIT)
10 #include <dt-bindings/gpio/meson-axg-gpio.h>
11 #include "pinctrl-meson.h"
12 #include "pinctrl-meson-axg-pmx.h"
14 static const struct pinctrl_pin_desc meson_axg_periphs_pins
[] = {
103 static const struct pinctrl_pin_desc meson_axg_aobus_pins
[] = {
114 MESON_PIN(GPIOAO_10
),
115 MESON_PIN(GPIOAO_11
),
116 MESON_PIN(GPIOAO_12
),
117 MESON_PIN(GPIOAO_13
),
118 MESON_PIN(GPIO_TEST_N
),
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
};
131 static const unsigned int emmc_clk_pins
[] = {BOOT_8
};
132 static const unsigned int emmc_cmd_pins
[] = {BOOT_10
};
133 static const unsigned int emmc_ds_pins
[] = {BOOT_13
};
136 static const unsigned int nand_ce0_pins
[] = {BOOT_8
};
137 static const unsigned int nand_ale_pins
[] = {BOOT_9
};
138 static const unsigned int nand_cle_pins
[] = {BOOT_10
};
139 static const unsigned int nand_wen_clk_pins
[] = {BOOT_11
};
140 static const unsigned int nand_ren_wr_pins
[] = {BOOT_12
};
141 static const unsigned int nand_rb0_pins
[] = {BOOT_13
};
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_9
};
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 spi0_clk_pins
[] = {GPIOZ_0
};
161 static const unsigned int spi0_mosi_pins
[] = {GPIOZ_1
};
162 static const unsigned int spi0_miso_pins
[] = {GPIOZ_2
};
163 static const unsigned int spi0_ss0_pins
[] = {GPIOZ_3
};
164 static const unsigned int spi0_ss1_pins
[] = {GPIOZ_4
};
165 static const unsigned int spi0_ss2_pins
[] = {GPIOZ_5
};
168 static const unsigned int spi1_clk_x_pins
[] = {GPIOX_19
};
169 static const unsigned int spi1_mosi_x_pins
[] = {GPIOX_17
};
170 static const unsigned int spi1_miso_x_pins
[] = {GPIOX_18
};
171 static const unsigned int spi1_ss0_x_pins
[] = {GPIOX_16
};
173 static const unsigned int spi1_clk_a_pins
[] = {GPIOA_4
};
174 static const unsigned int spi1_mosi_a_pins
[] = {GPIOA_2
};
175 static const unsigned int spi1_miso_a_pins
[] = {GPIOA_3
};
176 static const unsigned int spi1_ss0_a_pins
[] = {GPIOA_5
};
177 static const unsigned int spi1_ss1_pins
[] = {GPIOA_6
};
180 static const unsigned int i2c0_sck_pins
[] = {GPIOZ_6
};
181 static const unsigned int i2c0_sda_pins
[] = {GPIOZ_7
};
184 static const unsigned int i2c1_sck_z_pins
[] = {GPIOZ_8
};
185 static const unsigned int i2c1_sda_z_pins
[] = {GPIOZ_9
};
187 static const unsigned int i2c1_sck_x_pins
[] = {GPIOX_16
};
188 static const unsigned int i2c1_sda_x_pins
[] = {GPIOX_17
};
191 static const unsigned int i2c2_sck_x_pins
[] = {GPIOX_18
};
192 static const unsigned int i2c2_sda_x_pins
[] = {GPIOX_19
};
194 static const unsigned int i2c2_sda_a_pins
[] = {GPIOA_17
};
195 static const unsigned int i2c2_sck_a_pins
[] = {GPIOA_18
};
198 static const unsigned int i2c3_sda_a6_pins
[] = {GPIOA_6
};
199 static const unsigned int i2c3_sck_a7_pins
[] = {GPIOA_7
};
201 static const unsigned int i2c3_sda_a12_pins
[] = {GPIOA_12
};
202 static const unsigned int i2c3_sck_a13_pins
[] = {GPIOA_13
};
204 static const unsigned int i2c3_sda_a19_pins
[] = {GPIOA_19
};
205 static const unsigned int i2c3_sck_a20_pins
[] = {GPIOA_20
};
208 static const unsigned int uart_rts_a_pins
[] = {GPIOX_11
};
209 static const unsigned int uart_cts_a_pins
[] = {GPIOX_10
};
210 static const unsigned int uart_tx_a_pins
[] = {GPIOX_8
};
211 static const unsigned int uart_rx_a_pins
[] = {GPIOX_9
};
214 static const unsigned int uart_rts_b_z_pins
[] = {GPIOZ_0
};
215 static const unsigned int uart_cts_b_z_pins
[] = {GPIOZ_1
};
216 static const unsigned int uart_tx_b_z_pins
[] = {GPIOZ_2
};
217 static const unsigned int uart_rx_b_z_pins
[] = {GPIOZ_3
};
219 static const unsigned int uart_rts_b_x_pins
[] = {GPIOX_18
};
220 static const unsigned int uart_cts_b_x_pins
[] = {GPIOX_19
};
221 static const unsigned int uart_tx_b_x_pins
[] = {GPIOX_16
};
222 static const unsigned int uart_rx_b_x_pins
[] = {GPIOX_17
};
225 static const unsigned int uart_ao_tx_b_z_pins
[] = {GPIOZ_8
};
226 static const unsigned int uart_ao_rx_b_z_pins
[] = {GPIOZ_9
};
227 static const unsigned int uart_ao_cts_b_z_pins
[] = {GPIOZ_6
};
228 static const unsigned int uart_ao_rts_b_z_pins
[] = {GPIOZ_7
};
231 static const unsigned int pwm_a_z_pins
[] = {GPIOZ_5
};
233 static const unsigned int pwm_a_x18_pins
[] = {GPIOX_18
};
234 static const unsigned int pwm_a_x20_pins
[] = {GPIOX_20
};
236 static const unsigned int pwm_a_a_pins
[] = {GPIOA_14
};
239 static const unsigned int pwm_b_z_pins
[] = {GPIOZ_4
};
241 static const unsigned int pwm_b_x_pins
[] = {GPIOX_19
};
243 static const unsigned int pwm_b_a_pins
[] = {GPIOA_15
};
246 static const unsigned int pwm_c_x10_pins
[] = {GPIOX_10
};
247 static const unsigned int pwm_c_x17_pins
[] = {GPIOX_17
};
249 static const unsigned int pwm_c_a_pins
[] = {GPIOA_16
};
252 static const unsigned int pwm_d_x11_pins
[] = {GPIOX_11
};
253 static const unsigned int pwm_d_x16_pins
[] = {GPIOX_16
};
256 static const unsigned int pwm_vs_pins
[] = {GPIOA_0
};
259 static const unsigned int spdif_in_z_pins
[] = {GPIOZ_4
};
261 static const unsigned int spdif_in_a1_pins
[] = {GPIOA_1
};
262 static const unsigned int spdif_in_a7_pins
[] = {GPIOA_7
};
263 static const unsigned int spdif_in_a19_pins
[] = {GPIOA_19
};
264 static const unsigned int spdif_in_a20_pins
[] = {GPIOA_20
};
267 static const unsigned int spdif_out_z_pins
[] = {GPIOZ_5
};
269 static const unsigned int spdif_out_a1_pins
[] = {GPIOA_1
};
270 static const unsigned int spdif_out_a11_pins
[] = {GPIOA_11
};
271 static const unsigned int spdif_out_a19_pins
[] = {GPIOA_19
};
272 static const unsigned int spdif_out_a20_pins
[] = {GPIOA_20
};
275 static const unsigned int jtag_tdo_x_pins
[] = {GPIOX_0
};
276 static const unsigned int jtag_tdi_x_pins
[] = {GPIOX_1
};
277 static const unsigned int jtag_clk_x_pins
[] = {GPIOX_4
};
278 static const unsigned int jtag_tms_x_pins
[] = {GPIOX_5
};
281 static const unsigned int eth_txd0_x_pins
[] = {GPIOX_8
};
282 static const unsigned int eth_txd1_x_pins
[] = {GPIOX_9
};
283 static const unsigned int eth_txen_x_pins
[] = {GPIOX_10
};
284 static const unsigned int eth_rgmii_rx_clk_x_pins
[] = {GPIOX_12
};
285 static const unsigned int eth_rxd0_x_pins
[] = {GPIOX_13
};
286 static const unsigned int eth_rxd1_x_pins
[] = {GPIOX_14
};
287 static const unsigned int eth_rx_dv_x_pins
[] = {GPIOX_15
};
288 static const unsigned int eth_mdio_x_pins
[] = {GPIOX_21
};
289 static const unsigned int eth_mdc_x_pins
[] = {GPIOX_22
};
291 static const unsigned int eth_txd0_y_pins
[] = {GPIOY_10
};
292 static const unsigned int eth_txd1_y_pins
[] = {GPIOY_11
};
293 static const unsigned int eth_txen_y_pins
[] = {GPIOY_9
};
294 static const unsigned int eth_rgmii_rx_clk_y_pins
[] = {GPIOY_2
};
295 static const unsigned int eth_rxd0_y_pins
[] = {GPIOY_4
};
296 static const unsigned int eth_rxd1_y_pins
[] = {GPIOY_5
};
297 static const unsigned int eth_rx_dv_y_pins
[] = {GPIOY_3
};
298 static const unsigned int eth_mdio_y_pins
[] = {GPIOY_0
};
299 static const unsigned int eth_mdc_y_pins
[] = {GPIOY_1
};
301 static const unsigned int eth_rxd2_rgmii_pins
[] = {GPIOY_6
};
302 static const unsigned int eth_rxd3_rgmii_pins
[] = {GPIOY_7
};
303 static const unsigned int eth_rgmii_tx_clk_pins
[] = {GPIOY_8
};
304 static const unsigned int eth_txd2_rgmii_pins
[] = {GPIOY_12
};
305 static const unsigned int eth_txd3_rgmii_pins
[] = {GPIOY_13
};
308 static const unsigned int pdm_dclk_a14_pins
[] = {GPIOA_14
};
309 static const unsigned int pdm_dclk_a19_pins
[] = {GPIOA_19
};
310 static const unsigned int pdm_din0_pins
[] = {GPIOA_15
};
311 static const unsigned int pdm_din1_pins
[] = {GPIOA_16
};
312 static const unsigned int pdm_din2_pins
[] = {GPIOA_17
};
313 static const unsigned int pdm_din3_pins
[] = {GPIOA_18
};
316 static const unsigned int mclk_c_pins
[] = {GPIOA_0
};
317 static const unsigned int mclk_b_pins
[] = {GPIOA_1
};
320 static const unsigned int tdma_sclk_pins
[] = {GPIOX_12
};
321 static const unsigned int tdma_sclk_slv_pins
[] = {GPIOX_12
};
322 static const unsigned int tdma_fs_pins
[] = {GPIOX_13
};
323 static const unsigned int tdma_fs_slv_pins
[] = {GPIOX_13
};
324 static const unsigned int tdma_din0_pins
[] = {GPIOX_14
};
325 static const unsigned int tdma_dout0_x14_pins
[] = {GPIOX_14
};
326 static const unsigned int tdma_dout0_x15_pins
[] = {GPIOX_15
};
327 static const unsigned int tdma_dout1_pins
[] = {GPIOX_15
};
328 static const unsigned int tdma_din1_pins
[] = {GPIOX_15
};
330 static const unsigned int tdmc_sclk_pins
[] = {GPIOA_2
};
331 static const unsigned int tdmc_sclk_slv_pins
[] = {GPIOA_2
};
332 static const unsigned int tdmc_fs_pins
[] = {GPIOA_3
};
333 static const unsigned int tdmc_fs_slv_pins
[] = {GPIOA_3
};
334 static const unsigned int tdmc_din0_pins
[] = {GPIOA_4
};
335 static const unsigned int tdmc_dout0_pins
[] = {GPIOA_4
};
336 static const unsigned int tdmc_din1_pins
[] = {GPIOA_5
};
337 static const unsigned int tdmc_dout1_pins
[] = {GPIOA_5
};
338 static const unsigned int tdmc_din2_pins
[] = {GPIOA_6
};
339 static const unsigned int tdmc_dout2_pins
[] = {GPIOA_6
};
340 static const unsigned int tdmc_din3_pins
[] = {GPIOA_7
};
341 static const unsigned int tdmc_dout3_pins
[] = {GPIOA_7
};
343 static const unsigned int tdmb_sclk_pins
[] = {GPIOA_8
};
344 static const unsigned int tdmb_sclk_slv_pins
[] = {GPIOA_8
};
345 static const unsigned int tdmb_fs_pins
[] = {GPIOA_9
};
346 static const unsigned int tdmb_fs_slv_pins
[] = {GPIOA_9
};
347 static const unsigned int tdmb_din0_pins
[] = {GPIOA_10
};
348 static const unsigned int tdmb_dout0_pins
[] = {GPIOA_10
};
349 static const unsigned int tdmb_din1_pins
[] = {GPIOA_11
};
350 static const unsigned int tdmb_dout1_pins
[] = {GPIOA_11
};
351 static const unsigned int tdmb_din2_pins
[] = {GPIOA_12
};
352 static const unsigned int tdmb_dout2_pins
[] = {GPIOA_12
};
353 static const unsigned int tdmb_din3_pins
[] = {GPIOA_13
};
354 static const unsigned int tdmb_dout3_pins
[] = {GPIOA_13
};
356 static struct meson_pmx_group meson_axg_periphs_groups
[] = {
367 GPIO_GROUP(GPIOZ_10
),
395 GPIO_GROUP(GPIOA_10
),
396 GPIO_GROUP(GPIOA_11
),
397 GPIO_GROUP(GPIOA_12
),
398 GPIO_GROUP(GPIOA_13
),
399 GPIO_GROUP(GPIOA_14
),
400 GPIO_GROUP(GPIOA_15
),
401 GPIO_GROUP(GPIOA_16
),
402 GPIO_GROUP(GPIOA_17
),
403 GPIO_GROUP(GPIOA_19
),
404 GPIO_GROUP(GPIOA_20
),
416 GPIO_GROUP(GPIOX_10
),
417 GPIO_GROUP(GPIOX_11
),
418 GPIO_GROUP(GPIOX_12
),
419 GPIO_GROUP(GPIOX_13
),
420 GPIO_GROUP(GPIOX_14
),
421 GPIO_GROUP(GPIOX_15
),
422 GPIO_GROUP(GPIOX_16
),
423 GPIO_GROUP(GPIOX_17
),
424 GPIO_GROUP(GPIOX_18
),
425 GPIO_GROUP(GPIOX_19
),
426 GPIO_GROUP(GPIOX_20
),
427 GPIO_GROUP(GPIOX_21
),
428 GPIO_GROUP(GPIOX_22
),
440 GPIO_GROUP(GPIOY_10
),
441 GPIO_GROUP(GPIOY_11
),
442 GPIO_GROUP(GPIOY_12
),
443 GPIO_GROUP(GPIOY_13
),
444 GPIO_GROUP(GPIOY_14
),
445 GPIO_GROUP(GPIOY_15
),
448 GROUP(emmc_nand_d0
, 1),
449 GROUP(emmc_nand_d1
, 1),
450 GROUP(emmc_nand_d2
, 1),
451 GROUP(emmc_nand_d3
, 1),
452 GROUP(emmc_nand_d4
, 1),
453 GROUP(emmc_nand_d5
, 1),
454 GROUP(emmc_nand_d6
, 1),
455 GROUP(emmc_nand_d7
, 1),
462 GROUP(nand_wen_clk
, 2),
463 GROUP(nand_ren_wr
, 2),
481 GROUP(i2c1_sck_z
, 1),
482 GROUP(i2c1_sda_z
, 1),
483 GROUP(uart_rts_b_z
, 2),
484 GROUP(uart_cts_b_z
, 2),
485 GROUP(uart_tx_b_z
, 2),
486 GROUP(uart_rx_b_z
, 2),
489 GROUP(spdif_in_z
, 3),
490 GROUP(spdif_out_z
, 3),
491 GROUP(uart_ao_tx_b_z
, 2),
492 GROUP(uart_ao_rx_b_z
, 2),
493 GROUP(uart_ao_cts_b_z
, 2),
494 GROUP(uart_ao_rts_b_z
, 2),
503 GROUP(i2c1_sck_x
, 1),
504 GROUP(i2c1_sda_x
, 1),
505 GROUP(i2c2_sck_x
, 1),
506 GROUP(i2c2_sda_x
, 1),
507 GROUP(uart_rts_a
, 1),
508 GROUP(uart_cts_a
, 1),
511 GROUP(uart_rts_b_x
, 2),
512 GROUP(uart_cts_b_x
, 2),
513 GROUP(uart_tx_b_x
, 2),
514 GROUP(uart_rx_b_x
, 2),
515 GROUP(jtag_tdo_x
, 2),
516 GROUP(jtag_tdi_x
, 2),
517 GROUP(jtag_clk_x
, 2),
518 GROUP(jtag_tms_x
, 2),
519 GROUP(spi1_clk_x
, 4),
520 GROUP(spi1_mosi_x
, 4),
521 GROUP(spi1_miso_x
, 4),
522 GROUP(spi1_ss0_x
, 4),
530 GROUP(eth_txd0_x
, 4),
531 GROUP(eth_txd1_x
, 4),
532 GROUP(eth_txen_x
, 4),
533 GROUP(eth_rgmii_rx_clk_x
, 4),
534 GROUP(eth_rxd0_x
, 4),
535 GROUP(eth_rxd1_x
, 4),
536 GROUP(eth_rx_dv_x
, 4),
537 GROUP(eth_mdio_x
, 4),
540 GROUP(tdma_sclk_slv
, 2),
542 GROUP(tdma_fs_slv
, 2),
544 GROUP(tdma_dout0_x14
, 2),
545 GROUP(tdma_dout0_x15
, 1),
546 GROUP(tdma_dout1
, 2),
550 GROUP(eth_txd0_y
, 1),
551 GROUP(eth_txd1_y
, 1),
552 GROUP(eth_txen_y
, 1),
553 GROUP(eth_rgmii_rx_clk_y
, 1),
554 GROUP(eth_rxd0_y
, 1),
555 GROUP(eth_rxd1_y
, 1),
556 GROUP(eth_rx_dv_y
, 1),
557 GROUP(eth_mdio_y
, 1),
559 GROUP(eth_rxd2_rgmii
, 1),
560 GROUP(eth_rxd3_rgmii
, 1),
561 GROUP(eth_rgmii_tx_clk
, 1),
562 GROUP(eth_txd2_rgmii
, 1),
563 GROUP(eth_txd3_rgmii
, 1),
566 GROUP(spdif_out_a1
, 4),
567 GROUP(spdif_out_a11
, 3),
568 GROUP(spdif_out_a19
, 2),
569 GROUP(spdif_out_a20
, 1),
570 GROUP(spdif_in_a1
, 3),
571 GROUP(spdif_in_a7
, 3),
572 GROUP(spdif_in_a19
, 1),
573 GROUP(spdif_in_a20
, 2),
574 GROUP(spi1_clk_a
, 3),
575 GROUP(spi1_mosi_a
, 3),
576 GROUP(spi1_miso_a
, 3),
577 GROUP(spi1_ss0_a
, 3),
583 GROUP(i2c2_sda_a
, 3),
584 GROUP(i2c2_sck_a
, 3),
585 GROUP(i2c3_sda_a6
, 4),
586 GROUP(i2c3_sck_a7
, 4),
587 GROUP(i2c3_sda_a12
, 4),
588 GROUP(i2c3_sck_a13
, 4),
589 GROUP(i2c3_sda_a19
, 4),
590 GROUP(i2c3_sck_a20
, 4),
591 GROUP(pdm_dclk_a14
, 1),
592 GROUP(pdm_dclk_a19
, 3),
600 GROUP(tdmc_sclk_slv
, 2),
602 GROUP(tdmc_fs_slv
, 2),
604 GROUP(tdmc_dout0
, 1),
606 GROUP(tdmc_dout1
, 1),
608 GROUP(tdmc_dout2
, 1),
610 GROUP(tdmc_dout3
, 1),
612 GROUP(tdmb_sclk_slv
, 2),
614 GROUP(tdmb_fs_slv
, 2),
616 GROUP(tdmb_dout0
, 1),
618 GROUP(tdmb_dout1
, 1),
620 GROUP(tdmb_dout2
, 1),
622 GROUP(tdmb_dout3
, 1),
626 static const unsigned int uart_ao_tx_a_pins
[] = {GPIOAO_0
};
627 static const unsigned int uart_ao_rx_a_pins
[] = {GPIOAO_1
};
628 static const unsigned int uart_ao_cts_a_pins
[] = {GPIOAO_2
};
629 static const unsigned int uart_ao_rts_a_pins
[] = {GPIOAO_3
};
632 static const unsigned int uart_ao_tx_b_pins
[] = {GPIOAO_4
};
633 static const unsigned int uart_ao_rx_b_pins
[] = {GPIOAO_5
};
634 static const unsigned int uart_ao_cts_b_pins
[] = {GPIOAO_2
};
635 static const unsigned int uart_ao_rts_b_pins
[] = {GPIOAO_3
};
638 static const unsigned int i2c_ao_sck_4_pins
[] = {GPIOAO_4
};
639 static const unsigned int i2c_ao_sda_5_pins
[] = {GPIOAO_5
};
640 static const unsigned int i2c_ao_sck_8_pins
[] = {GPIOAO_8
};
641 static const unsigned int i2c_ao_sda_9_pins
[] = {GPIOAO_9
};
642 static const unsigned int i2c_ao_sck_10_pins
[] = {GPIOAO_10
};
643 static const unsigned int i2c_ao_sda_11_pins
[] = {GPIOAO_11
};
646 static const unsigned int i2c_ao_slave_sck_pins
[] = {GPIOAO_10
};
647 static const unsigned int i2c_ao_slave_sda_pins
[] = {GPIOAO_11
};
650 static const unsigned int remote_input_ao_pins
[] = {GPIOAO_6
};
653 static const unsigned int remote_out_ao_pins
[] = {GPIOAO_7
};
656 static const unsigned int pwm_ao_a_pins
[] = {GPIOAO_3
};
659 static const unsigned int pwm_ao_b_ao2_pins
[] = {GPIOAO_2
};
660 static const unsigned int pwm_ao_b_ao12_pins
[] = {GPIOAO_12
};
663 static const unsigned int pwm_ao_c_ao8_pins
[] = {GPIOAO_8
};
664 static const unsigned int pwm_ao_c_ao13_pins
[] = {GPIOAO_13
};
667 static const unsigned int pwm_ao_d_pins
[] = {GPIOAO_9
};
670 static const unsigned int jtag_ao_tdi_pins
[] = {GPIOAO_3
};
671 static const unsigned int jtag_ao_tdo_pins
[] = {GPIOAO_4
};
672 static const unsigned int jtag_ao_clk_pins
[] = {GPIOAO_5
};
673 static const unsigned int jtag_ao_tms_pins
[] = {GPIOAO_7
};
676 static const unsigned int gen_clk_ee_pins
[] = {GPIOAO_13
};
678 static struct meson_pmx_group meson_axg_aobus_groups
[] = {
679 GPIO_GROUP(GPIOAO_0
),
680 GPIO_GROUP(GPIOAO_1
),
681 GPIO_GROUP(GPIOAO_2
),
682 GPIO_GROUP(GPIOAO_3
),
683 GPIO_GROUP(GPIOAO_4
),
684 GPIO_GROUP(GPIOAO_5
),
685 GPIO_GROUP(GPIOAO_6
),
686 GPIO_GROUP(GPIOAO_7
),
687 GPIO_GROUP(GPIOAO_8
),
688 GPIO_GROUP(GPIOAO_9
),
689 GPIO_GROUP(GPIOAO_10
),
690 GPIO_GROUP(GPIOAO_11
),
691 GPIO_GROUP(GPIOAO_12
),
692 GPIO_GROUP(GPIOAO_13
),
693 GPIO_GROUP(GPIO_TEST_N
),
696 GROUP(uart_ao_tx_a
, 1),
697 GROUP(uart_ao_rx_a
, 1),
698 GROUP(uart_ao_cts_a
, 2),
699 GROUP(uart_ao_rts_a
, 2),
700 GROUP(uart_ao_tx_b
, 1),
701 GROUP(uart_ao_rx_b
, 1),
702 GROUP(uart_ao_cts_b
, 1),
703 GROUP(uart_ao_rts_b
, 1),
704 GROUP(i2c_ao_sck_4
, 2),
705 GROUP(i2c_ao_sda_5
, 2),
706 GROUP(i2c_ao_sck_8
, 2),
707 GROUP(i2c_ao_sda_9
, 2),
708 GROUP(i2c_ao_sck_10
, 2),
709 GROUP(i2c_ao_sda_11
, 2),
710 GROUP(i2c_ao_slave_sck
, 1),
711 GROUP(i2c_ao_slave_sda
, 1),
712 GROUP(remote_input_ao
, 1),
713 GROUP(remote_out_ao
, 1),
715 GROUP(pwm_ao_b_ao2
, 3),
716 GROUP(pwm_ao_b_ao12
, 3),
717 GROUP(pwm_ao_c_ao8
, 3),
718 GROUP(pwm_ao_c_ao13
, 3),
720 GROUP(jtag_ao_tdi
, 4),
721 GROUP(jtag_ao_tdo
, 4),
722 GROUP(jtag_ao_clk
, 4),
723 GROUP(jtag_ao_tms
, 4),
724 GROUP(gen_clk_ee
, 4),
727 static const char * const gpio_periphs_groups
[] = {
728 "GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4",
729 "GPIOZ_5", "GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9",
732 "BOOT_0", "BOOT_1", "BOOT_2", "BOOT_3", "BOOT_4",
733 "BOOT_5", "BOOT_6", "BOOT_7", "BOOT_8", "BOOT_9",
734 "BOOT_10", "BOOT_11", "BOOT_12", "BOOT_13", "BOOT_14",
736 "GPIOA_0", "GPIOA_1", "GPIOA_2", "GPIOA_3", "GPIOA_4",
737 "GPIOA_5", "GPIOA_6", "GPIOA_7", "GPIOA_8", "GPIOA_9",
738 "GPIOA_10", "GPIOA_11", "GPIOA_12", "GPIOA_13", "GPIOA_14",
739 "GPIOA_15", "GPIOA_16", "GPIOA_17", "GPIOA_18", "GPIOA_19",
742 "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4",
743 "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9",
744 "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14",
745 "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18", "GPIOX_19",
746 "GPIOX_20", "GPIOX_21", "GPIOX_22",
748 "GPIOY_0", "GPIOY_1", "GPIOY_2", "GPIOY_3", "GPIOY_4",
749 "GPIOY_5", "GPIOY_6", "GPIOY_7", "GPIOY_8", "GPIOY_9",
750 "GPIOY_10", "GPIOY_11", "GPIOY_12", "GPIOY_13", "GPIOY_14",
754 static const char * const emmc_groups
[] = {
755 "emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2",
756 "emmc_nand_d3", "emmc_nand_d4", "emmc_nand_d5",
757 "emmc_nand_d6", "emmc_nand_d7",
758 "emmc_clk", "emmc_cmd", "emmc_ds",
761 static const char * const nand_groups
[] = {
762 "emmc_nand_d0", "emmc_nand_d1", "emmc_nand_d2",
763 "emmc_nand_d3", "emmc_nand_d4", "emmc_nand_d5",
764 "emmc_nand_d6", "emmc_nand_d7",
765 "nand_ce0", "nand_ale", "nand_cle",
766 "nand_wen_clk", "nand_ren_wr", "nand_rb0",
769 static const char * const nor_groups
[] = {
770 "nor_d", "nor_q", "nor_c", "nor_cs",
771 "nor_hold", "nor_wp",
774 static const char * const sdio_groups
[] = {
775 "sdio_d0", "sdio_d1", "sdio_d2", "sdio_d3",
776 "sdio_cmd", "sdio_clk",
779 static const char * const spi0_groups
[] = {
780 "spi0_clk", "spi0_mosi", "spi0_miso", "spi0_ss0",
781 "spi0_ss1", "spi0_ss2"
784 static const char * const spi1_groups
[] = {
785 "spi1_clk_x", "spi1_mosi_x", "spi1_miso_x", "spi1_ss0_x",
786 "spi1_clk_a", "spi1_mosi_a", "spi1_miso_a", "spi1_ss0_a",
790 static const char * const uart_a_groups
[] = {
791 "uart_tx_a", "uart_rx_a", "uart_cts_a", "uart_rts_a",
794 static const char * const uart_b_groups
[] = {
795 "uart_tx_b_z", "uart_rx_b_z", "uart_cts_b_z", "uart_rts_b_z",
796 "uart_tx_b_x", "uart_rx_b_x", "uart_cts_b_x", "uart_rts_b_x",
799 static const char * const uart_ao_b_z_groups
[] = {
800 "uart_ao_tx_b_z", "uart_ao_rx_b_z",
801 "uart_ao_cts_b_z", "uart_ao_rts_b_z",
804 static const char * const i2c0_groups
[] = {
805 "i2c0_sck", "i2c0_sda",
808 static const char * const i2c1_groups
[] = {
809 "i2c1_sck_z", "i2c1_sda_z",
810 "i2c1_sck_x", "i2c1_sda_x",
813 static const char * const i2c2_groups
[] = {
814 "i2c2_sck_x", "i2c2_sda_x",
815 "i2c2_sda_a", "i2c2_sck_a",
818 static const char * const i2c3_groups
[] = {
819 "i2c3_sda_a6", "i2c3_sck_a7",
820 "i2c3_sda_a12", "i2c3_sck_a13",
821 "i2c3_sda_a19", "i2c3_sck_a20",
824 static const char * const eth_groups
[] = {
825 "eth_rxd2_rgmii", "eth_rxd3_rgmii", "eth_rgmii_tx_clk",
826 "eth_txd2_rgmii", "eth_txd3_rgmii",
827 "eth_txd0_x", "eth_txd1_x", "eth_txen_x", "eth_rgmii_rx_clk_x",
828 "eth_rxd0_x", "eth_rxd1_x", "eth_rx_dv_x", "eth_mdio_x",
830 "eth_txd0_y", "eth_txd1_y", "eth_txen_y", "eth_rgmii_rx_clk_y",
831 "eth_rxd0_y", "eth_rxd1_y", "eth_rx_dv_y", "eth_mdio_y",
835 static const char * const pwm_a_groups
[] = {
836 "pwm_a_z", "pwm_a_x18", "pwm_a_x20", "pwm_a_a",
839 static const char * const pwm_b_groups
[] = {
840 "pwm_b_z", "pwm_b_x", "pwm_b_a",
843 static const char * const pwm_c_groups
[] = {
844 "pwm_c_x10", "pwm_c_x17", "pwm_c_a",
847 static const char * const pwm_d_groups
[] = {
848 "pwm_d_x11", "pwm_d_x16",
851 static const char * const pwm_vs_groups
[] = {
855 static const char * const spdif_out_groups
[] = {
856 "spdif_out_z", "spdif_out_a1", "spdif_out_a11",
857 "spdif_out_a19", "spdif_out_a20",
860 static const char * const spdif_in_groups
[] = {
861 "spdif_in_z", "spdif_in_a1", "spdif_in_a7",
862 "spdif_in_a19", "spdif_in_a20",
865 static const char * const jtag_ee_groups
[] = {
866 "jtag_tdo_x", "jtag_tdi_x", "jtag_clk_x",
870 static const char * const pdm_groups
[] = {
871 "pdm_din0", "pdm_din1", "pdm_din2", "pdm_din3",
872 "pdm_dclk_a14", "pdm_dclk_a19",
875 static const char * const gpio_aobus_groups
[] = {
876 "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4",
877 "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9",
878 "GPIOAO_10", "GPIOAO_11", "GPIOAO_12", "GPIOAO_13",
882 static const char * const uart_ao_a_groups
[] = {
883 "uart_ao_tx_a", "uart_ao_rx_a", "uart_ao_cts_a", "uart_ao_rts_a",
886 static const char * const uart_ao_b_groups
[] = {
887 "uart_ao_tx_b", "uart_ao_rx_b", "uart_ao_cts_b", "uart_ao_rts_b",
890 static const char * const i2c_ao_groups
[] = {
891 "i2c_ao_sck_4", "i2c_ao_sda_5",
892 "i2c_ao_sck_8", "i2c_ao_sda_9",
893 "i2c_ao_sck_10", "i2c_ao_sda_11",
896 static const char * const i2c_ao_slave_groups
[] = {
897 "i2c_ao_slave_sck", "i2c_ao_slave_sda",
900 static const char * const remote_input_ao_groups
[] = {
904 static const char * const remote_out_ao_groups
[] = {
908 static const char * const pwm_ao_a_groups
[] = {
912 static const char * const pwm_ao_b_groups
[] = {
913 "pwm_ao_b_ao2", "pwm_ao_b_ao12",
916 static const char * const pwm_ao_c_groups
[] = {
917 "pwm_ao_c_ao8", "pwm_ao_c_ao13",
920 static const char * const pwm_ao_d_groups
[] = {
924 static const char * const jtag_ao_groups
[] = {
925 "jtag_ao_tdi", "jtag_ao_tdo", "jtag_ao_clk", "jtag_ao_tms",
928 static const char * const mclk_c_groups
[] = {
932 static const char * const mclk_b_groups
[] = {
936 static const char * const tdma_groups
[] = {
937 "tdma_sclk", "tdma_sclk_slv", "tdma_fs", "tdma_fs_slv",
938 "tdma_din0", "tdma_dout0_x14", "tdma_dout0_x15", "tdma_dout1",
942 static const char * const tdmc_groups
[] = {
943 "tdmc_sclk", "tdmc_sclk_slv", "tdmc_fs", "tdmc_fs_slv",
944 "tdmc_din0", "tdmc_dout0", "tdmc_din1", "tdmc_dout1",
945 "tdmc_din2", "tdmc_dout2", "tdmc_din3", "tdmc_dout3",
948 static const char * const tdmb_groups
[] = {
949 "tdmb_sclk", "tdmb_sclk_slv", "tdmb_fs", "tdmb_fs_slv",
950 "tdmb_din0", "tdmb_dout0", "tdmb_din1", "tdmb_dout1",
951 "tdmb_din2", "tdmb_dout2", "tdmb_din3", "tdmb_dout3",
954 static const char * const gen_clk_ee_groups
[] = {
958 static struct meson_pmx_func meson_axg_periphs_functions
[] = {
959 FUNCTION(gpio_periphs
),
968 FUNCTION(uart_ao_b_z
),
990 static struct meson_pmx_func meson_axg_aobus_functions
[] = {
991 FUNCTION(gpio_aobus
),
995 FUNCTION(i2c_ao_slave
),
996 FUNCTION(remote_input_ao
),
997 FUNCTION(remote_out_ao
),
1003 FUNCTION(gen_clk_ee
),
1006 static struct meson_bank meson_axg_periphs_banks
[] = {
1007 /* name first last irq pullen pull dir out in */
1008 BANK("Z", GPIOZ_0
, GPIOZ_10
, 14, 24, 3, 0, 3, 0, 9, 0, 10, 0, 11, 0),
1009 BANK("BOOT", BOOT_0
, BOOT_14
, 25, 39, 4, 0, 4, 0, 12, 0, 13, 0, 14, 0),
1010 BANK("A", GPIOA_0
, GPIOA_20
, 40, 60, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0),
1011 BANK("X", GPIOX_0
, GPIOX_22
, 61, 83, 2, 0, 2, 0, 6, 0, 7, 0, 8, 0),
1012 BANK("Y", GPIOY_0
, GPIOY_15
, 84, 99, 1, 0, 1, 0, 3, 0, 4, 0, 5, 0),
1015 static struct meson_bank meson_axg_aobus_banks
[] = {
1016 /* name first last irq pullen pull dir out in */
1017 BANK("AO", GPIOAO_0
, GPIOAO_13
, 0, 13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
1020 static struct meson_pmx_bank meson_axg_periphs_pmx_banks
[] = {
1021 /* name first lask reg offset */
1022 BANK_PMX("Z", GPIOZ_0
, GPIOZ_10
, 0x2, 0),
1023 BANK_PMX("BOOT", BOOT_0
, BOOT_14
, 0x0, 0),
1024 BANK_PMX("A", GPIOA_0
, GPIOA_20
, 0xb, 0),
1025 BANK_PMX("X", GPIOX_0
, GPIOX_22
, 0x4, 0),
1026 BANK_PMX("Y", GPIOY_0
, GPIOY_15
, 0x8, 0),
1029 static struct meson_axg_pmx_data meson_axg_periphs_pmx_banks_data
= {
1030 .pmx_banks
= meson_axg_periphs_pmx_banks
,
1031 .num_pmx_banks
= ARRAY_SIZE(meson_axg_periphs_pmx_banks
),
1034 static struct meson_pmx_bank meson_axg_aobus_pmx_banks
[] = {
1035 BANK_PMX("AO", GPIOAO_0
, GPIOAO_13
, 0x0, 0),
1038 static struct meson_axg_pmx_data meson_axg_aobus_pmx_banks_data
= {
1039 .pmx_banks
= meson_axg_aobus_pmx_banks
,
1040 .num_pmx_banks
= ARRAY_SIZE(meson_axg_aobus_pmx_banks
),
1043 static struct meson_pinctrl_data meson_axg_periphs_pinctrl_data
= {
1044 .name
= "periphs-banks",
1045 .pins
= meson_axg_periphs_pins
,
1046 .groups
= meson_axg_periphs_groups
,
1047 .funcs
= meson_axg_periphs_functions
,
1048 .banks
= meson_axg_periphs_banks
,
1049 .num_pins
= ARRAY_SIZE(meson_axg_periphs_pins
),
1050 .num_groups
= ARRAY_SIZE(meson_axg_periphs_groups
),
1051 .num_funcs
= ARRAY_SIZE(meson_axg_periphs_functions
),
1052 .num_banks
= ARRAY_SIZE(meson_axg_periphs_banks
),
1053 .pmx_ops
= &meson_axg_pmx_ops
,
1054 .pmx_data
= &meson_axg_periphs_pmx_banks_data
,
1057 static struct meson_pinctrl_data meson_axg_aobus_pinctrl_data
= {
1058 .name
= "aobus-banks",
1059 .pins
= meson_axg_aobus_pins
,
1060 .groups
= meson_axg_aobus_groups
,
1061 .funcs
= meson_axg_aobus_functions
,
1062 .banks
= meson_axg_aobus_banks
,
1063 .num_pins
= ARRAY_SIZE(meson_axg_aobus_pins
),
1064 .num_groups
= ARRAY_SIZE(meson_axg_aobus_groups
),
1065 .num_funcs
= ARRAY_SIZE(meson_axg_aobus_functions
),
1066 .num_banks
= ARRAY_SIZE(meson_axg_aobus_banks
),
1067 .pmx_ops
= &meson_axg_pmx_ops
,
1068 .pmx_data
= &meson_axg_aobus_pmx_banks_data
,
1069 .parse_dt
= meson8_aobus_parse_dt_extra
,
1072 static const struct of_device_id meson_axg_pinctrl_dt_match
[] = {
1074 .compatible
= "amlogic,meson-axg-periphs-pinctrl",
1075 .data
= &meson_axg_periphs_pinctrl_data
,
1078 .compatible
= "amlogic,meson-axg-aobus-pinctrl",
1079 .data
= &meson_axg_aobus_pinctrl_data
,
1084 static struct platform_driver meson_axg_pinctrl_driver
= {
1085 .probe
= meson_pinctrl_probe
,
1087 .name
= "meson-axg-pinctrl",
1088 .of_match_table
= meson_axg_pinctrl_dt_match
,
1092 builtin_platform_driver(meson_axg_pinctrl_driver
);