2 * Pin controller and GPIO driver for Amlogic Meson GXL.
4 * Copyright (C) 2016 Endless Mobile, Inc.
5 * Author: Carlo Caione <carlo@endlessm.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
11 * You should have received a copy of the GNU General Public License
12 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 #include <dt-bindings/gpio/meson-gxl-gpio.h>
16 #include "pinctrl-meson.h"
17 #include "pinctrl-meson8-pmx.h"
19 static const struct pinctrl_pin_desc meson_gxl_periphs_pins
[] = {
100 MESON_PIN(GPIODV_27
),
101 MESON_PIN(GPIODV_28
),
102 MESON_PIN(GPIODV_29
),
124 MESON_PIN(GPIOCLK_0
),
125 MESON_PIN(GPIOCLK_1
),
128 static const unsigned int emmc_nand_d07_pins
[] = {
129 BOOT_0
, BOOT_1
, BOOT_2
, BOOT_3
, BOOT_4
, BOOT_5
, BOOT_6
, 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_15
};
135 static const unsigned int nor_d_pins
[] = { BOOT_11
};
136 static const unsigned int nor_q_pins
[] = { BOOT_12
};
137 static const unsigned int nor_c_pins
[] = { BOOT_13
};
138 static const unsigned int nor_cs_pins
[] = { BOOT_15
};
140 static const unsigned int spi_mosi_pins
[] = { GPIOX_8
};
141 static const unsigned int spi_miso_pins
[] = { GPIOX_9
};
142 static const unsigned int spi_ss0_pins
[] = { GPIOX_10
};
143 static const unsigned int spi_sclk_pins
[] = { GPIOX_11
};
145 static const unsigned int sdcard_d0_pins
[] = { CARD_1
};
146 static const unsigned int sdcard_d1_pins
[] = { CARD_0
};
147 static const unsigned int sdcard_d2_pins
[] = { CARD_5
};
148 static const unsigned int sdcard_d3_pins
[] = { CARD_4
};
149 static const unsigned int sdcard_cmd_pins
[] = { CARD_3
};
150 static const unsigned int sdcard_clk_pins
[] = { CARD_2
};
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_cmd_pins
[] = { GPIOX_4
};
157 static const unsigned int sdio_clk_pins
[] = { GPIOX_5
};
158 static const unsigned int sdio_irq_pins
[] = { GPIOX_7
};
160 static const unsigned int nand_ce0_pins
[] = { BOOT_8
};
161 static const unsigned int nand_ce1_pins
[] = { BOOT_9
};
162 static const unsigned int nand_rb0_pins
[] = { BOOT_10
};
163 static const unsigned int nand_ale_pins
[] = { BOOT_11
};
164 static const unsigned int nand_cle_pins
[] = { BOOT_12
};
165 static const unsigned int nand_wen_clk_pins
[] = { BOOT_13
};
166 static const unsigned int nand_ren_wr_pins
[] = { BOOT_14
};
167 static const unsigned int nand_dqs_pins
[] = { BOOT_15
};
169 static const unsigned int uart_tx_a_pins
[] = { GPIOX_12
};
170 static const unsigned int uart_rx_a_pins
[] = { GPIOX_13
};
171 static const unsigned int uart_cts_a_pins
[] = { GPIOX_14
};
172 static const unsigned int uart_rts_a_pins
[] = { GPIOX_15
};
174 static const unsigned int uart_tx_b_pins
[] = { GPIODV_24
};
175 static const unsigned int uart_rx_b_pins
[] = { GPIODV_25
};
176 static const unsigned int uart_cts_b_pins
[] = { GPIODV_26
};
177 static const unsigned int uart_rts_b_pins
[] = { GPIODV_27
};
179 static const unsigned int uart_tx_c_pins
[] = { GPIOX_8
};
180 static const unsigned int uart_rx_c_pins
[] = { GPIOX_9
};
181 static const unsigned int uart_cts_c_pins
[] = { GPIOX_10
};
182 static const unsigned int uart_rts_c_pins
[] = { GPIOX_11
};
184 static const unsigned int i2c_sck_a_pins
[] = { GPIODV_25
};
185 static const unsigned int i2c_sda_a_pins
[] = { GPIODV_24
};
187 static const unsigned int i2c_sck_b_pins
[] = { GPIODV_27
};
188 static const unsigned int i2c_sda_b_pins
[] = { GPIODV_26
};
190 static const unsigned int i2c_sck_c_pins
[] = { GPIODV_29
};
191 static const unsigned int i2c_sda_c_pins
[] = { GPIODV_28
};
193 static const unsigned int i2c_sck_c_dv19_pins
[] = { GPIODV_19
};
194 static const unsigned int i2c_sda_c_dv18_pins
[] = { GPIODV_18
};
196 static const unsigned int eth_mdio_pins
[] = { GPIOZ_0
};
197 static const unsigned int eth_mdc_pins
[] = { GPIOZ_1
};
198 static const unsigned int eth_clk_rx_clk_pins
[] = { GPIOZ_2
};
199 static const unsigned int eth_rx_dv_pins
[] = { GPIOZ_3
};
200 static const unsigned int eth_rxd0_pins
[] = { GPIOZ_4
};
201 static const unsigned int eth_rxd1_pins
[] = { GPIOZ_5
};
202 static const unsigned int eth_rxd2_pins
[] = { GPIOZ_6
};
203 static const unsigned int eth_rxd3_pins
[] = { GPIOZ_7
};
204 static const unsigned int eth_rgmii_tx_clk_pins
[] = { GPIOZ_8
};
205 static const unsigned int eth_tx_en_pins
[] = { GPIOZ_9
};
206 static const unsigned int eth_txd0_pins
[] = { GPIOZ_10
};
207 static const unsigned int eth_txd1_pins
[] = { GPIOZ_11
};
208 static const unsigned int eth_txd2_pins
[] = { GPIOZ_12
};
209 static const unsigned int eth_txd3_pins
[] = { GPIOZ_13
};
211 static const unsigned int pwm_a_pins
[] = { GPIOX_6
};
213 static const unsigned int pwm_b_pins
[] = { GPIODV_29
};
215 static const unsigned int pwm_c_pins
[] = { GPIOZ_15
};
217 static const unsigned int pwm_d_pins
[] = { GPIODV_28
};
219 static const unsigned int pwm_e_pins
[] = { GPIOX_16
};
221 static const unsigned int pwm_f_clk_pins
[] = { GPIOCLK_1
};
222 static const unsigned int pwm_f_x_pins
[] = { GPIOX_7
};
224 static const unsigned int hdmi_hpd_pins
[] = { GPIOH_0
};
225 static const unsigned int hdmi_sda_pins
[] = { GPIOH_1
};
226 static const unsigned int hdmi_scl_pins
[] = { GPIOH_2
};
228 static const unsigned int i2s_am_clk_pins
[] = { GPIOH_6
};
229 static const unsigned int i2s_out_ao_clk_pins
[] = { GPIOH_7
};
230 static const unsigned int i2s_out_lr_clk_pins
[] = { GPIOH_8
};
231 static const unsigned int i2s_out_ch01_pins
[] = { GPIOH_9
};
232 static const unsigned int i2s_out_ch23_z_pins
[] = { GPIOZ_5
};
233 static const unsigned int i2s_out_ch45_z_pins
[] = { GPIOZ_6
};
234 static const unsigned int i2s_out_ch67_z_pins
[] = { GPIOZ_7
};
236 static const unsigned int spdif_out_h_pins
[] = { GPIOH_4
};
238 static const unsigned int eth_link_led_pins
[] = { GPIOZ_14
};
239 static const unsigned int eth_act_led_pins
[] = { GPIOZ_15
};
241 static const unsigned int tsin_a_d0_pins
[] = { GPIODV_0
};
242 static const unsigned int tsin_a_d0_x_pins
[] = { GPIOX_10
};
243 static const unsigned int tsin_a_clk_pins
[] = { GPIODV_8
};
244 static const unsigned int tsin_a_clk_x_pins
[] = { GPIOX_11
};
245 static const unsigned int tsin_a_sop_pins
[] = { GPIODV_9
};
246 static const unsigned int tsin_a_sop_x_pins
[] = { GPIOX_8
};
247 static const unsigned int tsin_a_d_valid_pins
[] = { GPIODV_10
};
248 static const unsigned int tsin_a_d_valid_x_pins
[] = { GPIOX_9
};
249 static const unsigned int tsin_a_fail_pins
[] = { GPIODV_11
};
250 static const unsigned int tsin_a_dp_pins
[] = {
251 GPIODV_1
, GPIODV_2
, GPIODV_3
, GPIODV_4
, GPIODV_5
, GPIODV_6
, GPIODV_7
,
254 static const struct pinctrl_pin_desc meson_gxl_aobus_pins
[] = {
266 MESON_PIN(GPIO_TEST_N
),
269 static const unsigned int uart_tx_ao_a_pins
[] = { GPIOAO_0
};
270 static const unsigned int uart_rx_ao_a_pins
[] = { GPIOAO_1
};
271 static const unsigned int uart_tx_ao_b_0_pins
[] = { GPIOAO_0
};
272 static const unsigned int uart_rx_ao_b_1_pins
[] = { GPIOAO_1
};
273 static const unsigned int uart_cts_ao_a_pins
[] = { GPIOAO_2
};
274 static const unsigned int uart_rts_ao_a_pins
[] = { GPIOAO_3
};
275 static const unsigned int uart_tx_ao_b_pins
[] = { GPIOAO_4
};
276 static const unsigned int uart_rx_ao_b_pins
[] = { GPIOAO_5
};
277 static const unsigned int uart_cts_ao_b_pins
[] = { GPIOAO_2
};
278 static const unsigned int uart_rts_ao_b_pins
[] = { GPIOAO_3
};
280 static const unsigned int i2c_sck_ao_pins
[] = {GPIOAO_4
};
281 static const unsigned int i2c_sda_ao_pins
[] = {GPIOAO_5
};
282 static const unsigned int i2c_slave_sck_ao_pins
[] = {GPIOAO_4
};
283 static const unsigned int i2c_slave_sda_ao_pins
[] = {GPIOAO_5
};
285 static const unsigned int remote_input_ao_pins
[] = {GPIOAO_7
};
287 static const unsigned int pwm_ao_a_3_pins
[] = { GPIOAO_3
};
288 static const unsigned int pwm_ao_a_8_pins
[] = { GPIOAO_8
};
290 static const unsigned int pwm_ao_b_pins
[] = { GPIOAO_9
};
291 static const unsigned int pwm_ao_b_6_pins
[] = { GPIOAO_6
};
293 static const unsigned int i2s_out_ch23_ao_pins
[] = { GPIOAO_8
};
294 static const unsigned int i2s_out_ch45_ao_pins
[] = { GPIOAO_9
};
295 static const unsigned int i2s_out_ch67_ao_pins
[] = { GPIO_TEST_N
};
297 static const unsigned int spdif_out_ao_6_pins
[] = { GPIOAO_6
};
298 static const unsigned int spdif_out_ao_9_pins
[] = { GPIOAO_9
};
300 static const unsigned int ao_cec_pins
[] = { GPIOAO_8
};
301 static const unsigned int ee_cec_pins
[] = { GPIOAO_8
};
303 static struct meson_pmx_group meson_gxl_periphs_groups
[] = {
314 GPIO_GROUP(GPIOZ_10
),
315 GPIO_GROUP(GPIOZ_11
),
316 GPIO_GROUP(GPIOZ_12
),
317 GPIO_GROUP(GPIOZ_13
),
318 GPIO_GROUP(GPIOZ_14
),
319 GPIO_GROUP(GPIOZ_15
),
357 GPIO_GROUP(GPIODV_0
),
358 GPIO_GROUP(GPIODV_1
),
359 GPIO_GROUP(GPIODV_2
),
360 GPIO_GROUP(GPIODV_3
),
361 GPIO_GROUP(GPIODV_4
),
362 GPIO_GROUP(GPIODV_5
),
363 GPIO_GROUP(GPIODV_6
),
364 GPIO_GROUP(GPIODV_7
),
365 GPIO_GROUP(GPIODV_8
),
366 GPIO_GROUP(GPIODV_9
),
367 GPIO_GROUP(GPIODV_10
),
368 GPIO_GROUP(GPIODV_11
),
369 GPIO_GROUP(GPIODV_12
),
370 GPIO_GROUP(GPIODV_13
),
371 GPIO_GROUP(GPIODV_14
),
372 GPIO_GROUP(GPIODV_15
),
373 GPIO_GROUP(GPIODV_16
),
374 GPIO_GROUP(GPIODV_17
),
375 GPIO_GROUP(GPIODV_19
),
376 GPIO_GROUP(GPIODV_20
),
377 GPIO_GROUP(GPIODV_21
),
378 GPIO_GROUP(GPIODV_22
),
379 GPIO_GROUP(GPIODV_23
),
380 GPIO_GROUP(GPIODV_24
),
381 GPIO_GROUP(GPIODV_25
),
382 GPIO_GROUP(GPIODV_26
),
383 GPIO_GROUP(GPIODV_27
),
384 GPIO_GROUP(GPIODV_28
),
385 GPIO_GROUP(GPIODV_29
),
397 GPIO_GROUP(GPIOX_10
),
398 GPIO_GROUP(GPIOX_11
),
399 GPIO_GROUP(GPIOX_12
),
400 GPIO_GROUP(GPIOX_13
),
401 GPIO_GROUP(GPIOX_14
),
402 GPIO_GROUP(GPIOX_15
),
403 GPIO_GROUP(GPIOX_16
),
404 GPIO_GROUP(GPIOX_17
),
405 GPIO_GROUP(GPIOX_18
),
407 GPIO_GROUP(GPIOCLK_0
),
408 GPIO_GROUP(GPIOCLK_1
),
410 GPIO_GROUP(GPIO_TEST_N
),
413 GROUP(sdio_d0
, 5, 31),
414 GROUP(sdio_d1
, 5, 30),
415 GROUP(sdio_d2
, 5, 29),
416 GROUP(sdio_d3
, 5, 28),
417 GROUP(sdio_clk
, 5, 27),
418 GROUP(sdio_cmd
, 5, 26),
419 GROUP(sdio_irq
, 5, 24),
420 GROUP(uart_tx_a
, 5, 19),
421 GROUP(uart_rx_a
, 5, 18),
422 GROUP(uart_cts_a
, 5, 17),
423 GROUP(uart_rts_a
, 5, 16),
424 GROUP(uart_tx_c
, 5, 13),
425 GROUP(uart_rx_c
, 5, 12),
426 GROUP(uart_cts_c
, 5, 11),
427 GROUP(uart_rts_c
, 5, 10),
430 GROUP(pwm_f_x
, 5, 14),
431 GROUP(spi_mosi
, 5, 3),
432 GROUP(spi_miso
, 5, 2),
433 GROUP(spi_ss0
, 5, 1),
434 GROUP(spi_sclk
, 5, 0),
435 GROUP(tsin_a_sop_x
, 6, 3),
436 GROUP(tsin_a_d_valid_x
, 6, 2),
437 GROUP(tsin_a_d0_x
, 6, 1),
438 GROUP(tsin_a_clk_x
, 6, 0),
441 GROUP(eth_mdio
, 4, 23),
442 GROUP(eth_mdc
, 4, 22),
443 GROUP(eth_clk_rx_clk
, 4, 21),
444 GROUP(eth_rx_dv
, 4, 20),
445 GROUP(eth_rxd0
, 4, 19),
446 GROUP(eth_rxd1
, 4, 18),
447 GROUP(eth_rxd2
, 4, 17),
448 GROUP(eth_rxd3
, 4, 16),
449 GROUP(eth_rgmii_tx_clk
, 4, 15),
450 GROUP(eth_tx_en
, 4, 14),
451 GROUP(eth_txd0
, 4, 13),
452 GROUP(eth_txd1
, 4, 12),
453 GROUP(eth_txd2
, 4, 11),
454 GROUP(eth_txd3
, 4, 10),
456 GROUP(i2s_out_ch23_z
, 3, 26),
457 GROUP(i2s_out_ch45_z
, 3, 25),
458 GROUP(i2s_out_ch67_z
, 3, 24),
459 GROUP(eth_link_led
, 4, 25),
460 GROUP(eth_act_led
, 4, 24),
463 GROUP(hdmi_hpd
, 6, 31),
464 GROUP(hdmi_sda
, 6, 30),
465 GROUP(hdmi_scl
, 6, 29),
466 GROUP(i2s_am_clk
, 6, 26),
467 GROUP(i2s_out_ao_clk
, 6, 25),
468 GROUP(i2s_out_lr_clk
, 6, 24),
469 GROUP(i2s_out_ch01
, 6, 23),
470 GROUP(spdif_out_h
, 6, 28),
473 GROUP(uart_tx_b
, 2, 16),
474 GROUP(uart_rx_b
, 2, 15),
475 GROUP(uart_cts_b
, 2, 14),
476 GROUP(uart_rts_b
, 2, 13),
477 GROUP(i2c_sda_c_dv18
, 1, 17),
478 GROUP(i2c_sck_c_dv19
, 1, 16),
479 GROUP(i2c_sda_a
, 1, 15),
480 GROUP(i2c_sck_a
, 1, 14),
481 GROUP(i2c_sda_b
, 1, 13),
482 GROUP(i2c_sck_b
, 1, 12),
483 GROUP(i2c_sda_c
, 1, 11),
484 GROUP(i2c_sck_c
, 1, 10),
487 GROUP(tsin_a_d0
, 2, 4),
488 GROUP(tsin_a_dp
, 2, 3),
489 GROUP(tsin_a_clk
, 2, 2),
490 GROUP(tsin_a_sop
, 2, 1),
491 GROUP(tsin_a_d_valid
, 2, 0),
492 GROUP(tsin_a_fail
, 1, 31),
495 GROUP(emmc_nand_d07
, 7, 31),
496 GROUP(emmc_clk
, 7, 30),
497 GROUP(emmc_cmd
, 7, 29),
498 GROUP(emmc_ds
, 7, 28),
502 GROUP(nor_cs
, 7, 10),
503 GROUP(nand_ce0
, 7, 7),
504 GROUP(nand_ce1
, 7, 6),
505 GROUP(nand_rb0
, 7, 5),
506 GROUP(nand_ale
, 7, 4),
507 GROUP(nand_cle
, 7, 3),
508 GROUP(nand_wen_clk
, 7, 2),
509 GROUP(nand_ren_wr
, 7, 1),
510 GROUP(nand_dqs
, 7, 0),
513 GROUP(sdcard_d1
, 6, 5),
514 GROUP(sdcard_d0
, 6, 4),
515 GROUP(sdcard_d3
, 6, 1),
516 GROUP(sdcard_d2
, 6, 0),
517 GROUP(sdcard_cmd
, 6, 2),
518 GROUP(sdcard_clk
, 6, 3),
521 GROUP(pwm_f_clk
, 8, 30),
524 static struct meson_pmx_group meson_gxl_aobus_groups
[] = {
525 GPIO_GROUP(GPIOAO_0
),
526 GPIO_GROUP(GPIOAO_1
),
527 GPIO_GROUP(GPIOAO_2
),
528 GPIO_GROUP(GPIOAO_3
),
529 GPIO_GROUP(GPIOAO_4
),
530 GPIO_GROUP(GPIOAO_5
),
531 GPIO_GROUP(GPIOAO_6
),
532 GPIO_GROUP(GPIOAO_7
),
533 GPIO_GROUP(GPIOAO_8
),
534 GPIO_GROUP(GPIOAO_9
),
537 GROUP(uart_tx_ao_b_0
, 0, 26),
538 GROUP(uart_rx_ao_b_1
, 0, 25),
539 GROUP(uart_tx_ao_b
, 0, 24),
540 GROUP(uart_rx_ao_b
, 0, 23),
541 GROUP(uart_tx_ao_a
, 0, 12),
542 GROUP(uart_rx_ao_a
, 0, 11),
543 GROUP(uart_cts_ao_a
, 0, 10),
544 GROUP(uart_rts_ao_a
, 0, 9),
545 GROUP(uart_cts_ao_b
, 0, 8),
546 GROUP(uart_rts_ao_b
, 0, 7),
547 GROUP(i2c_sck_ao
, 0, 6),
548 GROUP(i2c_sda_ao
, 0, 5),
549 GROUP(i2c_slave_sck_ao
, 0, 2),
550 GROUP(i2c_slave_sda_ao
, 0, 1),
551 GROUP(remote_input_ao
, 0, 0),
552 GROUP(pwm_ao_a_3
, 0, 22),
553 GROUP(pwm_ao_b_6
, 0, 18),
554 GROUP(pwm_ao_a_8
, 0, 17),
555 GROUP(pwm_ao_b
, 0, 3),
556 GROUP(i2s_out_ch23_ao
, 1, 0),
557 GROUP(i2s_out_ch45_ao
, 1, 1),
558 GROUP(spdif_out_ao_6
, 0, 16),
559 GROUP(spdif_out_ao_9
, 0, 4),
560 GROUP(ao_cec
, 0, 15),
561 GROUP(ee_cec
, 0, 14),
564 GROUP(i2s_out_ch67_ao
, 1, 2),
567 static const char * const gpio_periphs_groups
[] = {
568 "GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4",
569 "GPIOZ_5", "GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9",
570 "GPIOZ_10", "GPIOZ_11", "GPIOZ_12", "GPIOZ_13", "GPIOZ_14",
573 "GPIOH_0", "GPIOH_1", "GPIOH_2", "GPIOH_3", "GPIOH_4",
574 "GPIOH_5", "GPIOH_6", "GPIOH_7", "GPIOH_8", "GPIOH_9",
576 "BOOT_0", "BOOT_1", "BOOT_2", "BOOT_3", "BOOT_4",
577 "BOOT_5", "BOOT_6", "BOOT_7", "BOOT_8", "BOOT_9",
578 "BOOT_10", "BOOT_11", "BOOT_12", "BOOT_13", "BOOT_14",
581 "CARD_0", "CARD_1", "CARD_2", "CARD_3", "CARD_4",
584 "GPIODV_0", "GPIODV_1", "GPIODV_2", "GPIODV_3", "GPIODV_4",
585 "GPIODV_5", "GPIODV_6", "GPIODV_7", "GPIODV_8", "GPIODV_9",
586 "GPIODV_10", "GPIODV_11", "GPIODV_12", "GPIODV_13", "GPIODV_14",
587 "GPIODV_15", "GPIODV_16", "GPIODV_17", "GPIODV_18", "GPIODV_19",
588 "GPIODV_20", "GPIODV_21", "GPIODV_22", "GPIODV_23", "GPIODV_24",
589 "GPIODV_25", "GPIODV_26", "GPIODV_27", "GPIODV_28", "GPIODV_29",
591 "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4",
592 "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9",
593 "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14",
594 "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18",
597 static const char * const emmc_groups
[] = {
598 "emmc_nand_d07", "emmc_clk", "emmc_cmd", "emmc_ds",
601 static const char * const nor_groups
[] = {
602 "nor_d", "nor_q", "nor_c", "nor_cs",
605 static const char * const spi_groups
[] = {
606 "spi_mosi", "spi_miso", "spi_ss0", "spi_sclk",
609 static const char * const sdcard_groups
[] = {
610 "sdcard_d0", "sdcard_d1", "sdcard_d2", "sdcard_d3",
611 "sdcard_cmd", "sdcard_clk",
614 static const char * const sdio_groups
[] = {
615 "sdio_d0", "sdio_d1", "sdio_d2", "sdio_d3",
616 "sdio_cmd", "sdio_clk", "sdio_irq",
619 static const char * const nand_groups
[] = {
620 "nand_ce0", "nand_ce1", "nand_rb0", "nand_ale", "nand_cle",
621 "nand_wen_clk", "nand_ren_wr", "nand_dqs",
624 static const char * const uart_a_groups
[] = {
625 "uart_tx_a", "uart_rx_a", "uart_cts_a", "uart_rts_a",
628 static const char * const uart_b_groups
[] = {
629 "uart_tx_b", "uart_rx_b", "uart_cts_b", "uart_rts_b",
632 static const char * const uart_c_groups
[] = {
633 "uart_tx_c", "uart_rx_c", "uart_cts_c", "uart_rts_c",
636 static const char * const i2c_a_groups
[] = {
637 "i2c_sck_a", "i2c_sda_a",
640 static const char * const i2c_b_groups
[] = {
641 "i2c_sck_b", "i2c_sda_b",
644 static const char * const i2c_c_groups
[] = {
645 "i2c_sck_c", "i2c_sda_c", "i2c_sda_c_dv18", "i2c_sck_c_dv19",
648 static const char * const eth_groups
[] = {
649 "eth_mdio", "eth_mdc", "eth_clk_rx_clk", "eth_rx_dv",
650 "eth_rxd0", "eth_rxd1", "eth_rxd2", "eth_rxd3",
651 "eth_rgmii_tx_clk", "eth_tx_en",
652 "eth_txd0", "eth_txd1", "eth_txd2", "eth_txd3",
655 static const char * const pwm_a_groups
[] = {
659 static const char * const pwm_b_groups
[] = {
663 static const char * const pwm_c_groups
[] = {
667 static const char * const pwm_d_groups
[] = {
671 static const char * const pwm_e_groups
[] = {
675 static const char * const pwm_f_groups
[] = {
676 "pwm_f_clk", "pwm_f_x",
679 static const char * const hdmi_hpd_groups
[] = {
683 static const char * const hdmi_i2c_groups
[] = {
684 "hdmi_sda", "hdmi_scl",
687 static const char * const i2s_out_groups
[] = {
688 "i2s_am_clk", "i2s_out_ao_clk", "i2s_out_lr_clk",
689 "i2s_out_ch01", "i2s_out_ch23_z", "i2s_out_ch45_z", "i2s_out_ch67_z",
692 static const char * const spdif_out_groups
[] = {
696 static const char * const eth_led_groups
[] = {
697 "eth_link_led", "eth_act_led",
700 static const char * const tsin_a_groups
[] = {
701 "tsin_a_clk", "tsin_a_clk_x", "tsin_a_sop", "tsin_a_sop_x",
702 "tsin_a_d_valid", "tsin_a_d_valid_x", "tsin_a_d0", "tsin_a_d0_x",
703 "tsin_a_dp", "tsin_a_fail",
706 static const char * const gpio_aobus_groups
[] = {
707 "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4",
708 "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9",
713 static const char * const uart_ao_groups
[] = {
714 "uart_tx_ao_a", "uart_rx_ao_a", "uart_cts_ao_a", "uart_rts_ao_a",
717 static const char * const uart_ao_b_groups
[] = {
718 "uart_tx_ao_b", "uart_rx_ao_b", "uart_cts_ao_b", "uart_rts_ao_b",
719 "uart_tx_ao_b_0", "uart_rx_ao_b_1",
722 static const char * const i2c_ao_groups
[] = {
723 "i2c_sck_ao", "i2c_sda_ao",
726 static const char * const i2c_slave_ao_groups
[] = {
727 "i2c_slave_sck_ao", "i2c_slave_sda_ao",
730 static const char * const remote_input_ao_groups
[] = {
734 static const char * const pwm_ao_a_groups
[] = {
735 "pwm_ao_a_3", "pwm_ao_a_8",
738 static const char * const pwm_ao_b_groups
[] = {
739 "pwm_ao_b", "pwm_ao_b_6",
742 static const char * const i2s_out_ao_groups
[] = {
743 "i2s_out_ch23_ao", "i2s_out_ch45_ao", "i2s_out_ch67_ao",
746 static const char * const spdif_out_ao_groups
[] = {
747 "spdif_out_ao_6", "spdif_out_ao_9",
750 static const char * const cec_ao_groups
[] = {
754 static struct meson_pmx_func meson_gxl_periphs_functions
[] = {
755 FUNCTION(gpio_periphs
),
783 static struct meson_pmx_func meson_gxl_aobus_functions
[] = {
784 FUNCTION(gpio_aobus
),
788 FUNCTION(i2c_slave_ao
),
789 FUNCTION(remote_input_ao
),
792 FUNCTION(i2s_out_ao
),
793 FUNCTION(spdif_out_ao
),
797 static struct meson_bank meson_gxl_periphs_banks
[] = {
798 /* name first last irq pullen pull dir out in */
799 BANK("X", GPIOX_0
, GPIOX_18
, 89, 107, 4, 0, 4, 0, 12, 0, 13, 0, 14, 0),
800 BANK("DV", GPIODV_0
, GPIODV_29
, 83, 88, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0),
801 BANK("H", GPIOH_0
, GPIOH_9
, 26, 35, 1, 20, 1, 20, 3, 20, 4, 20, 5, 20),
802 BANK("Z", GPIOZ_0
, GPIOZ_15
, 10, 25, 3, 0, 3, 0, 9, 0, 10, 0, 11, 0),
803 BANK("CARD", CARD_0
, CARD_6
, 52, 58, 2, 20, 2, 20, 6, 20, 7, 20, 8, 20),
804 BANK("BOOT", BOOT_0
, BOOT_15
, 36, 51, 2, 0, 2, 0, 6, 0, 7, 0, 8, 0),
805 BANK("CLK", GPIOCLK_0
, GPIOCLK_1
, 108, 109, 3, 28, 3, 28, 9, 28, 10, 28, 11, 28),
808 static struct meson_bank meson_gxl_aobus_banks
[] = {
809 /* name first last irq pullen pull dir out in */
810 BANK("AO", GPIOAO_0
, GPIOAO_9
, 0, 9, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0),
813 static struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data
= {
814 .name
= "periphs-banks",
815 .pins
= meson_gxl_periphs_pins
,
816 .groups
= meson_gxl_periphs_groups
,
817 .funcs
= meson_gxl_periphs_functions
,
818 .banks
= meson_gxl_periphs_banks
,
819 .num_pins
= ARRAY_SIZE(meson_gxl_periphs_pins
),
820 .num_groups
= ARRAY_SIZE(meson_gxl_periphs_groups
),
821 .num_funcs
= ARRAY_SIZE(meson_gxl_periphs_functions
),
822 .num_banks
= ARRAY_SIZE(meson_gxl_periphs_banks
),
823 .pmx_ops
= &meson8_pmx_ops
,
826 static struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data
= {
827 .name
= "aobus-banks",
828 .pins
= meson_gxl_aobus_pins
,
829 .groups
= meson_gxl_aobus_groups
,
830 .funcs
= meson_gxl_aobus_functions
,
831 .banks
= meson_gxl_aobus_banks
,
832 .num_pins
= ARRAY_SIZE(meson_gxl_aobus_pins
),
833 .num_groups
= ARRAY_SIZE(meson_gxl_aobus_groups
),
834 .num_funcs
= ARRAY_SIZE(meson_gxl_aobus_functions
),
835 .num_banks
= ARRAY_SIZE(meson_gxl_aobus_banks
),
836 .pmx_ops
= &meson8_pmx_ops
,
839 static const struct of_device_id meson_gxl_pinctrl_dt_match
[] = {
841 .compatible
= "amlogic,meson-gxl-periphs-pinctrl",
842 .data
= &meson_gxl_periphs_pinctrl_data
,
845 .compatible
= "amlogic,meson-gxl-aobus-pinctrl",
846 .data
= &meson_gxl_aobus_pinctrl_data
,
851 static struct platform_driver meson_gxl_pinctrl_driver
= {
852 .probe
= meson_pinctrl_probe
,
854 .name
= "meson-gxl-pinctrl",
855 .of_match_table
= meson_gxl_pinctrl_dt_match
,
858 builtin_platform_driver(meson_gxl_pinctrl_driver
);