blob: c6d79315218fa69cadcdde9aa49d657d6916f5bb [file] [log] [blame]
Beniamino Galvani6ac73092015-01-17 19:15:14 +01001/*
Martin Blumenstinglb0d46cb2018-04-22 12:53:29 +02002 * Pin controller and GPIO driver for Amlogic Meson8 and Meson8m2.
Beniamino Galvani6ac73092015-01-17 19:15:14 +01003 *
4 * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
5 *
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.
9 *
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/>.
12 */
13
14#include <dt-bindings/gpio/meson8-gpio.h>
15#include "pinctrl-meson.h"
Jerome Brunetce385aa2017-10-12 14:40:26 +020016#include "pinctrl-meson8-pmx.h"
Beniamino Galvani6ac73092015-01-17 19:15:14 +010017
Carlo Caione9dab1862016-03-01 23:04:34 +010018static const struct pinctrl_pin_desc meson8_cbus_pins[] = {
Jerome Brunet634e40b2017-09-20 15:39:20 +020019 MESON_PIN(GPIOX_0),
20 MESON_PIN(GPIOX_1),
21 MESON_PIN(GPIOX_2),
22 MESON_PIN(GPIOX_3),
23 MESON_PIN(GPIOX_4),
24 MESON_PIN(GPIOX_5),
25 MESON_PIN(GPIOX_6),
26 MESON_PIN(GPIOX_7),
27 MESON_PIN(GPIOX_8),
28 MESON_PIN(GPIOX_9),
29 MESON_PIN(GPIOX_10),
30 MESON_PIN(GPIOX_11),
31 MESON_PIN(GPIOX_12),
32 MESON_PIN(GPIOX_13),
33 MESON_PIN(GPIOX_14),
34 MESON_PIN(GPIOX_15),
35 MESON_PIN(GPIOX_16),
36 MESON_PIN(GPIOX_17),
37 MESON_PIN(GPIOX_18),
38 MESON_PIN(GPIOX_19),
39 MESON_PIN(GPIOX_20),
40 MESON_PIN(GPIOX_21),
41 MESON_PIN(GPIOY_0),
42 MESON_PIN(GPIOY_1),
43 MESON_PIN(GPIOY_2),
44 MESON_PIN(GPIOY_3),
45 MESON_PIN(GPIOY_4),
46 MESON_PIN(GPIOY_5),
47 MESON_PIN(GPIOY_6),
48 MESON_PIN(GPIOY_7),
49 MESON_PIN(GPIOY_8),
50 MESON_PIN(GPIOY_9),
51 MESON_PIN(GPIOY_10),
52 MESON_PIN(GPIOY_11),
53 MESON_PIN(GPIOY_12),
54 MESON_PIN(GPIOY_13),
55 MESON_PIN(GPIOY_14),
56 MESON_PIN(GPIOY_15),
57 MESON_PIN(GPIOY_16),
58 MESON_PIN(GPIODV_0),
59 MESON_PIN(GPIODV_1),
60 MESON_PIN(GPIODV_2),
61 MESON_PIN(GPIODV_3),
62 MESON_PIN(GPIODV_4),
63 MESON_PIN(GPIODV_5),
64 MESON_PIN(GPIODV_6),
65 MESON_PIN(GPIODV_7),
66 MESON_PIN(GPIODV_8),
67 MESON_PIN(GPIODV_9),
68 MESON_PIN(GPIODV_10),
69 MESON_PIN(GPIODV_11),
70 MESON_PIN(GPIODV_12),
71 MESON_PIN(GPIODV_13),
72 MESON_PIN(GPIODV_14),
73 MESON_PIN(GPIODV_15),
74 MESON_PIN(GPIODV_16),
75 MESON_PIN(GPIODV_17),
76 MESON_PIN(GPIODV_18),
77 MESON_PIN(GPIODV_19),
78 MESON_PIN(GPIODV_20),
79 MESON_PIN(GPIODV_21),
80 MESON_PIN(GPIODV_22),
81 MESON_PIN(GPIODV_23),
82 MESON_PIN(GPIODV_24),
83 MESON_PIN(GPIODV_25),
84 MESON_PIN(GPIODV_26),
85 MESON_PIN(GPIODV_27),
86 MESON_PIN(GPIODV_28),
87 MESON_PIN(GPIODV_29),
88 MESON_PIN(GPIOH_0),
89 MESON_PIN(GPIOH_1),
90 MESON_PIN(GPIOH_2),
91 MESON_PIN(GPIOH_3),
92 MESON_PIN(GPIOH_4),
93 MESON_PIN(GPIOH_5),
94 MESON_PIN(GPIOH_6),
95 MESON_PIN(GPIOH_7),
96 MESON_PIN(GPIOH_8),
97 MESON_PIN(GPIOH_9),
98 MESON_PIN(GPIOZ_0),
99 MESON_PIN(GPIOZ_1),
100 MESON_PIN(GPIOZ_2),
101 MESON_PIN(GPIOZ_3),
102 MESON_PIN(GPIOZ_4),
103 MESON_PIN(GPIOZ_5),
104 MESON_PIN(GPIOZ_6),
105 MESON_PIN(GPIOZ_7),
106 MESON_PIN(GPIOZ_8),
107 MESON_PIN(GPIOZ_9),
108 MESON_PIN(GPIOZ_10),
109 MESON_PIN(GPIOZ_11),
110 MESON_PIN(GPIOZ_12),
111 MESON_PIN(GPIOZ_13),
112 MESON_PIN(GPIOZ_14),
113 MESON_PIN(CARD_0),
114 MESON_PIN(CARD_1),
115 MESON_PIN(CARD_2),
116 MESON_PIN(CARD_3),
117 MESON_PIN(CARD_4),
118 MESON_PIN(CARD_5),
119 MESON_PIN(CARD_6),
120 MESON_PIN(BOOT_0),
121 MESON_PIN(BOOT_1),
122 MESON_PIN(BOOT_2),
123 MESON_PIN(BOOT_3),
124 MESON_PIN(BOOT_4),
125 MESON_PIN(BOOT_5),
126 MESON_PIN(BOOT_6),
127 MESON_PIN(BOOT_7),
128 MESON_PIN(BOOT_8),
129 MESON_PIN(BOOT_9),
130 MESON_PIN(BOOT_10),
131 MESON_PIN(BOOT_11),
132 MESON_PIN(BOOT_12),
133 MESON_PIN(BOOT_13),
134 MESON_PIN(BOOT_14),
135 MESON_PIN(BOOT_15),
136 MESON_PIN(BOOT_16),
137 MESON_PIN(BOOT_17),
138 MESON_PIN(BOOT_18),
Carlo Caione9dab1862016-03-01 23:04:34 +0100139};
140
141static const struct pinctrl_pin_desc meson8_aobus_pins[] = {
Jerome Brunet634e40b2017-09-20 15:39:20 +0200142 MESON_PIN(GPIOAO_0),
143 MESON_PIN(GPIOAO_1),
144 MESON_PIN(GPIOAO_2),
145 MESON_PIN(GPIOAO_3),
146 MESON_PIN(GPIOAO_4),
147 MESON_PIN(GPIOAO_5),
148 MESON_PIN(GPIOAO_6),
149 MESON_PIN(GPIOAO_7),
150 MESON_PIN(GPIOAO_8),
151 MESON_PIN(GPIOAO_9),
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),
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100158};
159
160/* bank X */
Jerome Brunet634e40b2017-09-20 15:39:20 +0200161static const unsigned int sd_d0_a_pins[] = { GPIOX_0 };
162static const unsigned int sd_d1_a_pins[] = { GPIOX_1 };
163static const unsigned int sd_d2_a_pins[] = { GPIOX_2 };
164static const unsigned int sd_d3_a_pins[] = { GPIOX_3 };
165static const unsigned int sd_clk_a_pins[] = { GPIOX_8 };
166static const unsigned int sd_cmd_a_pins[] = { GPIOX_9 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100167
Jerome Brunet634e40b2017-09-20 15:39:20 +0200168static const unsigned int sdxc_d0_a_pins[] = { GPIOX_0 };
169static const unsigned int sdxc_d13_a_pins[] = { GPIOX_1, GPIOX_2, GPIOX_3 };
170static const unsigned int sdxc_d47_a_pins[] = { GPIOX_4, GPIOX_5, GPIOX_6,
171 GPIOX_7 };
172static const unsigned int sdxc_clk_a_pins[] = { GPIOX_8 };
173static const unsigned int sdxc_cmd_a_pins[] = { GPIOX_9 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100174
Jerome Brunet634e40b2017-09-20 15:39:20 +0200175static const unsigned int pcm_out_a_pins[] = { GPIOX_4 };
176static const unsigned int pcm_in_a_pins[] = { GPIOX_5 };
177static const unsigned int pcm_fs_a_pins[] = { GPIOX_6 };
178static const unsigned int pcm_clk_a_pins[] = { GPIOX_7 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100179
Jerome Brunet634e40b2017-09-20 15:39:20 +0200180static const unsigned int uart_tx_a0_pins[] = { GPIOX_4 };
181static const unsigned int uart_rx_a0_pins[] = { GPIOX_5 };
182static const unsigned int uart_cts_a0_pins[] = { GPIOX_6 };
183static const unsigned int uart_rts_a0_pins[] = { GPIOX_7 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100184
Jerome Brunet634e40b2017-09-20 15:39:20 +0200185static const unsigned int uart_tx_a1_pins[] = { GPIOX_12 };
186static const unsigned int uart_rx_a1_pins[] = { GPIOX_13 };
187static const unsigned int uart_cts_a1_pins[] = { GPIOX_14 };
188static const unsigned int uart_rts_a1_pins[] = { GPIOX_15 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100189
Jerome Brunet634e40b2017-09-20 15:39:20 +0200190static const unsigned int uart_tx_b0_pins[] = { GPIOX_16 };
191static const unsigned int uart_rx_b0_pins[] = { GPIOX_17 };
192static const unsigned int uart_cts_b0_pins[] = { GPIOX_18 };
193static const unsigned int uart_rts_b0_pins[] = { GPIOX_19 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100194
Jerome Brunet634e40b2017-09-20 15:39:20 +0200195static const unsigned int iso7816_det_pins[] = { GPIOX_16 };
196static const unsigned int iso7816_reset_pins[] = { GPIOX_17 };
197static const unsigned int iso7816_clk_pins[] = { GPIOX_18 };
198static const unsigned int iso7816_data_pins[] = { GPIOX_19 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100199
Jerome Brunet634e40b2017-09-20 15:39:20 +0200200static const unsigned int i2c_sda_d0_pins[] = { GPIOX_16 };
201static const unsigned int i2c_sck_d0_pins[] = { GPIOX_17 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100202
Jerome Brunet634e40b2017-09-20 15:39:20 +0200203static const unsigned int xtal_32k_out_pins[] = { GPIOX_10 };
204static const unsigned int xtal_24m_out_pins[] = { GPIOX_11 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100205
Jerome Brunet634e40b2017-09-20 15:39:20 +0200206static const unsigned int pwm_e_pins[] = { GPIOX_10 };
207static const unsigned int pwm_b_x_pins[] = { GPIOX_11 };
Martin Blumenstinglc1f29552017-05-06 18:57:48 +0200208
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100209/* bank Y */
Jerome Brunet634e40b2017-09-20 15:39:20 +0200210static const unsigned int uart_tx_c_pins[] = { GPIOY_0 };
211static const unsigned int uart_rx_c_pins[] = { GPIOY_1 };
212static const unsigned int uart_cts_c_pins[] = { GPIOY_2 };
213static const unsigned int uart_rts_c_pins[] = { GPIOY_3 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100214
Jerome Brunet634e40b2017-09-20 15:39:20 +0200215static const unsigned int pcm_out_b_pins[] = { GPIOY_4 };
216static const unsigned int pcm_in_b_pins[] = { GPIOY_5 };
217static const unsigned int pcm_fs_b_pins[] = { GPIOY_6 };
218static const unsigned int pcm_clk_b_pins[] = { GPIOY_7 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100219
Jerome Brunet634e40b2017-09-20 15:39:20 +0200220static const unsigned int i2c_sda_c0_pins[] = { GPIOY_0 };
221static const unsigned int i2c_sck_c0_pins[] = { GPIOY_1 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100222
Jerome Brunet634e40b2017-09-20 15:39:20 +0200223static const unsigned int pwm_a_y_pins[] = { GPIOY_16 };
Martin Blumenstinglc1f29552017-05-06 18:57:48 +0200224
Jerome Brunet634e40b2017-09-20 15:39:20 +0200225static const unsigned int i2s_out_ch45_pins[] = { GPIOY_0 };
226static const unsigned int i2s_out_ch23_pins[] = { GPIOY_1 };
227static const unsigned int i2s_out_ch01_pins[] = { GPIOY_4 };
228static const unsigned int i2s_in_ch01_pins[] = { GPIOY_5 };
229static const unsigned int i2s_lr_clk_in_pins[] = { GPIOY_6 };
230static const unsigned int i2s_ao_clk_in_pins[] = { GPIOY_7 };
231static const unsigned int i2s_am_clk_pins[] = { GPIOY_8 };
232static const unsigned int i2s_out_ch78_pins[] = { GPIOY_9 };
Martin Blumenstingl64f6d072017-05-06 18:57:49 +0200233
Jerome Brunet634e40b2017-09-20 15:39:20 +0200234static const unsigned int spdif_in_pins[] = { GPIOY_2 };
235static const unsigned int spdif_out_pins[] = { GPIOY_3 };
Martin Blumenstingl64f6d072017-05-06 18:57:49 +0200236
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100237/* bank DV */
Jerome Brunet634e40b2017-09-20 15:39:20 +0200238static 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
243};
244static const unsigned int dvin_vs_pins[] = { GPIODV_24 };
245static const unsigned int dvin_hs_pins[] = { GPIODV_25 };
246static const unsigned int dvin_clk_pins[] = { GPIODV_26 };
247static const unsigned int dvin_de_pins[] = { GPIODV_27 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100248
Jerome Brunet634e40b2017-09-20 15:39:20 +0200249static const unsigned int enc_0_pins[] = { GPIODV_0 };
250static const unsigned int enc_1_pins[] = { GPIODV_1 };
251static const unsigned int enc_2_pins[] = { GPIODV_2 };
252static const unsigned int enc_3_pins[] = { GPIODV_3 };
253static const unsigned int enc_4_pins[] = { GPIODV_4 };
254static const unsigned int enc_5_pins[] = { GPIODV_5 };
255static const unsigned int enc_6_pins[] = { GPIODV_6 };
256static const unsigned int enc_7_pins[] = { GPIODV_7 };
257static const unsigned int enc_8_pins[] = { GPIODV_8 };
258static const unsigned int enc_9_pins[] = { GPIODV_9 };
259static const unsigned int enc_10_pins[] = { GPIODV_10 };
260static const unsigned int enc_11_pins[] = { GPIODV_11 };
261static const unsigned int enc_12_pins[] = { GPIODV_12 };
262static const unsigned int enc_13_pins[] = { GPIODV_13 };
263static const unsigned int enc_14_pins[] = { GPIODV_14 };
264static const unsigned int enc_15_pins[] = { GPIODV_15 };
265static const unsigned int enc_16_pins[] = { GPIODV_16 };
266static const unsigned int enc_17_pins[] = { GPIODV_17 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100267
Jerome Brunet634e40b2017-09-20 15:39:20 +0200268static const unsigned int uart_tx_b1_pins[] = { GPIODV_24 };
269static const unsigned int uart_rx_b1_pins[] = { GPIODV_25 };
270static const unsigned int uart_cts_b1_pins[] = { GPIODV_26 };
271static const unsigned int uart_rts_b1_pins[] = { GPIODV_27 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100272
Jerome Brunet634e40b2017-09-20 15:39:20 +0200273static const unsigned int vga_vs_pins[] = { GPIODV_24 };
274static const unsigned int vga_hs_pins[] = { GPIODV_25 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100275
Jerome Brunet634e40b2017-09-20 15:39:20 +0200276static const unsigned int pwm_c_dv9_pins[] = { GPIODV_9 };
277static const unsigned int pwm_c_dv29_pins[] = { GPIODV_29 };
278static const unsigned int pwm_d_pins[] = { GPIODV_28 };
Martin Blumenstinglc1f29552017-05-06 18:57:48 +0200279
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100280/* bank H */
Jerome Brunet634e40b2017-09-20 15:39:20 +0200281static const unsigned int hdmi_hpd_pins[] = { GPIOH_0 };
282static const unsigned int hdmi_sda_pins[] = { GPIOH_1 };
283static const unsigned int hdmi_scl_pins[] = { GPIOH_2 };
284static const unsigned int hdmi_cec_pins[] = { GPIOH_3 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100285
Jerome Brunet634e40b2017-09-20 15:39:20 +0200286static const unsigned int spi_ss0_0_pins[] = { GPIOH_3 };
287static const unsigned int spi_miso_0_pins[] = { GPIOH_4 };
288static const unsigned int spi_mosi_0_pins[] = { GPIOH_5 };
289static const unsigned int spi_sclk_0_pins[] = { GPIOH_6 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100290
Jerome Brunet634e40b2017-09-20 15:39:20 +0200291static const unsigned int i2c_sda_d1_pins[] = { GPIOH_7 };
292static const unsigned int i2c_sck_d1_pins[] = { GPIOH_8 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100293
294/* bank Z */
Jerome Brunet634e40b2017-09-20 15:39:20 +0200295static const unsigned int spi_ss0_1_pins[] = { GPIOZ_9 };
296static const unsigned int spi_ss1_1_pins[] = { GPIOZ_10 };
297static const unsigned int spi_sclk_1_pins[] = { GPIOZ_11 };
298static const unsigned int spi_mosi_1_pins[] = { GPIOZ_12 };
299static const unsigned int spi_miso_1_pins[] = { GPIOZ_13 };
300static const unsigned int spi_ss2_1_pins[] = { GPIOZ_14 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100301
Martin Blumenstinglbf6f1462018-04-22 12:53:30 +0200302static const unsigned int eth_txd3_pins[] = { GPIOZ_0 };
303static const unsigned int eth_txd2_pins[] = { GPIOZ_1 };
304static const unsigned int eth_rxd3_pins[] = { GPIOZ_2 };
305static const unsigned int eth_rxd2_pins[] = { GPIOZ_3 };
Jerome Brunet634e40b2017-09-20 15:39:20 +0200306static const unsigned int eth_tx_clk_50m_pins[] = { GPIOZ_4 };
307static const unsigned int eth_tx_en_pins[] = { GPIOZ_5 };
308static const unsigned int eth_txd1_pins[] = { GPIOZ_6 };
309static const unsigned int eth_txd0_pins[] = { GPIOZ_7 };
310static const unsigned int eth_rx_clk_in_pins[] = { GPIOZ_8 };
311static const unsigned int eth_rx_dv_pins[] = { GPIOZ_9 };
312static const unsigned int eth_rxd1_pins[] = { GPIOZ_10 };
313static const unsigned int eth_rxd0_pins[] = { GPIOZ_11 };
314static const unsigned int eth_mdio_pins[] = { GPIOZ_12 };
315static const unsigned int eth_mdc_pins[] = { GPIOZ_13 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100316
Jerome Brunet634e40b2017-09-20 15:39:20 +0200317static const unsigned int i2c_sda_a0_pins[] = { GPIOZ_0 };
318static const unsigned int i2c_sck_a0_pins[] = { GPIOZ_1 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100319
Jerome Brunet634e40b2017-09-20 15:39:20 +0200320static const unsigned int i2c_sda_b_pins[] = { GPIOZ_2 };
321static const unsigned int i2c_sck_b_pins[] = { GPIOZ_3 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100322
Jerome Brunet634e40b2017-09-20 15:39:20 +0200323static const unsigned int i2c_sda_c1_pins[] = { GPIOZ_4 };
324static const unsigned int i2c_sck_c1_pins[] = { GPIOZ_5 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100325
Jerome Brunet634e40b2017-09-20 15:39:20 +0200326static const unsigned int i2c_sda_a1_pins[] = { GPIOZ_0 };
327static const unsigned int i2c_sck_a1_pins[] = { GPIOZ_1 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100328
Jerome Brunet634e40b2017-09-20 15:39:20 +0200329static const unsigned int i2c_sda_a2_pins[] = { GPIOZ_0 };
330static const unsigned int i2c_sck_a2_pins[] = { GPIOZ_1 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100331
Jerome Brunet634e40b2017-09-20 15:39:20 +0200332static const unsigned int pwm_a_z0_pins[] = { GPIOZ_0 };
333static const unsigned int pwm_a_z7_pins[] = { GPIOZ_7 };
334static const unsigned int pwm_b_z_pins[] = { GPIOZ_1 };
335static const unsigned int pwm_c_z_pins[] = { GPIOZ_8 };
Martin Blumenstinglc1f29552017-05-06 18:57:48 +0200336
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100337/* bank BOOT */
Jerome Brunet634e40b2017-09-20 15:39:20 +0200338static const unsigned int sd_d0_c_pins[] = { BOOT_0 };
339static const unsigned int sd_d1_c_pins[] = { BOOT_1 };
340static const unsigned int sd_d2_c_pins[] = { BOOT_2 };
341static const unsigned int sd_d3_c_pins[] = { BOOT_3 };
342static const unsigned int sd_cmd_c_pins[] = { BOOT_16 };
343static const unsigned int sd_clk_c_pins[] = { BOOT_17 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100344
Jerome Brunet634e40b2017-09-20 15:39:20 +0200345static const unsigned int sdxc_d0_c_pins[] = { BOOT_0};
346static const unsigned int sdxc_d13_c_pins[] = { BOOT_1, BOOT_2, BOOT_3 };
347static const unsigned int sdxc_d47_c_pins[] = { BOOT_4, BOOT_5, BOOT_6,
348 BOOT_7 };
349static const unsigned int sdxc_cmd_c_pins[] = { BOOT_16 };
350static const unsigned int sdxc_clk_c_pins[] = { BOOT_17 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100351
Jerome Brunet634e40b2017-09-20 15:39:20 +0200352static const unsigned int nand_io_pins[] = {
353 BOOT_0, BOOT_1, BOOT_2, BOOT_3, BOOT_4, BOOT_5, BOOT_6, BOOT_7
354};
355static const unsigned int nand_io_ce0_pins[] = { BOOT_8 };
356static const unsigned int nand_io_ce1_pins[] = { BOOT_9 };
357static const unsigned int nand_io_rb0_pins[] = { BOOT_10 };
358static const unsigned int nand_ale_pins[] = { BOOT_11 };
359static const unsigned int nand_cle_pins[] = { BOOT_12 };
360static const unsigned int nand_wen_clk_pins[] = { BOOT_13 };
361static const unsigned int nand_ren_clk_pins[] = { BOOT_14 };
362static const unsigned int nand_dqs_pins[] = { BOOT_15 };
363static const unsigned int nand_ce2_pins[] = { BOOT_16 };
364static const unsigned int nand_ce3_pins[] = { BOOT_17 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100365
Jerome Brunet634e40b2017-09-20 15:39:20 +0200366static const unsigned int nor_d_pins[] = { BOOT_11 };
367static const unsigned int nor_q_pins[] = { BOOT_12 };
368static const unsigned int nor_c_pins[] = { BOOT_13 };
369static const unsigned int nor_cs_pins[] = { BOOT_18 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100370
371/* bank CARD */
Jerome Brunet634e40b2017-09-20 15:39:20 +0200372static const unsigned int sd_d1_b_pins[] = { CARD_0 };
373static const unsigned int sd_d0_b_pins[] = { CARD_1 };
374static const unsigned int sd_clk_b_pins[] = { CARD_2 };
375static const unsigned int sd_cmd_b_pins[] = { CARD_3 };
376static const unsigned int sd_d3_b_pins[] = { CARD_4 };
377static const unsigned int sd_d2_b_pins[] = { CARD_5 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100378
Jerome Brunet634e40b2017-09-20 15:39:20 +0200379static const unsigned int sdxc_d13_b_pins[] = { CARD_0, CARD_4, CARD_5 };
380static const unsigned int sdxc_d0_b_pins[] = { CARD_1 };
381static const unsigned int sdxc_clk_b_pins[] = { CARD_2 };
382static const unsigned int sdxc_cmd_b_pins[] = { CARD_3 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100383
384/* bank AO */
Jerome Brunet634e40b2017-09-20 15:39:20 +0200385static const unsigned int uart_tx_ao_a_pins[] = { GPIOAO_0 };
386static const unsigned int uart_rx_ao_a_pins[] = { GPIOAO_1 };
387static const unsigned int uart_cts_ao_a_pins[] = { GPIOAO_2 };
388static const unsigned int uart_rts_ao_a_pins[] = { GPIOAO_3 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100389
Jerome Brunet634e40b2017-09-20 15:39:20 +0200390static const unsigned int remote_input_pins[] = { GPIOAO_7 };
391static const unsigned int remote_output_ao_pins[] = { GPIOAO_13 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100392
Jerome Brunet634e40b2017-09-20 15:39:20 +0200393static const unsigned int i2c_slave_sck_ao_pins[] = { GPIOAO_4 };
394static const unsigned int i2c_slave_sda_ao_pins[] = { GPIOAO_5 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100395
Jerome Brunet634e40b2017-09-20 15:39:20 +0200396static const unsigned int uart_tx_ao_b0_pins[] = { GPIOAO_0 };
397static const unsigned int uart_rx_ao_b0_pins[] = { GPIOAO_1 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100398
Jerome Brunet634e40b2017-09-20 15:39:20 +0200399static const unsigned int uart_tx_ao_b1_pins[] = { GPIOAO_4 };
400static const unsigned int uart_rx_ao_b1_pins[] = { GPIOAO_5 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100401
Jerome Brunet634e40b2017-09-20 15:39:20 +0200402static const unsigned int i2c_mst_sck_ao_pins[] = { GPIOAO_4 };
403static const unsigned int i2c_mst_sda_ao_pins[] = { GPIOAO_5 };
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100404
Jerome Brunet634e40b2017-09-20 15:39:20 +0200405static const unsigned int pwm_f_ao_pins[] = { GPIO_TEST_N };
Martin Blumenstinglc1f29552017-05-06 18:57:48 +0200406
Jerome Brunet634e40b2017-09-20 15:39:20 +0200407static const unsigned int i2s_am_clk_out_ao_pins[] = { GPIOAO_8 };
408static const unsigned int i2s_ao_clk_out_ao_pins[] = { GPIOAO_9 };
409static const unsigned int i2s_lr_clk_out_ao_pins[] = { GPIOAO_10 };
410static const unsigned int i2s_out_ch01_ao_pins[] = { GPIOAO_11 };
Martin Blumenstingl64f6d072017-05-06 18:57:49 +0200411
Jerome Brunet634e40b2017-09-20 15:39:20 +0200412static const unsigned int hdmi_cec_ao_pins[] = { GPIOAO_12 };
Martin Blumenstinglc21b4322017-05-06 18:57:51 +0200413
Carlo Caione9dab1862016-03-01 23:04:34 +0100414static struct meson_pmx_group meson8_cbus_groups[] = {
Jerome Brunet634e40b2017-09-20 15:39:20 +0200415 GPIO_GROUP(GPIOX_0),
416 GPIO_GROUP(GPIOX_1),
417 GPIO_GROUP(GPIOX_2),
418 GPIO_GROUP(GPIOX_3),
419 GPIO_GROUP(GPIOX_4),
420 GPIO_GROUP(GPIOX_5),
421 GPIO_GROUP(GPIOX_6),
422 GPIO_GROUP(GPIOX_7),
423 GPIO_GROUP(GPIOX_8),
424 GPIO_GROUP(GPIOX_9),
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),
437 GPIO_GROUP(GPIOY_0),
438 GPIO_GROUP(GPIOY_1),
439 GPIO_GROUP(GPIOY_2),
440 GPIO_GROUP(GPIOY_3),
441 GPIO_GROUP(GPIOY_4),
442 GPIO_GROUP(GPIOY_5),
443 GPIO_GROUP(GPIOY_6),
444 GPIO_GROUP(GPIOY_7),
445 GPIO_GROUP(GPIOY_8),
446 GPIO_GROUP(GPIOY_9),
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),
484 GPIO_GROUP(GPIOH_0),
485 GPIO_GROUP(GPIOH_1),
486 GPIO_GROUP(GPIOH_2),
487 GPIO_GROUP(GPIOH_3),
488 GPIO_GROUP(GPIOH_4),
489 GPIO_GROUP(GPIOH_5),
490 GPIO_GROUP(GPIOH_6),
491 GPIO_GROUP(GPIOH_7),
492 GPIO_GROUP(GPIOH_8),
493 GPIO_GROUP(GPIOH_9),
494 GPIO_GROUP(GPIOZ_0),
495 GPIO_GROUP(GPIOZ_1),
496 GPIO_GROUP(GPIOZ_2),
497 GPIO_GROUP(GPIOZ_3),
498 GPIO_GROUP(GPIOZ_4),
499 GPIO_GROUP(GPIOZ_5),
500 GPIO_GROUP(GPIOZ_6),
501 GPIO_GROUP(GPIOZ_7),
502 GPIO_GROUP(GPIOZ_8),
503 GPIO_GROUP(GPIOZ_9),
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),
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100509
510 /* bank X */
511 GROUP(sd_d0_a, 8, 5),
512 GROUP(sd_d1_a, 8, 4),
513 GROUP(sd_d2_a, 8, 3),
514 GROUP(sd_d3_a, 8, 2),
515 GROUP(sd_clk_a, 8, 1),
516 GROUP(sd_cmd_a, 8, 0),
517
518 GROUP(sdxc_d0_a, 5, 14),
519 GROUP(sdxc_d13_a, 5, 13),
520 GROUP(sdxc_d47_a, 5, 12),
521 GROUP(sdxc_clk_a, 5, 11),
522 GROUP(sdxc_cmd_a, 5, 10),
523
524 GROUP(pcm_out_a, 3, 30),
525 GROUP(pcm_in_a, 3, 29),
526 GROUP(pcm_fs_a, 3, 28),
527 GROUP(pcm_clk_a, 3, 27),
528
529 GROUP(uart_tx_a0, 4, 17),
530 GROUP(uart_rx_a0, 4, 16),
531 GROUP(uart_cts_a0, 4, 15),
532 GROUP(uart_rts_a0, 4, 14),
533
534 GROUP(uart_tx_a1, 4, 13),
535 GROUP(uart_rx_a1, 4, 12),
536 GROUP(uart_cts_a1, 4, 11),
537 GROUP(uart_rts_a1, 4, 10),
538
539 GROUP(uart_tx_b0, 4, 9),
540 GROUP(uart_rx_b0, 4, 8),
541 GROUP(uart_cts_b0, 4, 7),
542 GROUP(uart_rts_b0, 4, 6),
543
544 GROUP(iso7816_det, 4, 21),
545 GROUP(iso7816_reset, 4, 20),
546 GROUP(iso7816_clk, 4, 19),
547 GROUP(iso7816_data, 4, 18),
548
549 GROUP(i2c_sda_d0, 4, 5),
550 GROUP(i2c_sck_d0, 4, 4),
551
552 GROUP(xtal_32k_out, 3, 22),
553 GROUP(xtal_24m_out, 3, 23),
554
Martin Blumenstinglc1f29552017-05-06 18:57:48 +0200555 GROUP(pwm_e, 9, 19),
556 GROUP(pwm_b_x, 2, 3),
557
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100558 /* bank Y */
559 GROUP(uart_tx_c, 1, 19),
560 GROUP(uart_rx_c, 1, 18),
561 GROUP(uart_cts_c, 1, 17),
562 GROUP(uart_rts_c, 1, 16),
563
564 GROUP(pcm_out_b, 4, 25),
565 GROUP(pcm_in_b, 4, 24),
566 GROUP(pcm_fs_b, 4, 23),
567 GROUP(pcm_clk_b, 4, 22),
568
569 GROUP(i2c_sda_c0, 1, 15),
570 GROUP(i2c_sck_c0, 1, 14),
571
Martin Blumenstinglc1f29552017-05-06 18:57:48 +0200572 GROUP(pwm_a_y, 9, 14),
573
Martin Blumenstingl64f6d072017-05-06 18:57:49 +0200574 GROUP(i2s_out_ch45, 1, 10),
575 GROUP(i2s_out_ch23, 1, 19),
576 GROUP(i2s_out_ch01, 1, 6),
577 GROUP(i2s_in_ch01, 1, 5),
578 GROUP(i2s_lr_clk_in, 1, 4),
579 GROUP(i2s_ao_clk_in, 1, 2),
580 GROUP(i2s_am_clk, 1, 0),
581 GROUP(i2s_out_ch78, 1, 11),
582
583 GROUP(spdif_in, 1, 8),
584 GROUP(spdif_out, 1, 7),
585
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100586 /* bank DV */
587 GROUP(dvin_rgb, 0, 6),
588 GROUP(dvin_vs, 0, 9),
589 GROUP(dvin_hs, 0, 8),
590 GROUP(dvin_clk, 0, 7),
591 GROUP(dvin_de, 0, 10),
592
593 GROUP(enc_0, 7, 0),
594 GROUP(enc_1, 7, 1),
595 GROUP(enc_2, 7, 2),
596 GROUP(enc_3, 7, 3),
597 GROUP(enc_4, 7, 4),
598 GROUP(enc_5, 7, 5),
599 GROUP(enc_6, 7, 6),
600 GROUP(enc_7, 7, 7),
601 GROUP(enc_8, 7, 8),
602 GROUP(enc_9, 7, 9),
603 GROUP(enc_10, 7, 10),
604 GROUP(enc_11, 7, 11),
605 GROUP(enc_12, 7, 12),
606 GROUP(enc_13, 7, 13),
607 GROUP(enc_14, 7, 14),
608 GROUP(enc_15, 7, 15),
609 GROUP(enc_16, 7, 16),
610 GROUP(enc_17, 7, 17),
611
612 GROUP(uart_tx_b1, 6, 23),
613 GROUP(uart_rx_b1, 6, 22),
614 GROUP(uart_cts_b1, 6, 21),
615 GROUP(uart_rts_b1, 6, 20),
616
617 GROUP(vga_vs, 0, 21),
618 GROUP(vga_hs, 0, 20),
619
Martin Blumenstinglc1f29552017-05-06 18:57:48 +0200620 GROUP(pwm_c_dv9, 3, 24),
621 GROUP(pwm_c_dv29, 3, 25),
622 GROUP(pwm_d, 3, 26),
623
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100624 /* bank H */
625 GROUP(hdmi_hpd, 1, 26),
626 GROUP(hdmi_sda, 1, 25),
627 GROUP(hdmi_scl, 1, 24),
628 GROUP(hdmi_cec, 1, 23),
629
630 GROUP(spi_ss0_0, 9, 13),
631 GROUP(spi_miso_0, 9, 12),
632 GROUP(spi_mosi_0, 9, 11),
633 GROUP(spi_sclk_0, 9, 10),
634
635 GROUP(i2c_sda_d1, 4, 3),
636 GROUP(i2c_sck_d1, 4, 2),
637
638 /* bank Z */
639 GROUP(spi_ss0_1, 8, 16),
640 GROUP(spi_ss1_1, 8, 12),
641 GROUP(spi_sclk_1, 8, 15),
642 GROUP(spi_mosi_1, 8, 14),
643 GROUP(spi_miso_1, 8, 13),
644 GROUP(spi_ss2_1, 8, 17),
645
646 GROUP(eth_tx_clk_50m, 6, 15),
647 GROUP(eth_tx_en, 6, 14),
648 GROUP(eth_txd1, 6, 13),
649 GROUP(eth_txd0, 6, 12),
650 GROUP(eth_rx_clk_in, 6, 10),
651 GROUP(eth_rx_dv, 6, 11),
652 GROUP(eth_rxd1, 6, 8),
653 GROUP(eth_rxd0, 6, 7),
654 GROUP(eth_mdio, 6, 6),
655 GROUP(eth_mdc, 6, 5),
656
Martin Blumenstinglbf6f1462018-04-22 12:53:30 +0200657 /* NOTE: the following four groups are only available on Meson8m2: */
658 GROUP(eth_rxd2, 6, 3),
659 GROUP(eth_rxd3, 6, 2),
660 GROUP(eth_txd2, 6, 1),
661 GROUP(eth_txd3, 6, 0),
662
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100663 GROUP(i2c_sda_a0, 5, 31),
664 GROUP(i2c_sck_a0, 5, 30),
665
666 GROUP(i2c_sda_b, 5, 27),
667 GROUP(i2c_sck_b, 5, 26),
668
669 GROUP(i2c_sda_c1, 5, 25),
670 GROUP(i2c_sck_c1, 5, 24),
671
672 GROUP(i2c_sda_a1, 5, 9),
673 GROUP(i2c_sck_a1, 5, 8),
674
675 GROUP(i2c_sda_a2, 5, 7),
676 GROUP(i2c_sck_a2, 5, 6),
677
Martin Blumenstinglc1f29552017-05-06 18:57:48 +0200678 GROUP(pwm_a_z0, 9, 16),
679 GROUP(pwm_a_z7, 2, 0),
680 GROUP(pwm_b_z, 9, 15),
681 GROUP(pwm_c_z, 2, 1),
682
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100683 /* bank BOOT */
684 GROUP(sd_d0_c, 6, 29),
685 GROUP(sd_d1_c, 6, 28),
686 GROUP(sd_d2_c, 6, 27),
687 GROUP(sd_d3_c, 6, 26),
688 GROUP(sd_cmd_c, 6, 25),
689 GROUP(sd_clk_c, 6, 24),
690
691 GROUP(sdxc_d0_c, 4, 30),
692 GROUP(sdxc_d13_c, 4, 29),
693 GROUP(sdxc_d47_c, 4, 28),
694 GROUP(sdxc_cmd_c, 4, 27),
695 GROUP(sdxc_clk_c, 4, 26),
696
697 GROUP(nand_io, 2, 26),
698 GROUP(nand_io_ce0, 2, 25),
699 GROUP(nand_io_ce1, 2, 24),
700 GROUP(nand_io_rb0, 2, 17),
701 GROUP(nand_ale, 2, 21),
702 GROUP(nand_cle, 2, 20),
703 GROUP(nand_wen_clk, 2, 19),
704 GROUP(nand_ren_clk, 2, 18),
705 GROUP(nand_dqs, 2, 27),
706 GROUP(nand_ce2, 2, 23),
707 GROUP(nand_ce3, 2, 22),
708
709 GROUP(nor_d, 5, 1),
710 GROUP(nor_q, 5, 3),
711 GROUP(nor_c, 5, 2),
712 GROUP(nor_cs, 5, 0),
713
714 /* bank CARD */
715 GROUP(sd_d1_b, 2, 14),
716 GROUP(sd_d0_b, 2, 15),
717 GROUP(sd_clk_b, 2, 11),
718 GROUP(sd_cmd_b, 2, 10),
719 GROUP(sd_d3_b, 2, 12),
720 GROUP(sd_d2_b, 2, 13),
721
722 GROUP(sdxc_d13_b, 2, 6),
723 GROUP(sdxc_d0_b, 2, 7),
724 GROUP(sdxc_clk_b, 2, 5),
725 GROUP(sdxc_cmd_b, 2, 4),
Carlo Caione9dab1862016-03-01 23:04:34 +0100726};
727
728static struct meson_pmx_group meson8_aobus_groups[] = {
Jerome Brunet634e40b2017-09-20 15:39:20 +0200729 GPIO_GROUP(GPIOAO_0),
730 GPIO_GROUP(GPIOAO_1),
731 GPIO_GROUP(GPIOAO_2),
732 GPIO_GROUP(GPIOAO_3),
733 GPIO_GROUP(GPIOAO_4),
734 GPIO_GROUP(GPIOAO_5),
735 GPIO_GROUP(GPIOAO_6),
736 GPIO_GROUP(GPIOAO_7),
737 GPIO_GROUP(GPIOAO_8),
738 GPIO_GROUP(GPIOAO_9),
739 GPIO_GROUP(GPIOAO_10),
740 GPIO_GROUP(GPIOAO_11),
741 GPIO_GROUP(GPIOAO_12),
742 GPIO_GROUP(GPIOAO_13),
743 GPIO_GROUP(GPIO_BSD_EN),
744 GPIO_GROUP(GPIO_TEST_N),
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100745
746 /* bank AO */
Carlo Caione9dab1862016-03-01 23:04:34 +0100747 GROUP(uart_tx_ao_a, 0, 12),
748 GROUP(uart_rx_ao_a, 0, 11),
749 GROUP(uart_cts_ao_a, 0, 10),
750 GROUP(uart_rts_ao_a, 0, 9),
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100751
Carlo Caione9dab1862016-03-01 23:04:34 +0100752 GROUP(remote_input, 0, 0),
Martin Blumenstingle70a3842017-05-06 18:57:50 +0200753 GROUP(remote_output_ao, 0, 31),
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100754
Carlo Caione9dab1862016-03-01 23:04:34 +0100755 GROUP(i2c_slave_sck_ao, 0, 2),
756 GROUP(i2c_slave_sda_ao, 0, 1),
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100757
Carlo Caione9dab1862016-03-01 23:04:34 +0100758 GROUP(uart_tx_ao_b0, 0, 26),
759 GROUP(uart_rx_ao_b0, 0, 25),
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100760
Carlo Caione9dab1862016-03-01 23:04:34 +0100761 GROUP(uart_tx_ao_b1, 0, 24),
762 GROUP(uart_rx_ao_b1, 0, 23),
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100763
Carlo Caione9dab1862016-03-01 23:04:34 +0100764 GROUP(i2c_mst_sck_ao, 0, 6),
765 GROUP(i2c_mst_sda_ao, 0, 5),
Martin Blumenstinglc1f29552017-05-06 18:57:48 +0200766
767 GROUP(pwm_f_ao, 0, 19),
Martin Blumenstingl64f6d072017-05-06 18:57:49 +0200768
769 GROUP(i2s_am_clk_out_ao, 0, 30),
770 GROUP(i2s_ao_clk_out_ao, 0, 29),
771 GROUP(i2s_lr_clk_out_ao, 0, 28),
772 GROUP(i2s_out_ch01_ao, 0, 27),
Martin Blumenstinglc21b4322017-05-06 18:57:51 +0200773
774 GROUP(hdmi_cec_ao, 0, 17),
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100775};
776
777static const char * const gpio_groups[] = {
778 "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4",
779 "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9",
780 "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14",
781 "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18", "GPIOX_19",
782 "GPIOX_20", "GPIOX_21",
783
784 "GPIOY_0", "GPIOY_1", "GPIOY_2", "GPIOY_3", "GPIOY_4",
785 "GPIOY_5", "GPIOY_6", "GPIOY_7", "GPIOY_8", "GPIOY_9",
786 "GPIOY_10", "GPIOY_11", "GPIOY_12", "GPIOY_13", "GPIOY_14",
787 "GPIOY_15", "GPIOY_16",
788
789 "GPIODV_0", "GPIODV_1", "GPIODV_2", "GPIODV_3", "GPIODV_4",
790 "GPIODV_5", "GPIODV_6", "GPIODV_7", "GPIODV_8", "GPIODV_9",
791 "GPIODV_10", "GPIODV_11", "GPIODV_12", "GPIODV_13", "GPIODV_14",
792 "GPIODV_15", "GPIODV_16", "GPIODV_17", "GPIODV_18", "GPIODV_19",
793 "GPIODV_20", "GPIODV_21", "GPIODV_22", "GPIODV_23", "GPIODV_24",
794 "GPIODV_25", "GPIODV_26", "GPIODV_27", "GPIODV_28", "GPIODV_29",
795
796 "GPIOH_0", "GPIOH_1", "GPIOH_2", "GPIOH_3", "GPIOH_4",
797 "GPIOH_5", "GPIOH_6", "GPIOH_7", "GPIOH_8", "GPIOH_9",
798
799 "GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4",
800 "GPIOZ_5", "GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9",
801 "GPIOZ_10", "GPIOZ_11", "GPIOZ_12", "GPIOZ_13", "GPIOZ_14",
802
803 "CARD_0", "CARD_1", "CARD_2", "CARD_3", "CARD_4",
804 "CARD_5", "CARD_6",
805
806 "BOOT_0", "BOOT_1", "BOOT_2", "BOOT_3", "BOOT_4",
807 "BOOT_5", "BOOT_6", "BOOT_7", "BOOT_8", "BOOT_9",
808 "BOOT_10", "BOOT_11", "BOOT_12", "BOOT_13", "BOOT_14",
809 "BOOT_15", "BOOT_16", "BOOT_17", "BOOT_18",
810
811 "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3",
812 "GPIOAO_4", "GPIOAO_5", "GPIOAO_6", "GPIOAO_7",
813 "GPIOAO_8", "GPIOAO_9", "GPIOAO_10", "GPIOAO_11",
814 "GPIOAO_12", "GPIOAO_13", "GPIO_BSD_EN", "GPIO_TEST_N"
815};
816
817static const char * const sd_a_groups[] = {
818 "sd_d0_a", "sd_d1_a", "sd_d2_a", "sd_d3_a", "sd_clk_a", "sd_cmd_a"
819};
820
821static const char * const sdxc_a_groups[] = {
822 "sdxc_d0_a", "sdxc_d13_a", "sdxc_d47_a", "sdxc_clk_a", "sdxc_cmd_a"
823};
824
825static const char * const pcm_a_groups[] = {
826 "pcm_out_a", "pcm_in_a", "pcm_fs_a", "pcm_clk_a"
827};
828
829static const char * const uart_a_groups[] = {
830 "uart_tx_a0", "uart_rx_a0", "uart_cts_a0", "uart_rts_a0",
831 "uart_tx_a1", "uart_rx_a1", "uart_cts_a1", "uart_rts_a1"
832};
833
834static const char * const uart_b_groups[] = {
835 "uart_tx_b0", "uart_rx_b0", "uart_cts_b0", "uart_rts_b0",
836 "uart_tx_b1", "uart_rx_b1", "uart_cts_b1", "uart_rts_b1"
837};
838
839static const char * const iso7816_groups[] = {
840 "iso7816_det", "iso7816_reset", "iso7816_clk", "iso7816_data"
841};
842
843static const char * const i2c_d_groups[] = {
844 "i2c_sda_d0", "i2c_sck_d0", "i2c_sda_d1", "i2c_sck_d1"
845};
846
847static const char * const xtal_groups[] = {
848 "xtal_32k_out", "xtal_24m_out"
849};
850
851static const char * const uart_c_groups[] = {
852 "uart_tx_c", "uart_rx_c", "uart_cts_c", "uart_rts_c"
853};
854
855static const char * const pcm_b_groups[] = {
856 "pcm_out_b", "pcm_in_b", "pcm_fs_b", "pcm_clk_b"
857};
858
859static const char * const i2c_c_groups[] = {
860 "i2c_sda_c0", "i2c_sck_c0", "i2c_sda_c1", "i2c_sck_c1"
861};
862
863static const char * const dvin_groups[] = {
864 "dvin_rgb", "dvin_vs", "dvin_hs", "dvin_clk", "dvin_de"
865};
866
867static const char * const enc_groups[] = {
868 "enc_0", "enc_1", "enc_2", "enc_3", "enc_4", "enc_5",
869 "enc_6", "enc_7", "enc_8", "enc_9", "enc_10", "enc_11",
870 "enc_12", "enc_13", "enc_14", "enc_15", "enc_16", "enc_17"
871};
872
873static const char * const vga_groups[] = {
874 "vga_vs", "vga_hs"
875};
876
877static const char * const hdmi_groups[] = {
878 "hdmi_hpd", "hdmi_sda", "hdmi_scl", "hdmi_cec"
879};
880
881static const char * const spi_groups[] = {
882 "spi_ss0_0", "spi_miso_0", "spi_mosi_0", "spi_sclk_0",
883 "spi_ss0_1", "spi_ss1_1", "spi_sclk_1", "spi_mosi_1",
884 "spi_miso_1", "spi_ss2_1"
885};
886
887static const char * const ethernet_groups[] = {
888 "eth_tx_clk_50m", "eth_tx_en", "eth_txd1",
889 "eth_txd0", "eth_rx_clk_in", "eth_rx_dv",
Martin Blumenstinglbf6f1462018-04-22 12:53:30 +0200890 "eth_rxd1", "eth_rxd0", "eth_mdio", "eth_mdc", "eth_rxd2",
891 "eth_rxd3", "eth_txd2", "eth_txd3"
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100892};
893
894static const char * const i2c_a_groups[] = {
895 "i2c_sda_a0", "i2c_sck_a0", "i2c_sda_a1", "i2c_sck_a1",
896 "i2c_sda_a2", "i2c_sck_a2"
897};
898
899static const char * const i2c_b_groups[] = {
900 "i2c_sda_b", "i2c_sck_b"
901};
902
Martin Blumenstingl64f6d072017-05-06 18:57:49 +0200903static const char * const i2s_groups[] = {
904 "i2s_out_ch45", "i2s_out_ch23_pins", "i2s_out_ch01_pins",
905 "i2s_in_ch01_pins", "i2s_lr_clk_in_pins", "i2s_ao_clk_in_pins",
906 "i2s_am_clk_pins", "i2s_out_ch78_pins"
907};
908
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100909static const char * const sd_c_groups[] = {
910 "sd_d0_c", "sd_d1_c", "sd_d2_c", "sd_d3_c",
911 "sd_cmd_c", "sd_clk_c"
912};
913
914static const char * const sdxc_c_groups[] = {
915 "sdxc_d0_c", "sdxc_d13_c", "sdxc_d47_c", "sdxc_cmd_c",
916 "sdxc_clk_c"
917};
918
919static const char * const nand_groups[] = {
920 "nand_io", "nand_io_ce0", "nand_io_ce1",
921 "nand_io_rb0", "nand_ale", "nand_cle",
922 "nand_wen_clk", "nand_ren_clk", "nand_dqs",
923 "nand_ce2", "nand_ce3"
924};
925
926static const char * const nor_groups[] = {
927 "nor_d", "nor_q", "nor_c", "nor_cs"
928};
929
Martin Blumenstinglc1f29552017-05-06 18:57:48 +0200930static const char * const pwm_a_groups[] = {
931 "pwm_a_y", "pwm_a_z0", "pwm_a_z7"
932};
933
934static const char * const pwm_b_groups[] = {
935 "pwm_b_x", "pwm_b_z"
936};
937
938static const char * const pwm_c_groups[] = {
939 "pwm_c_dv9", "pwm_c_dv29", "pwm_c_z"
940};
941
942static const char * const pwm_d_groups[] = {
943 "pwm_d"
944};
945
946static const char * const pwm_e_groups[] = {
947 "pwm_e"
948};
949
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100950static const char * const sd_b_groups[] = {
951 "sd_d1_b", "sd_d0_b", "sd_clk_b", "sd_cmd_b",
952 "sd_d3_b", "sd_d2_b"
953};
954
955static const char * const sdxc_b_groups[] = {
956 "sdxc_d13_b", "sdxc_d0_b", "sdxc_clk_b", "sdxc_cmd_b"
957};
958
Martin Blumenstingl64f6d072017-05-06 18:57:49 +0200959static const char * const spdif_groups[] = {
960 "spdif_in", "spdif_out"
961};
962
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100963static const char * const uart_ao_groups[] = {
964 "uart_tx_ao_a", "uart_rx_ao_a", "uart_cts_ao_a", "uart_rts_ao_a"
965};
966
967static const char * const remote_groups[] = {
Martin Blumenstingle70a3842017-05-06 18:57:50 +0200968 "remote_input", "remote_output_ao"
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100969};
970
971static const char * const i2c_slave_ao_groups[] = {
972 "i2c_slave_sck_ao", "i2c_slave_sda_ao"
973};
974
975static const char * const uart_ao_b_groups[] = {
976 "uart_tx_ao_b0", "uart_rx_ao_b0", "uart_tx_ao_b1", "uart_rx_ao_b1"
977};
978
979static const char * const i2c_mst_ao_groups[] = {
980 "i2c_mst_sck_ao", "i2c_mst_sda_ao"
981};
982
Martin Blumenstinglc1f29552017-05-06 18:57:48 +0200983static const char * const pwm_f_ao_groups[] = {
984 "pwm_f_ao"
985};
986
Martin Blumenstingl64f6d072017-05-06 18:57:49 +0200987static const char * const i2s_ao_groups[] = {
988 "i2s_am_clk_out_ao", "i2s_ao_clk_out_ao", "i2s_lr_clk_out_ao",
989 "i2s_out_ch01_ao"
990};
991
Martin Blumenstinglc21b4322017-05-06 18:57:51 +0200992static const char * const hdmi_cec_ao_groups[] = {
993 "hdmi_cec_ao"
994};
995
Carlo Caione9dab1862016-03-01 23:04:34 +0100996static struct meson_pmx_func meson8_cbus_functions[] = {
Beniamino Galvani6ac73092015-01-17 19:15:14 +0100997 FUNCTION(gpio),
998 FUNCTION(sd_a),
999 FUNCTION(sdxc_a),
1000 FUNCTION(pcm_a),
1001 FUNCTION(uart_a),
1002 FUNCTION(uart_b),
1003 FUNCTION(iso7816),
1004 FUNCTION(i2c_d),
1005 FUNCTION(xtal),
1006 FUNCTION(uart_c),
1007 FUNCTION(pcm_b),
1008 FUNCTION(i2c_c),
1009 FUNCTION(dvin),
1010 FUNCTION(enc),
1011 FUNCTION(vga),
1012 FUNCTION(hdmi),
1013 FUNCTION(spi),
1014 FUNCTION(ethernet),
1015 FUNCTION(i2c_a),
1016 FUNCTION(i2c_b),
1017 FUNCTION(sd_c),
1018 FUNCTION(sdxc_c),
1019 FUNCTION(nand),
1020 FUNCTION(nor),
1021 FUNCTION(sd_b),
1022 FUNCTION(sdxc_b),
Martin Blumenstinglc1f29552017-05-06 18:57:48 +02001023 FUNCTION(pwm_a),
1024 FUNCTION(pwm_b),
1025 FUNCTION(pwm_c),
1026 FUNCTION(pwm_d),
1027 FUNCTION(pwm_e),
Martin Blumenstingl64f6d072017-05-06 18:57:49 +02001028 FUNCTION(i2s),
1029 FUNCTION(spdif),
Carlo Caione9dab1862016-03-01 23:04:34 +01001030};
1031
1032static struct meson_pmx_func meson8_aobus_functions[] = {
Beniamino Galvani6ac73092015-01-17 19:15:14 +01001033 FUNCTION(uart_ao),
1034 FUNCTION(remote),
1035 FUNCTION(i2c_slave_ao),
1036 FUNCTION(uart_ao_b),
1037 FUNCTION(i2c_mst_ao),
Martin Blumenstinglc1f29552017-05-06 18:57:48 +02001038 FUNCTION(pwm_f_ao),
Martin Blumenstingl64f6d072017-05-06 18:57:49 +02001039 FUNCTION(i2s_ao),
Martin Blumenstinglc21b4322017-05-06 18:57:51 +02001040 FUNCTION(hdmi_cec_ao),
Beniamino Galvani6ac73092015-01-17 19:15:14 +01001041};
1042
Carlo Caione9dab1862016-03-01 23:04:34 +01001043static struct meson_bank meson8_cbus_banks[] = {
Jerome Brunet634e40b2017-09-20 15:39:20 +02001044 /* name first last irq pullen pull dir out in */
1045 BANK("X", GPIOX_0, GPIOX_21, 112, 133, 4, 0, 4, 0, 0, 0, 1, 0, 2, 0),
1046 BANK("Y", GPIOY_0, GPIOY_16, 95, 111, 3, 0, 3, 0, 3, 0, 4, 0, 5, 0),
1047 BANK("DV", GPIODV_0, GPIODV_29, 65, 94, 0, 0, 0, 0, 7, 0, 8, 0, 9, 0),
1048 BANK("H", GPIOH_0, GPIOH_9, 29, 38, 1, 16, 1, 16, 9, 19, 10, 19, 11, 19),
1049 BANK("Z", GPIOZ_0, GPIOZ_14, 14, 28, 1, 0, 1, 0, 3, 17, 4, 17, 5, 17),
1050 BANK("CARD", CARD_0, CARD_6, 58, 64, 2, 20, 2, 20, 0, 22, 1, 22, 2, 22),
1051 BANK("BOOT", BOOT_0, BOOT_18, 39, 57, 2, 0, 2, 0, 9, 0, 10, 0, 11, 0),
Beniamino Galvani6ac73092015-01-17 19:15:14 +01001052};
1053
Carlo Caione9dab1862016-03-01 23:04:34 +01001054static struct meson_bank meson8_aobus_banks[] = {
Jerome Brunet634e40b2017-09-20 15:39:20 +02001055 /* name first last irq pullen pull dir out in */
1056 BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0),
Beniamino Galvani6ac73092015-01-17 19:15:14 +01001057};
1058
Jerome Brunet277d14e2017-10-12 14:40:25 +02001059static struct meson_pinctrl_data meson8_cbus_pinctrl_data = {
Beniamino Galvanidb80f0e2016-08-13 19:41:18 +02001060 .name = "cbus-banks",
Carlo Caione9dab1862016-03-01 23:04:34 +01001061 .pins = meson8_cbus_pins,
1062 .groups = meson8_cbus_groups,
1063 .funcs = meson8_cbus_functions,
Beniamino Galvanidb80f0e2016-08-13 19:41:18 +02001064 .banks = meson8_cbus_banks,
Carlo Caione9dab1862016-03-01 23:04:34 +01001065 .num_pins = ARRAY_SIZE(meson8_cbus_pins),
1066 .num_groups = ARRAY_SIZE(meson8_cbus_groups),
1067 .num_funcs = ARRAY_SIZE(meson8_cbus_functions),
Beniamino Galvanidb80f0e2016-08-13 19:41:18 +02001068 .num_banks = ARRAY_SIZE(meson8_cbus_banks),
Jerome Brunetce385aa2017-10-12 14:40:26 +02001069 .pmx_ops = &meson8_pmx_ops,
Carlo Caione9dab1862016-03-01 23:04:34 +01001070};
1071
Jerome Brunet277d14e2017-10-12 14:40:25 +02001072static struct meson_pinctrl_data meson8_aobus_pinctrl_data = {
Beniamino Galvanidb80f0e2016-08-13 19:41:18 +02001073 .name = "ao-bank",
Carlo Caione9dab1862016-03-01 23:04:34 +01001074 .pins = meson8_aobus_pins,
1075 .groups = meson8_aobus_groups,
1076 .funcs = meson8_aobus_functions,
Beniamino Galvanidb80f0e2016-08-13 19:41:18 +02001077 .banks = meson8_aobus_banks,
Carlo Caione9dab1862016-03-01 23:04:34 +01001078 .num_pins = ARRAY_SIZE(meson8_aobus_pins),
1079 .num_groups = ARRAY_SIZE(meson8_aobus_groups),
1080 .num_funcs = ARRAY_SIZE(meson8_aobus_functions),
Beniamino Galvanidb80f0e2016-08-13 19:41:18 +02001081 .num_banks = ARRAY_SIZE(meson8_aobus_banks),
Jerome Brunetce385aa2017-10-12 14:40:26 +02001082 .pmx_ops = &meson8_pmx_ops,
Beniamino Galvani6ac73092015-01-17 19:15:14 +01001083};
Jerome Brunet277d14e2017-10-12 14:40:25 +02001084
1085static const struct of_device_id meson8_pinctrl_dt_match[] = {
1086 {
1087 .compatible = "amlogic,meson8-cbus-pinctrl",
1088 .data = &meson8_cbus_pinctrl_data,
1089 },
1090 {
1091 .compatible = "amlogic,meson8-aobus-pinctrl",
1092 .data = &meson8_aobus_pinctrl_data,
1093 },
Martin Blumenstinglb0d46cb2018-04-22 12:53:29 +02001094 {
1095 .compatible = "amlogic,meson8m2-cbus-pinctrl",
1096 .data = &meson8_cbus_pinctrl_data,
1097 },
1098 {
1099 .compatible = "amlogic,meson8m2-aobus-pinctrl",
1100 .data = &meson8_aobus_pinctrl_data,
1101 },
Jerome Brunet277d14e2017-10-12 14:40:25 +02001102 { },
1103};
1104
1105static struct platform_driver meson8_pinctrl_driver = {
1106 .probe = meson_pinctrl_probe,
1107 .driver = {
1108 .name = "meson8-pinctrl",
1109 .of_match_table = meson8_pinctrl_dt_match,
1110 },
1111};
1112builtin_platform_driver(meson8_pinctrl_driver);