2 * Pin controller and GPIO driver for Amlogic Meson8 and Meson8m2.
4 * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
10 * You should have received a copy of the GNU General Public License
11 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 #include <dt-bindings/gpio/meson8-gpio.h>
15 #include "pinctrl-meson.h"
16 #include "pinctrl-meson8-pmx.h"
18 static const struct pinctrl_pin_desc meson8_cbus_pins
[] = {
141 static const struct pinctrl_pin_desc meson8_aobus_pins
[] = {
152 MESON_PIN(GPIOAO_10
),
153 MESON_PIN(GPIOAO_11
),
154 MESON_PIN(GPIOAO_12
),
155 MESON_PIN(GPIOAO_13
),
156 MESON_PIN(GPIO_BSD_EN
),
157 MESON_PIN(GPIO_TEST_N
),
161 static const unsigned int sd_d0_a_pins
[] = { GPIOX_0
};
162 static const unsigned int sd_d1_a_pins
[] = { GPIOX_1
};
163 static const unsigned int sd_d2_a_pins
[] = { GPIOX_2
};
164 static const unsigned int sd_d3_a_pins
[] = { GPIOX_3
};
165 static const unsigned int sd_clk_a_pins
[] = { GPIOX_8
};
166 static const unsigned int sd_cmd_a_pins
[] = { GPIOX_9
};
168 static const unsigned int sdxc_d0_a_pins
[] = { GPIOX_0
};
169 static const unsigned int sdxc_d13_a_pins
[] = { GPIOX_1
, GPIOX_2
, GPIOX_3
};
170 static const unsigned int sdxc_d47_a_pins
[] = { GPIOX_4
, GPIOX_5
, GPIOX_6
,
172 static const unsigned int sdxc_clk_a_pins
[] = { GPIOX_8
};
173 static const unsigned int sdxc_cmd_a_pins
[] = { GPIOX_9
};
175 static const unsigned int pcm_out_a_pins
[] = { GPIOX_4
};
176 static const unsigned int pcm_in_a_pins
[] = { GPIOX_5
};
177 static const unsigned int pcm_fs_a_pins
[] = { GPIOX_6
};
178 static const unsigned int pcm_clk_a_pins
[] = { GPIOX_7
};
180 static const unsigned int uart_tx_a0_pins
[] = { GPIOX_4
};
181 static const unsigned int uart_rx_a0_pins
[] = { GPIOX_5
};
182 static const unsigned int uart_cts_a0_pins
[] = { GPIOX_6
};
183 static const unsigned int uart_rts_a0_pins
[] = { GPIOX_7
};
185 static const unsigned int uart_tx_a1_pins
[] = { GPIOX_12
};
186 static const unsigned int uart_rx_a1_pins
[] = { GPIOX_13
};
187 static const unsigned int uart_cts_a1_pins
[] = { GPIOX_14
};
188 static const unsigned int uart_rts_a1_pins
[] = { GPIOX_15
};
190 static const unsigned int uart_tx_b0_pins
[] = { GPIOX_16
};
191 static const unsigned int uart_rx_b0_pins
[] = { GPIOX_17
};
192 static const unsigned int uart_cts_b0_pins
[] = { GPIOX_18
};
193 static const unsigned int uart_rts_b0_pins
[] = { GPIOX_19
};
195 static const unsigned int iso7816_det_pins
[] = { GPIOX_16
};
196 static const unsigned int iso7816_reset_pins
[] = { GPIOX_17
};
197 static const unsigned int iso7816_clk_pins
[] = { GPIOX_18
};
198 static const unsigned int iso7816_data_pins
[] = { GPIOX_19
};
200 static const unsigned int i2c_sda_d0_pins
[] = { GPIOX_16
};
201 static const unsigned int i2c_sck_d0_pins
[] = { GPIOX_17
};
203 static const unsigned int xtal_32k_out_pins
[] = { GPIOX_10
};
204 static const unsigned int xtal_24m_out_pins
[] = { GPIOX_11
};
206 static const unsigned int pwm_e_pins
[] = { GPIOX_10
};
207 static const unsigned int pwm_b_x_pins
[] = { GPIOX_11
};
210 static const unsigned int uart_tx_c_pins
[] = { GPIOY_0
};
211 static const unsigned int uart_rx_c_pins
[] = { GPIOY_1
};
212 static const unsigned int uart_cts_c_pins
[] = { GPIOY_2
};
213 static const unsigned int uart_rts_c_pins
[] = { GPIOY_3
};
215 static const unsigned int pcm_out_b_pins
[] = { GPIOY_4
};
216 static const unsigned int pcm_in_b_pins
[] = { GPIOY_5
};
217 static const unsigned int pcm_fs_b_pins
[] = { GPIOY_6
};
218 static const unsigned int pcm_clk_b_pins
[] = { GPIOY_7
};
220 static const unsigned int i2c_sda_c0_pins
[] = { GPIOY_0
};
221 static const unsigned int i2c_sck_c0_pins
[] = { GPIOY_1
};
223 static const unsigned int pwm_a_y_pins
[] = { GPIOY_16
};
225 static const unsigned int i2s_out_ch45_pins
[] = { GPIOY_0
};
226 static const unsigned int i2s_out_ch23_pins
[] = { GPIOY_1
};
227 static const unsigned int i2s_out_ch01_pins
[] = { GPIOY_4
};
228 static const unsigned int i2s_in_ch01_pins
[] = { GPIOY_5
};
229 static const unsigned int i2s_lr_clk_in_pins
[] = { GPIOY_6
};
230 static const unsigned int i2s_ao_clk_in_pins
[] = { GPIOY_7
};
231 static const unsigned int i2s_am_clk_pins
[] = { GPIOY_8
};
232 static const unsigned int i2s_out_ch78_pins
[] = { GPIOY_9
};
234 static const unsigned int spdif_in_pins
[] = { GPIOY_2
};
235 static const unsigned int spdif_out_pins
[] = { GPIOY_3
};
238 static const unsigned int dvin_rgb_pins
[] = {
239 GPIODV_0
, GPIODV_1
, GPIODV_2
, GPIODV_3
, GPIODV_4
, GPIODV_5
,
240 GPIODV_6
, GPIODV_7
, GPIODV_8
, GPIODV_9
, GPIODV_10
, GPIODV_11
,
241 GPIODV_12
, GPIODV_13
, GPIODV_14
, GPIODV_15
, GPIODV_16
, GPIODV_17
,
242 GPIODV_18
, GPIODV_19
, GPIODV_20
, GPIODV_21
, GPIODV_22
, GPIODV_23
244 static const unsigned int dvin_vs_pins
[] = { GPIODV_24
};
245 static const unsigned int dvin_hs_pins
[] = { GPIODV_25
};
246 static const unsigned int dvin_clk_pins
[] = { GPIODV_26
};
247 static const unsigned int dvin_de_pins
[] = { GPIODV_27
};
249 static const unsigned int enc_0_pins
[] = { GPIODV_0
};
250 static const unsigned int enc_1_pins
[] = { GPIODV_1
};
251 static const unsigned int enc_2_pins
[] = { GPIODV_2
};
252 static const unsigned int enc_3_pins
[] = { GPIODV_3
};
253 static const unsigned int enc_4_pins
[] = { GPIODV_4
};
254 static const unsigned int enc_5_pins
[] = { GPIODV_5
};
255 static const unsigned int enc_6_pins
[] = { GPIODV_6
};
256 static const unsigned int enc_7_pins
[] = { GPIODV_7
};
257 static const unsigned int enc_8_pins
[] = { GPIODV_8
};
258 static const unsigned int enc_9_pins
[] = { GPIODV_9
};
259 static const unsigned int enc_10_pins
[] = { GPIODV_10
};
260 static const unsigned int enc_11_pins
[] = { GPIODV_11
};
261 static const unsigned int enc_12_pins
[] = { GPIODV_12
};
262 static const unsigned int enc_13_pins
[] = { GPIODV_13
};
263 static const unsigned int enc_14_pins
[] = { GPIODV_14
};
264 static const unsigned int enc_15_pins
[] = { GPIODV_15
};
265 static const unsigned int enc_16_pins
[] = { GPIODV_16
};
266 static const unsigned int enc_17_pins
[] = { GPIODV_17
};
268 static const unsigned int uart_tx_b1_pins
[] = { GPIODV_24
};
269 static const unsigned int uart_rx_b1_pins
[] = { GPIODV_25
};
270 static const unsigned int uart_cts_b1_pins
[] = { GPIODV_26
};
271 static const unsigned int uart_rts_b1_pins
[] = { GPIODV_27
};
273 static const unsigned int vga_vs_pins
[] = { GPIODV_24
};
274 static const unsigned int vga_hs_pins
[] = { GPIODV_25
};
276 static const unsigned int pwm_c_dv9_pins
[] = { GPIODV_9
};
277 static const unsigned int pwm_c_dv29_pins
[] = { GPIODV_29
};
278 static const unsigned int pwm_d_pins
[] = { GPIODV_28
};
281 static const unsigned int hdmi_hpd_pins
[] = { GPIOH_0
};
282 static const unsigned int hdmi_sda_pins
[] = { GPIOH_1
};
283 static const unsigned int hdmi_scl_pins
[] = { GPIOH_2
};
284 static const unsigned int hdmi_cec_pins
[] = { GPIOH_3
};
286 static const unsigned int spi_ss0_0_pins
[] = { GPIOH_3
};
287 static const unsigned int spi_miso_0_pins
[] = { GPIOH_4
};
288 static const unsigned int spi_mosi_0_pins
[] = { GPIOH_5
};
289 static const unsigned int spi_sclk_0_pins
[] = { GPIOH_6
};
291 static const unsigned int i2c_sda_d1_pins
[] = { GPIOH_7
};
292 static const unsigned int i2c_sck_d1_pins
[] = { GPIOH_8
};
295 static const unsigned int spi_ss0_1_pins
[] = { GPIOZ_9
};
296 static const unsigned int spi_ss1_1_pins
[] = { GPIOZ_10
};
297 static const unsigned int spi_sclk_1_pins
[] = { GPIOZ_11
};
298 static const unsigned int spi_mosi_1_pins
[] = { GPIOZ_12
};
299 static const unsigned int spi_miso_1_pins
[] = { GPIOZ_13
};
300 static const unsigned int spi_ss2_1_pins
[] = { GPIOZ_14
};
302 static const unsigned int eth_txd3_pins
[] = { GPIOZ_0
};
303 static const unsigned int eth_txd2_pins
[] = { GPIOZ_1
};
304 static const unsigned int eth_rxd3_pins
[] = { GPIOZ_2
};
305 static const unsigned int eth_rxd2_pins
[] = { GPIOZ_3
};
306 static const unsigned int eth_tx_clk_50m_pins
[] = { GPIOZ_4
};
307 static const unsigned int eth_tx_en_pins
[] = { GPIOZ_5
};
308 static const unsigned int eth_txd1_pins
[] = { GPIOZ_6
};
309 static const unsigned int eth_txd0_pins
[] = { GPIOZ_7
};
310 static const unsigned int eth_rx_clk_in_pins
[] = { GPIOZ_8
};
311 static const unsigned int eth_rx_dv_pins
[] = { GPIOZ_9
};
312 static const unsigned int eth_rxd1_pins
[] = { GPIOZ_10
};
313 static const unsigned int eth_rxd0_pins
[] = { GPIOZ_11
};
314 static const unsigned int eth_mdio_pins
[] = { GPIOZ_12
};
315 static const unsigned int eth_mdc_pins
[] = { GPIOZ_13
};
317 static const unsigned int i2c_sda_a0_pins
[] = { GPIOZ_0
};
318 static const unsigned int i2c_sck_a0_pins
[] = { GPIOZ_1
};
320 static const unsigned int i2c_sda_b_pins
[] = { GPIOZ_2
};
321 static const unsigned int i2c_sck_b_pins
[] = { GPIOZ_3
};
323 static const unsigned int i2c_sda_c1_pins
[] = { GPIOZ_4
};
324 static const unsigned int i2c_sck_c1_pins
[] = { GPIOZ_5
};
326 static const unsigned int i2c_sda_a1_pins
[] = { GPIOZ_0
};
327 static const unsigned int i2c_sck_a1_pins
[] = { GPIOZ_1
};
329 static const unsigned int i2c_sda_a2_pins
[] = { GPIOZ_0
};
330 static const unsigned int i2c_sck_a2_pins
[] = { GPIOZ_1
};
332 static const unsigned int pwm_a_z0_pins
[] = { GPIOZ_0
};
333 static const unsigned int pwm_a_z7_pins
[] = { GPIOZ_7
};
334 static const unsigned int pwm_b_z_pins
[] = { GPIOZ_1
};
335 static const unsigned int pwm_c_z_pins
[] = { GPIOZ_8
};
338 static const unsigned int sd_d0_c_pins
[] = { BOOT_0
};
339 static const unsigned int sd_d1_c_pins
[] = { BOOT_1
};
340 static const unsigned int sd_d2_c_pins
[] = { BOOT_2
};
341 static const unsigned int sd_d3_c_pins
[] = { BOOT_3
};
342 static const unsigned int sd_cmd_c_pins
[] = { BOOT_16
};
343 static const unsigned int sd_clk_c_pins
[] = { BOOT_17
};
345 static const unsigned int sdxc_d0_c_pins
[] = { BOOT_0
};
346 static const unsigned int sdxc_d13_c_pins
[] = { BOOT_1
, BOOT_2
, BOOT_3
};
347 static const unsigned int sdxc_d47_c_pins
[] = { BOOT_4
, BOOT_5
, BOOT_6
,
349 static const unsigned int sdxc_cmd_c_pins
[] = { BOOT_16
};
350 static const unsigned int sdxc_clk_c_pins
[] = { BOOT_17
};
352 static const unsigned int nand_io_pins
[] = {
353 BOOT_0
, BOOT_1
, BOOT_2
, BOOT_3
, BOOT_4
, BOOT_5
, BOOT_6
, BOOT_7
355 static const unsigned int nand_io_ce0_pins
[] = { BOOT_8
};
356 static const unsigned int nand_io_ce1_pins
[] = { BOOT_9
};
357 static const unsigned int nand_io_rb0_pins
[] = { BOOT_10
};
358 static const unsigned int nand_ale_pins
[] = { BOOT_11
};
359 static const unsigned int nand_cle_pins
[] = { BOOT_12
};
360 static const unsigned int nand_wen_clk_pins
[] = { BOOT_13
};
361 static const unsigned int nand_ren_clk_pins
[] = { BOOT_14
};
362 static const unsigned int nand_dqs_pins
[] = { BOOT_15
};
363 static const unsigned int nand_ce2_pins
[] = { BOOT_16
};
364 static const unsigned int nand_ce3_pins
[] = { BOOT_17
};
366 static const unsigned int nor_d_pins
[] = { BOOT_11
};
367 static const unsigned int nor_q_pins
[] = { BOOT_12
};
368 static const unsigned int nor_c_pins
[] = { BOOT_13
};
369 static const unsigned int nor_cs_pins
[] = { BOOT_18
};
372 static const unsigned int sd_d1_b_pins
[] = { CARD_0
};
373 static const unsigned int sd_d0_b_pins
[] = { CARD_1
};
374 static const unsigned int sd_clk_b_pins
[] = { CARD_2
};
375 static const unsigned int sd_cmd_b_pins
[] = { CARD_3
};
376 static const unsigned int sd_d3_b_pins
[] = { CARD_4
};
377 static const unsigned int sd_d2_b_pins
[] = { CARD_5
};
379 static const unsigned int sdxc_d13_b_pins
[] = { CARD_0
, CARD_4
, CARD_5
};
380 static const unsigned int sdxc_d0_b_pins
[] = { CARD_1
};
381 static const unsigned int sdxc_clk_b_pins
[] = { CARD_2
};
382 static const unsigned int sdxc_cmd_b_pins
[] = { CARD_3
};
385 static const unsigned int uart_tx_ao_a_pins
[] = { GPIOAO_0
};
386 static const unsigned int uart_rx_ao_a_pins
[] = { GPIOAO_1
};
387 static const unsigned int uart_cts_ao_a_pins
[] = { GPIOAO_2
};
388 static const unsigned int uart_rts_ao_a_pins
[] = { GPIOAO_3
};
390 static const unsigned int remote_input_pins
[] = { GPIOAO_7
};
391 static const unsigned int remote_output_ao_pins
[] = { GPIOAO_13
};
393 static const unsigned int i2c_slave_sck_ao_pins
[] = { GPIOAO_4
};
394 static const unsigned int i2c_slave_sda_ao_pins
[] = { GPIOAO_5
};
396 static const unsigned int uart_tx_ao_b0_pins
[] = { GPIOAO_0
};
397 static const unsigned int uart_rx_ao_b0_pins
[] = { GPIOAO_1
};
399 static const unsigned int uart_tx_ao_b1_pins
[] = { GPIOAO_4
};
400 static const unsigned int uart_rx_ao_b1_pins
[] = { GPIOAO_5
};
402 static const unsigned int i2c_mst_sck_ao_pins
[] = { GPIOAO_4
};
403 static const unsigned int i2c_mst_sda_ao_pins
[] = { GPIOAO_5
};
405 static const unsigned int pwm_f_ao_pins
[] = { GPIO_TEST_N
};
407 static const unsigned int i2s_am_clk_out_ao_pins
[] = { GPIOAO_8
};
408 static const unsigned int i2s_ao_clk_out_ao_pins
[] = { GPIOAO_9
};
409 static const unsigned int i2s_lr_clk_out_ao_pins
[] = { GPIOAO_10
};
410 static const unsigned int i2s_out_ch01_ao_pins
[] = { GPIOAO_11
};
412 static const unsigned int hdmi_cec_ao_pins
[] = { GPIOAO_12
};
414 static struct meson_pmx_group meson8_cbus_groups
[] = {
425 GPIO_GROUP(GPIOX_10
),
426 GPIO_GROUP(GPIOX_11
),
427 GPIO_GROUP(GPIOX_12
),
428 GPIO_GROUP(GPIOX_13
),
429 GPIO_GROUP(GPIOX_14
),
430 GPIO_GROUP(GPIOX_15
),
431 GPIO_GROUP(GPIOX_16
),
432 GPIO_GROUP(GPIOX_17
),
433 GPIO_GROUP(GPIOX_18
),
434 GPIO_GROUP(GPIOX_19
),
435 GPIO_GROUP(GPIOX_20
),
436 GPIO_GROUP(GPIOX_21
),
447 GPIO_GROUP(GPIOY_10
),
448 GPIO_GROUP(GPIOY_11
),
449 GPIO_GROUP(GPIOY_12
),
450 GPIO_GROUP(GPIOY_13
),
451 GPIO_GROUP(GPIOY_14
),
452 GPIO_GROUP(GPIOY_15
),
453 GPIO_GROUP(GPIOY_16
),
454 GPIO_GROUP(GPIODV_0
),
455 GPIO_GROUP(GPIODV_1
),
456 GPIO_GROUP(GPIODV_2
),
457 GPIO_GROUP(GPIODV_3
),
458 GPIO_GROUP(GPIODV_4
),
459 GPIO_GROUP(GPIODV_5
),
460 GPIO_GROUP(GPIODV_6
),
461 GPIO_GROUP(GPIODV_7
),
462 GPIO_GROUP(GPIODV_8
),
463 GPIO_GROUP(GPIODV_9
),
464 GPIO_GROUP(GPIODV_10
),
465 GPIO_GROUP(GPIODV_11
),
466 GPIO_GROUP(GPIODV_12
),
467 GPIO_GROUP(GPIODV_13
),
468 GPIO_GROUP(GPIODV_14
),
469 GPIO_GROUP(GPIODV_15
),
470 GPIO_GROUP(GPIODV_16
),
471 GPIO_GROUP(GPIODV_17
),
472 GPIO_GROUP(GPIODV_18
),
473 GPIO_GROUP(GPIODV_19
),
474 GPIO_GROUP(GPIODV_20
),
475 GPIO_GROUP(GPIODV_21
),
476 GPIO_GROUP(GPIODV_22
),
477 GPIO_GROUP(GPIODV_23
),
478 GPIO_GROUP(GPIODV_24
),
479 GPIO_GROUP(GPIODV_25
),
480 GPIO_GROUP(GPIODV_26
),
481 GPIO_GROUP(GPIODV_27
),
482 GPIO_GROUP(GPIODV_28
),
483 GPIO_GROUP(GPIODV_29
),
504 GPIO_GROUP(GPIOZ_10
),
505 GPIO_GROUP(GPIOZ_11
),
506 GPIO_GROUP(GPIOZ_12
),
507 GPIO_GROUP(GPIOZ_13
),
508 GPIO_GROUP(GPIOZ_14
),
537 GROUP(sd_d0_a
, 8, 5),
538 GROUP(sd_d1_a
, 8, 4),
539 GROUP(sd_d2_a
, 8, 3),
540 GROUP(sd_d3_a
, 8, 2),
541 GROUP(sd_clk_a
, 8, 1),
542 GROUP(sd_cmd_a
, 8, 0),
544 GROUP(sdxc_d0_a
, 5, 14),
545 GROUP(sdxc_d13_a
, 5, 13),
546 GROUP(sdxc_d47_a
, 5, 12),
547 GROUP(sdxc_clk_a
, 5, 11),
548 GROUP(sdxc_cmd_a
, 5, 10),
550 GROUP(pcm_out_a
, 3, 30),
551 GROUP(pcm_in_a
, 3, 29),
552 GROUP(pcm_fs_a
, 3, 28),
553 GROUP(pcm_clk_a
, 3, 27),
555 GROUP(uart_tx_a0
, 4, 17),
556 GROUP(uart_rx_a0
, 4, 16),
557 GROUP(uart_cts_a0
, 4, 15),
558 GROUP(uart_rts_a0
, 4, 14),
560 GROUP(uart_tx_a1
, 4, 13),
561 GROUP(uart_rx_a1
, 4, 12),
562 GROUP(uart_cts_a1
, 4, 11),
563 GROUP(uart_rts_a1
, 4, 10),
565 GROUP(uart_tx_b0
, 4, 9),
566 GROUP(uart_rx_b0
, 4, 8),
567 GROUP(uart_cts_b0
, 4, 7),
568 GROUP(uart_rts_b0
, 4, 6),
570 GROUP(iso7816_det
, 4, 21),
571 GROUP(iso7816_reset
, 4, 20),
572 GROUP(iso7816_clk
, 4, 19),
573 GROUP(iso7816_data
, 4, 18),
575 GROUP(i2c_sda_d0
, 4, 5),
576 GROUP(i2c_sck_d0
, 4, 4),
578 GROUP(xtal_32k_out
, 3, 22),
579 GROUP(xtal_24m_out
, 3, 23),
582 GROUP(pwm_b_x
, 2, 3),
585 GROUP(uart_tx_c
, 1, 19),
586 GROUP(uart_rx_c
, 1, 18),
587 GROUP(uart_cts_c
, 1, 17),
588 GROUP(uart_rts_c
, 1, 16),
590 GROUP(pcm_out_b
, 4, 25),
591 GROUP(pcm_in_b
, 4, 24),
592 GROUP(pcm_fs_b
, 4, 23),
593 GROUP(pcm_clk_b
, 4, 22),
595 GROUP(i2c_sda_c0
, 1, 15),
596 GROUP(i2c_sck_c0
, 1, 14),
598 GROUP(pwm_a_y
, 9, 14),
600 GROUP(i2s_out_ch45
, 1, 10),
601 GROUP(i2s_out_ch23
, 1, 19),
602 GROUP(i2s_out_ch01
, 1, 6),
603 GROUP(i2s_in_ch01
, 1, 5),
604 GROUP(i2s_lr_clk_in
, 1, 4),
605 GROUP(i2s_ao_clk_in
, 1, 2),
606 GROUP(i2s_am_clk
, 1, 0),
607 GROUP(i2s_out_ch78
, 1, 11),
609 GROUP(spdif_in
, 1, 8),
610 GROUP(spdif_out
, 1, 7),
613 GROUP(dvin_rgb
, 0, 6),
614 GROUP(dvin_vs
, 0, 9),
615 GROUP(dvin_hs
, 0, 8),
616 GROUP(dvin_clk
, 0, 7),
617 GROUP(dvin_de
, 0, 10),
629 GROUP(enc_10
, 7, 10),
630 GROUP(enc_11
, 7, 11),
631 GROUP(enc_12
, 7, 12),
632 GROUP(enc_13
, 7, 13),
633 GROUP(enc_14
, 7, 14),
634 GROUP(enc_15
, 7, 15),
635 GROUP(enc_16
, 7, 16),
636 GROUP(enc_17
, 7, 17),
638 GROUP(uart_tx_b1
, 6, 23),
639 GROUP(uart_rx_b1
, 6, 22),
640 GROUP(uart_cts_b1
, 6, 21),
641 GROUP(uart_rts_b1
, 6, 20),
643 GROUP(vga_vs
, 0, 21),
644 GROUP(vga_hs
, 0, 20),
646 GROUP(pwm_c_dv9
, 3, 24),
647 GROUP(pwm_c_dv29
, 3, 25),
651 GROUP(hdmi_hpd
, 1, 26),
652 GROUP(hdmi_sda
, 1, 25),
653 GROUP(hdmi_scl
, 1, 24),
654 GROUP(hdmi_cec
, 1, 23),
656 GROUP(spi_ss0_0
, 9, 13),
657 GROUP(spi_miso_0
, 9, 12),
658 GROUP(spi_mosi_0
, 9, 11),
659 GROUP(spi_sclk_0
, 9, 10),
661 GROUP(i2c_sda_d1
, 4, 3),
662 GROUP(i2c_sck_d1
, 4, 2),
665 GROUP(spi_ss0_1
, 8, 16),
666 GROUP(spi_ss1_1
, 8, 12),
667 GROUP(spi_sclk_1
, 8, 15),
668 GROUP(spi_mosi_1
, 8, 14),
669 GROUP(spi_miso_1
, 8, 13),
670 GROUP(spi_ss2_1
, 8, 17),
672 GROUP(eth_tx_clk_50m
, 6, 15),
673 GROUP(eth_tx_en
, 6, 14),
674 GROUP(eth_txd1
, 6, 13),
675 GROUP(eth_txd0
, 6, 12),
676 GROUP(eth_rx_clk_in
, 6, 10),
677 GROUP(eth_rx_dv
, 6, 11),
678 GROUP(eth_rxd1
, 6, 8),
679 GROUP(eth_rxd0
, 6, 7),
680 GROUP(eth_mdio
, 6, 6),
681 GROUP(eth_mdc
, 6, 5),
683 /* NOTE: the following four groups are only available on Meson8m2: */
684 GROUP(eth_rxd2
, 6, 3),
685 GROUP(eth_rxd3
, 6, 2),
686 GROUP(eth_txd2
, 6, 1),
687 GROUP(eth_txd3
, 6, 0),
689 GROUP(i2c_sda_a0
, 5, 31),
690 GROUP(i2c_sck_a0
, 5, 30),
692 GROUP(i2c_sda_b
, 5, 27),
693 GROUP(i2c_sck_b
, 5, 26),
695 GROUP(i2c_sda_c1
, 5, 25),
696 GROUP(i2c_sck_c1
, 5, 24),
698 GROUP(i2c_sda_a1
, 5, 9),
699 GROUP(i2c_sck_a1
, 5, 8),
701 GROUP(i2c_sda_a2
, 5, 7),
702 GROUP(i2c_sck_a2
, 5, 6),
704 GROUP(pwm_a_z0
, 9, 16),
705 GROUP(pwm_a_z7
, 2, 0),
706 GROUP(pwm_b_z
, 9, 15),
707 GROUP(pwm_c_z
, 2, 1),
710 GROUP(sd_d0_c
, 6, 29),
711 GROUP(sd_d1_c
, 6, 28),
712 GROUP(sd_d2_c
, 6, 27),
713 GROUP(sd_d3_c
, 6, 26),
714 GROUP(sd_cmd_c
, 6, 25),
715 GROUP(sd_clk_c
, 6, 24),
717 GROUP(sdxc_d0_c
, 4, 30),
718 GROUP(sdxc_d13_c
, 4, 29),
719 GROUP(sdxc_d47_c
, 4, 28),
720 GROUP(sdxc_cmd_c
, 4, 27),
721 GROUP(sdxc_clk_c
, 4, 26),
723 GROUP(nand_io
, 2, 26),
724 GROUP(nand_io_ce0
, 2, 25),
725 GROUP(nand_io_ce1
, 2, 24),
726 GROUP(nand_io_rb0
, 2, 17),
727 GROUP(nand_ale
, 2, 21),
728 GROUP(nand_cle
, 2, 20),
729 GROUP(nand_wen_clk
, 2, 19),
730 GROUP(nand_ren_clk
, 2, 18),
731 GROUP(nand_dqs
, 2, 27),
732 GROUP(nand_ce2
, 2, 23),
733 GROUP(nand_ce3
, 2, 22),
741 GROUP(sd_d1_b
, 2, 14),
742 GROUP(sd_d0_b
, 2, 15),
743 GROUP(sd_clk_b
, 2, 11),
744 GROUP(sd_cmd_b
, 2, 10),
745 GROUP(sd_d3_b
, 2, 12),
746 GROUP(sd_d2_b
, 2, 13),
748 GROUP(sdxc_d13_b
, 2, 6),
749 GROUP(sdxc_d0_b
, 2, 7),
750 GROUP(sdxc_clk_b
, 2, 5),
751 GROUP(sdxc_cmd_b
, 2, 4),
754 static struct meson_pmx_group meson8_aobus_groups
[] = {
755 GPIO_GROUP(GPIOAO_0
),
756 GPIO_GROUP(GPIOAO_1
),
757 GPIO_GROUP(GPIOAO_2
),
758 GPIO_GROUP(GPIOAO_3
),
759 GPIO_GROUP(GPIOAO_4
),
760 GPIO_GROUP(GPIOAO_5
),
761 GPIO_GROUP(GPIOAO_6
),
762 GPIO_GROUP(GPIOAO_7
),
763 GPIO_GROUP(GPIOAO_8
),
764 GPIO_GROUP(GPIOAO_9
),
765 GPIO_GROUP(GPIOAO_10
),
766 GPIO_GROUP(GPIOAO_11
),
767 GPIO_GROUP(GPIOAO_12
),
768 GPIO_GROUP(GPIOAO_13
),
769 GPIO_GROUP(GPIO_BSD_EN
),
770 GPIO_GROUP(GPIO_TEST_N
),
773 GROUP(uart_tx_ao_a
, 0, 12),
774 GROUP(uart_rx_ao_a
, 0, 11),
775 GROUP(uart_cts_ao_a
, 0, 10),
776 GROUP(uart_rts_ao_a
, 0, 9),
778 GROUP(remote_input
, 0, 0),
779 GROUP(remote_output_ao
, 0, 31),
781 GROUP(i2c_slave_sck_ao
, 0, 2),
782 GROUP(i2c_slave_sda_ao
, 0, 1),
784 GROUP(uart_tx_ao_b0
, 0, 26),
785 GROUP(uart_rx_ao_b0
, 0, 25),
787 GROUP(uart_tx_ao_b1
, 0, 24),
788 GROUP(uart_rx_ao_b1
, 0, 23),
790 GROUP(i2c_mst_sck_ao
, 0, 6),
791 GROUP(i2c_mst_sda_ao
, 0, 5),
793 GROUP(pwm_f_ao
, 0, 19),
795 GROUP(i2s_am_clk_out_ao
, 0, 30),
796 GROUP(i2s_ao_clk_out_ao
, 0, 29),
797 GROUP(i2s_lr_clk_out_ao
, 0, 28),
798 GROUP(i2s_out_ch01_ao
, 0, 27),
800 GROUP(hdmi_cec_ao
, 0, 17),
803 static const char * const gpio_periphs_groups
[] = {
804 "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4",
805 "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9",
806 "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14",
807 "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18", "GPIOX_19",
808 "GPIOX_20", "GPIOX_21",
810 "GPIOY_0", "GPIOY_1", "GPIOY_2", "GPIOY_3", "GPIOY_4",
811 "GPIOY_5", "GPIOY_6", "GPIOY_7", "GPIOY_8", "GPIOY_9",
812 "GPIOY_10", "GPIOY_11", "GPIOY_12", "GPIOY_13", "GPIOY_14",
813 "GPIOY_15", "GPIOY_16",
815 "GPIODV_0", "GPIODV_1", "GPIODV_2", "GPIODV_3", "GPIODV_4",
816 "GPIODV_5", "GPIODV_6", "GPIODV_7", "GPIODV_8", "GPIODV_9",
817 "GPIODV_10", "GPIODV_11", "GPIODV_12", "GPIODV_13", "GPIODV_14",
818 "GPIODV_15", "GPIODV_16", "GPIODV_17", "GPIODV_18", "GPIODV_19",
819 "GPIODV_20", "GPIODV_21", "GPIODV_22", "GPIODV_23", "GPIODV_24",
820 "GPIODV_25", "GPIODV_26", "GPIODV_27", "GPIODV_28", "GPIODV_29",
822 "GPIOH_0", "GPIOH_1", "GPIOH_2", "GPIOH_3", "GPIOH_4",
823 "GPIOH_5", "GPIOH_6", "GPIOH_7", "GPIOH_8", "GPIOH_9",
825 "GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4",
826 "GPIOZ_5", "GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9",
827 "GPIOZ_10", "GPIOZ_11", "GPIOZ_12", "GPIOZ_13", "GPIOZ_14",
829 "CARD_0", "CARD_1", "CARD_2", "CARD_3", "CARD_4",
832 "BOOT_0", "BOOT_1", "BOOT_2", "BOOT_3", "BOOT_4",
833 "BOOT_5", "BOOT_6", "BOOT_7", "BOOT_8", "BOOT_9",
834 "BOOT_10", "BOOT_11", "BOOT_12", "BOOT_13", "BOOT_14",
835 "BOOT_15", "BOOT_16", "BOOT_17", "BOOT_18",
838 static const char * const gpio_aobus_groups
[] = {
839 "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3",
840 "GPIOAO_4", "GPIOAO_5", "GPIOAO_6", "GPIOAO_7",
841 "GPIOAO_8", "GPIOAO_9", "GPIOAO_10", "GPIOAO_11",
842 "GPIOAO_12", "GPIOAO_13", "GPIO_BSD_EN", "GPIO_TEST_N"
845 static const char * const sd_a_groups
[] = {
846 "sd_d0_a", "sd_d1_a", "sd_d2_a", "sd_d3_a", "sd_clk_a", "sd_cmd_a"
849 static const char * const sdxc_a_groups
[] = {
850 "sdxc_d0_a", "sdxc_d13_a", "sdxc_d47_a", "sdxc_clk_a", "sdxc_cmd_a"
853 static const char * const pcm_a_groups
[] = {
854 "pcm_out_a", "pcm_in_a", "pcm_fs_a", "pcm_clk_a"
857 static const char * const uart_a_groups
[] = {
858 "uart_tx_a0", "uart_rx_a0", "uart_cts_a0", "uart_rts_a0",
859 "uart_tx_a1", "uart_rx_a1", "uart_cts_a1", "uart_rts_a1"
862 static const char * const uart_b_groups
[] = {
863 "uart_tx_b0", "uart_rx_b0", "uart_cts_b0", "uart_rts_b0",
864 "uart_tx_b1", "uart_rx_b1", "uart_cts_b1", "uart_rts_b1"
867 static const char * const iso7816_groups
[] = {
868 "iso7816_det", "iso7816_reset", "iso7816_clk", "iso7816_data"
871 static const char * const i2c_d_groups
[] = {
872 "i2c_sda_d0", "i2c_sck_d0", "i2c_sda_d1", "i2c_sck_d1"
875 static const char * const xtal_groups
[] = {
876 "xtal_32k_out", "xtal_24m_out"
879 static const char * const uart_c_groups
[] = {
880 "uart_tx_c", "uart_rx_c", "uart_cts_c", "uart_rts_c"
883 static const char * const pcm_b_groups
[] = {
884 "pcm_out_b", "pcm_in_b", "pcm_fs_b", "pcm_clk_b"
887 static const char * const i2c_c_groups
[] = {
888 "i2c_sda_c0", "i2c_sck_c0", "i2c_sda_c1", "i2c_sck_c1"
891 static const char * const dvin_groups
[] = {
892 "dvin_rgb", "dvin_vs", "dvin_hs", "dvin_clk", "dvin_de"
895 static const char * const enc_groups
[] = {
896 "enc_0", "enc_1", "enc_2", "enc_3", "enc_4", "enc_5",
897 "enc_6", "enc_7", "enc_8", "enc_9", "enc_10", "enc_11",
898 "enc_12", "enc_13", "enc_14", "enc_15", "enc_16", "enc_17"
901 static const char * const vga_groups
[] = {
905 static const char * const hdmi_groups
[] = {
906 "hdmi_hpd", "hdmi_sda", "hdmi_scl", "hdmi_cec"
909 static const char * const spi_groups
[] = {
910 "spi_ss0_0", "spi_miso_0", "spi_mosi_0", "spi_sclk_0",
911 "spi_ss0_1", "spi_ss1_1", "spi_sclk_1", "spi_mosi_1",
912 "spi_miso_1", "spi_ss2_1"
915 static const char * const ethernet_groups
[] = {
916 "eth_tx_clk_50m", "eth_tx_en", "eth_txd1",
917 "eth_txd0", "eth_rx_clk_in", "eth_rx_dv",
918 "eth_rxd1", "eth_rxd0", "eth_mdio", "eth_mdc", "eth_rxd2",
919 "eth_rxd3", "eth_txd2", "eth_txd3"
922 static const char * const i2c_a_groups
[] = {
923 "i2c_sda_a0", "i2c_sck_a0", "i2c_sda_a1", "i2c_sck_a1",
924 "i2c_sda_a2", "i2c_sck_a2"
927 static const char * const i2c_b_groups
[] = {
928 "i2c_sda_b", "i2c_sck_b"
931 static const char * const i2s_groups
[] = {
932 "i2s_out_ch45", "i2s_out_ch23_pins", "i2s_out_ch01_pins",
933 "i2s_in_ch01_pins", "i2s_lr_clk_in_pins", "i2s_ao_clk_in_pins",
934 "i2s_am_clk_pins", "i2s_out_ch78_pins"
937 static const char * const sd_c_groups
[] = {
938 "sd_d0_c", "sd_d1_c", "sd_d2_c", "sd_d3_c",
939 "sd_cmd_c", "sd_clk_c"
942 static const char * const sdxc_c_groups
[] = {
943 "sdxc_d0_c", "sdxc_d13_c", "sdxc_d47_c", "sdxc_cmd_c",
947 static const char * const nand_groups
[] = {
948 "nand_io", "nand_io_ce0", "nand_io_ce1",
949 "nand_io_rb0", "nand_ale", "nand_cle",
950 "nand_wen_clk", "nand_ren_clk", "nand_dqs",
951 "nand_ce2", "nand_ce3"
954 static const char * const nor_groups
[] = {
955 "nor_d", "nor_q", "nor_c", "nor_cs"
958 static const char * const pwm_a_groups
[] = {
959 "pwm_a_y", "pwm_a_z0", "pwm_a_z7"
962 static const char * const pwm_b_groups
[] = {
966 static const char * const pwm_c_groups
[] = {
967 "pwm_c_dv9", "pwm_c_dv29", "pwm_c_z"
970 static const char * const pwm_d_groups
[] = {
974 static const char * const pwm_e_groups
[] = {
978 static const char * const sd_b_groups
[] = {
979 "sd_d1_b", "sd_d0_b", "sd_clk_b", "sd_cmd_b",
983 static const char * const sdxc_b_groups
[] = {
984 "sdxc_d13_b", "sdxc_d0_b", "sdxc_clk_b", "sdxc_cmd_b"
987 static const char * const spdif_groups
[] = {
988 "spdif_in", "spdif_out"
991 static const char * const uart_ao_groups
[] = {
992 "uart_tx_ao_a", "uart_rx_ao_a", "uart_cts_ao_a", "uart_rts_ao_a"
995 static const char * const remote_groups
[] = {
996 "remote_input", "remote_output_ao"
999 static const char * const i2c_slave_ao_groups
[] = {
1000 "i2c_slave_sck_ao", "i2c_slave_sda_ao"
1003 static const char * const uart_ao_b_groups
[] = {
1004 "uart_tx_ao_b0", "uart_rx_ao_b0", "uart_tx_ao_b1", "uart_rx_ao_b1"
1007 static const char * const i2c_mst_ao_groups
[] = {
1008 "i2c_mst_sck_ao", "i2c_mst_sda_ao"
1011 static const char * const pwm_f_ao_groups
[] = {
1015 static const char * const i2s_ao_groups
[] = {
1016 "i2s_am_clk_out_ao", "i2s_ao_clk_out_ao", "i2s_lr_clk_out_ao",
1020 static const char * const hdmi_cec_ao_groups
[] = {
1024 static struct meson_pmx_func meson8_cbus_functions
[] = {
1025 FUNCTION(gpio_periphs
),
1060 static struct meson_pmx_func meson8_aobus_functions
[] = {
1061 FUNCTION(gpio_aobus
),
1064 FUNCTION(i2c_slave_ao
),
1065 FUNCTION(uart_ao_b
),
1066 FUNCTION(i2c_mst_ao
),
1069 FUNCTION(hdmi_cec_ao
),
1072 static struct meson_bank meson8_cbus_banks
[] = {
1073 /* name first last irq pullen pull dir out in */
1074 BANK("X", GPIOX_0
, GPIOX_21
, 112, 133, 4, 0, 4, 0, 0, 0, 1, 0, 2, 0),
1075 BANK("Y", GPIOY_0
, GPIOY_16
, 95, 111, 3, 0, 3, 0, 3, 0, 4, 0, 5, 0),
1076 BANK("DV", GPIODV_0
, GPIODV_29
, 65, 94, 0, 0, 0, 0, 7, 0, 8, 0, 9, 0),
1077 BANK("H", GPIOH_0
, GPIOH_9
, 29, 38, 1, 16, 1, 16, 9, 19, 10, 19, 11, 19),
1078 BANK("Z", GPIOZ_0
, GPIOZ_14
, 14, 28, 1, 0, 1, 0, 3, 17, 4, 17, 5, 17),
1079 BANK("CARD", CARD_0
, CARD_6
, 58, 64, 2, 20, 2, 20, 0, 22, 1, 22, 2, 22),
1080 BANK("BOOT", BOOT_0
, BOOT_18
, 39, 57, 2, 0, 2, 0, 9, 0, 10, 0, 11, 0),
1083 static struct meson_bank meson8_aobus_banks
[] = {
1084 /* name first last irq pullen pull dir out in */
1085 BANK("AO", GPIOAO_0
, GPIO_TEST_N
, 0, 13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
1088 static struct meson_pinctrl_data meson8_cbus_pinctrl_data
= {
1089 .name
= "cbus-banks",
1090 .pins
= meson8_cbus_pins
,
1091 .groups
= meson8_cbus_groups
,
1092 .funcs
= meson8_cbus_functions
,
1093 .banks
= meson8_cbus_banks
,
1094 .num_pins
= ARRAY_SIZE(meson8_cbus_pins
),
1095 .num_groups
= ARRAY_SIZE(meson8_cbus_groups
),
1096 .num_funcs
= ARRAY_SIZE(meson8_cbus_functions
),
1097 .num_banks
= ARRAY_SIZE(meson8_cbus_banks
),
1098 .pmx_ops
= &meson8_pmx_ops
,
1101 static struct meson_pinctrl_data meson8_aobus_pinctrl_data
= {
1103 .pins
= meson8_aobus_pins
,
1104 .groups
= meson8_aobus_groups
,
1105 .funcs
= meson8_aobus_functions
,
1106 .banks
= meson8_aobus_banks
,
1107 .num_pins
= ARRAY_SIZE(meson8_aobus_pins
),
1108 .num_groups
= ARRAY_SIZE(meson8_aobus_groups
),
1109 .num_funcs
= ARRAY_SIZE(meson8_aobus_functions
),
1110 .num_banks
= ARRAY_SIZE(meson8_aobus_banks
),
1111 .pmx_ops
= &meson8_pmx_ops
,
1114 static const struct of_device_id meson8_pinctrl_dt_match
[] = {
1116 .compatible
= "amlogic,meson8-cbus-pinctrl",
1117 .data
= &meson8_cbus_pinctrl_data
,
1120 .compatible
= "amlogic,meson8-aobus-pinctrl",
1121 .data
= &meson8_aobus_pinctrl_data
,
1124 .compatible
= "amlogic,meson8m2-cbus-pinctrl",
1125 .data
= &meson8_cbus_pinctrl_data
,
1128 .compatible
= "amlogic,meson8m2-aobus-pinctrl",
1129 .data
= &meson8_aobus_pinctrl_data
,
1134 static struct platform_driver meson8_pinctrl_driver
= {
1135 .probe
= meson_pinctrl_probe
,
1137 .name
= "meson8-pinctrl",
1138 .of_match_table
= meson8_pinctrl_dt_match
,
1141 builtin_platform_driver(meson8_pinctrl_driver
);