1 /* 2 * Pin controller and GPIO driver for Amlogic Meson8. 3 * 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" 16 17 static const struct pinctrl_pin_desc meson8_cbus_pins[] = { 18 MESON_PIN(GPIOX_0), 19 MESON_PIN(GPIOX_1), 20 MESON_PIN(GPIOX_2), 21 MESON_PIN(GPIOX_3), 22 MESON_PIN(GPIOX_4), 23 MESON_PIN(GPIOX_5), 24 MESON_PIN(GPIOX_6), 25 MESON_PIN(GPIOX_7), 26 MESON_PIN(GPIOX_8), 27 MESON_PIN(GPIOX_9), 28 MESON_PIN(GPIOX_10), 29 MESON_PIN(GPIOX_11), 30 MESON_PIN(GPIOX_12), 31 MESON_PIN(GPIOX_13), 32 MESON_PIN(GPIOX_14), 33 MESON_PIN(GPIOX_15), 34 MESON_PIN(GPIOX_16), 35 MESON_PIN(GPIOX_17), 36 MESON_PIN(GPIOX_18), 37 MESON_PIN(GPIOX_19), 38 MESON_PIN(GPIOX_20), 39 MESON_PIN(GPIOX_21), 40 MESON_PIN(GPIOY_0), 41 MESON_PIN(GPIOY_1), 42 MESON_PIN(GPIOY_2), 43 MESON_PIN(GPIOY_3), 44 MESON_PIN(GPIOY_4), 45 MESON_PIN(GPIOY_5), 46 MESON_PIN(GPIOY_6), 47 MESON_PIN(GPIOY_7), 48 MESON_PIN(GPIOY_8), 49 MESON_PIN(GPIOY_9), 50 MESON_PIN(GPIOY_10), 51 MESON_PIN(GPIOY_11), 52 MESON_PIN(GPIOY_12), 53 MESON_PIN(GPIOY_13), 54 MESON_PIN(GPIOY_14), 55 MESON_PIN(GPIOY_15), 56 MESON_PIN(GPIOY_16), 57 MESON_PIN(GPIODV_0), 58 MESON_PIN(GPIODV_1), 59 MESON_PIN(GPIODV_2), 60 MESON_PIN(GPIODV_3), 61 MESON_PIN(GPIODV_4), 62 MESON_PIN(GPIODV_5), 63 MESON_PIN(GPIODV_6), 64 MESON_PIN(GPIODV_7), 65 MESON_PIN(GPIODV_8), 66 MESON_PIN(GPIODV_9), 67 MESON_PIN(GPIODV_10), 68 MESON_PIN(GPIODV_11), 69 MESON_PIN(GPIODV_12), 70 MESON_PIN(GPIODV_13), 71 MESON_PIN(GPIODV_14), 72 MESON_PIN(GPIODV_15), 73 MESON_PIN(GPIODV_16), 74 MESON_PIN(GPIODV_17), 75 MESON_PIN(GPIODV_18), 76 MESON_PIN(GPIODV_19), 77 MESON_PIN(GPIODV_20), 78 MESON_PIN(GPIODV_21), 79 MESON_PIN(GPIODV_22), 80 MESON_PIN(GPIODV_23), 81 MESON_PIN(GPIODV_24), 82 MESON_PIN(GPIODV_25), 83 MESON_PIN(GPIODV_26), 84 MESON_PIN(GPIODV_27), 85 MESON_PIN(GPIODV_28), 86 MESON_PIN(GPIODV_29), 87 MESON_PIN(GPIOH_0), 88 MESON_PIN(GPIOH_1), 89 MESON_PIN(GPIOH_2), 90 MESON_PIN(GPIOH_3), 91 MESON_PIN(GPIOH_4), 92 MESON_PIN(GPIOH_5), 93 MESON_PIN(GPIOH_6), 94 MESON_PIN(GPIOH_7), 95 MESON_PIN(GPIOH_8), 96 MESON_PIN(GPIOH_9), 97 MESON_PIN(GPIOZ_0), 98 MESON_PIN(GPIOZ_1), 99 MESON_PIN(GPIOZ_2), 100 MESON_PIN(GPIOZ_3), 101 MESON_PIN(GPIOZ_4), 102 MESON_PIN(GPIOZ_5), 103 MESON_PIN(GPIOZ_6), 104 MESON_PIN(GPIOZ_7), 105 MESON_PIN(GPIOZ_8), 106 MESON_PIN(GPIOZ_9), 107 MESON_PIN(GPIOZ_10), 108 MESON_PIN(GPIOZ_11), 109 MESON_PIN(GPIOZ_12), 110 MESON_PIN(GPIOZ_13), 111 MESON_PIN(GPIOZ_14), 112 MESON_PIN(CARD_0), 113 MESON_PIN(CARD_1), 114 MESON_PIN(CARD_2), 115 MESON_PIN(CARD_3), 116 MESON_PIN(CARD_4), 117 MESON_PIN(CARD_5), 118 MESON_PIN(CARD_6), 119 MESON_PIN(BOOT_0), 120 MESON_PIN(BOOT_1), 121 MESON_PIN(BOOT_2), 122 MESON_PIN(BOOT_3), 123 MESON_PIN(BOOT_4), 124 MESON_PIN(BOOT_5), 125 MESON_PIN(BOOT_6), 126 MESON_PIN(BOOT_7), 127 MESON_PIN(BOOT_8), 128 MESON_PIN(BOOT_9), 129 MESON_PIN(BOOT_10), 130 MESON_PIN(BOOT_11), 131 MESON_PIN(BOOT_12), 132 MESON_PIN(BOOT_13), 133 MESON_PIN(BOOT_14), 134 MESON_PIN(BOOT_15), 135 MESON_PIN(BOOT_16), 136 MESON_PIN(BOOT_17), 137 MESON_PIN(BOOT_18), 138 }; 139 140 static const struct pinctrl_pin_desc meson8_aobus_pins[] = { 141 MESON_PIN(GPIOAO_0), 142 MESON_PIN(GPIOAO_1), 143 MESON_PIN(GPIOAO_2), 144 MESON_PIN(GPIOAO_3), 145 MESON_PIN(GPIOAO_4), 146 MESON_PIN(GPIOAO_5), 147 MESON_PIN(GPIOAO_6), 148 MESON_PIN(GPIOAO_7), 149 MESON_PIN(GPIOAO_8), 150 MESON_PIN(GPIOAO_9), 151 MESON_PIN(GPIOAO_10), 152 MESON_PIN(GPIOAO_11), 153 MESON_PIN(GPIOAO_12), 154 MESON_PIN(GPIOAO_13), 155 MESON_PIN(GPIO_BSD_EN), 156 MESON_PIN(GPIO_TEST_N), 157 }; 158 159 /* bank X */ 160 static const unsigned int sd_d0_a_pins[] = { GPIOX_0 }; 161 static const unsigned int sd_d1_a_pins[] = { GPIOX_1 }; 162 static const unsigned int sd_d2_a_pins[] = { GPIOX_2 }; 163 static const unsigned int sd_d3_a_pins[] = { GPIOX_3 }; 164 static const unsigned int sd_clk_a_pins[] = { GPIOX_8 }; 165 static const unsigned int sd_cmd_a_pins[] = { GPIOX_9 }; 166 167 static const unsigned int sdxc_d0_a_pins[] = { GPIOX_0 }; 168 static const unsigned int sdxc_d13_a_pins[] = { GPIOX_1, GPIOX_2, GPIOX_3 }; 169 static const unsigned int sdxc_d47_a_pins[] = { GPIOX_4, GPIOX_5, GPIOX_6, 170 GPIOX_7 }; 171 static const unsigned int sdxc_clk_a_pins[] = { GPIOX_8 }; 172 static const unsigned int sdxc_cmd_a_pins[] = { GPIOX_9 }; 173 174 static const unsigned int pcm_out_a_pins[] = { GPIOX_4 }; 175 static const unsigned int pcm_in_a_pins[] = { GPIOX_5 }; 176 static const unsigned int pcm_fs_a_pins[] = { GPIOX_6 }; 177 static const unsigned int pcm_clk_a_pins[] = { GPIOX_7 }; 178 179 static const unsigned int uart_tx_a0_pins[] = { GPIOX_4 }; 180 static const unsigned int uart_rx_a0_pins[] = { GPIOX_5 }; 181 static const unsigned int uart_cts_a0_pins[] = { GPIOX_6 }; 182 static const unsigned int uart_rts_a0_pins[] = { GPIOX_7 }; 183 184 static const unsigned int uart_tx_a1_pins[] = { GPIOX_12 }; 185 static const unsigned int uart_rx_a1_pins[] = { GPIOX_13 }; 186 static const unsigned int uart_cts_a1_pins[] = { GPIOX_14 }; 187 static const unsigned int uart_rts_a1_pins[] = { GPIOX_15 }; 188 189 static const unsigned int uart_tx_b0_pins[] = { GPIOX_16 }; 190 static const unsigned int uart_rx_b0_pins[] = { GPIOX_17 }; 191 static const unsigned int uart_cts_b0_pins[] = { GPIOX_18 }; 192 static const unsigned int uart_rts_b0_pins[] = { GPIOX_19 }; 193 194 static const unsigned int iso7816_det_pins[] = { GPIOX_16 }; 195 static const unsigned int iso7816_reset_pins[] = { GPIOX_17 }; 196 static const unsigned int iso7816_clk_pins[] = { GPIOX_18 }; 197 static const unsigned int iso7816_data_pins[] = { GPIOX_19 }; 198 199 static const unsigned int i2c_sda_d0_pins[] = { GPIOX_16 }; 200 static const unsigned int i2c_sck_d0_pins[] = { GPIOX_17 }; 201 202 static const unsigned int xtal_32k_out_pins[] = { GPIOX_10 }; 203 static const unsigned int xtal_24m_out_pins[] = { GPIOX_11 }; 204 205 static const unsigned int pwm_e_pins[] = { GPIOX_10 }; 206 static const unsigned int pwm_b_x_pins[] = { GPIOX_11 }; 207 208 /* bank Y */ 209 static const unsigned int uart_tx_c_pins[] = { GPIOY_0 }; 210 static const unsigned int uart_rx_c_pins[] = { GPIOY_1 }; 211 static const unsigned int uart_cts_c_pins[] = { GPIOY_2 }; 212 static const unsigned int uart_rts_c_pins[] = { GPIOY_3 }; 213 214 static const unsigned int pcm_out_b_pins[] = { GPIOY_4 }; 215 static const unsigned int pcm_in_b_pins[] = { GPIOY_5 }; 216 static const unsigned int pcm_fs_b_pins[] = { GPIOY_6 }; 217 static const unsigned int pcm_clk_b_pins[] = { GPIOY_7 }; 218 219 static const unsigned int i2c_sda_c0_pins[] = { GPIOY_0 }; 220 static const unsigned int i2c_sck_c0_pins[] = { GPIOY_1 }; 221 222 static const unsigned int pwm_a_y_pins[] = { GPIOY_16 }; 223 224 static const unsigned int i2s_out_ch45_pins[] = { GPIOY_0 }; 225 static const unsigned int i2s_out_ch23_pins[] = { GPIOY_1 }; 226 static const unsigned int i2s_out_ch01_pins[] = { GPIOY_4 }; 227 static const unsigned int i2s_in_ch01_pins[] = { GPIOY_5 }; 228 static const unsigned int i2s_lr_clk_in_pins[] = { GPIOY_6 }; 229 static const unsigned int i2s_ao_clk_in_pins[] = { GPIOY_7 }; 230 static const unsigned int i2s_am_clk_pins[] = { GPIOY_8 }; 231 static const unsigned int i2s_out_ch78_pins[] = { GPIOY_9 }; 232 233 static const unsigned int spdif_in_pins[] = { GPIOY_2 }; 234 static const unsigned int spdif_out_pins[] = { GPIOY_3 }; 235 236 /* bank DV */ 237 static const unsigned int dvin_rgb_pins[] = { 238 GPIODV_0, GPIODV_1, GPIODV_2, GPIODV_3, GPIODV_4, GPIODV_5, 239 GPIODV_6, GPIODV_7, GPIODV_8, GPIODV_9, GPIODV_10, GPIODV_11, 240 GPIODV_12, GPIODV_13, GPIODV_14, GPIODV_15, GPIODV_16, GPIODV_17, 241 GPIODV_18, GPIODV_19, GPIODV_20, GPIODV_21, GPIODV_22, GPIODV_23 242 }; 243 static const unsigned int dvin_vs_pins[] = { GPIODV_24 }; 244 static const unsigned int dvin_hs_pins[] = { GPIODV_25 }; 245 static const unsigned int dvin_clk_pins[] = { GPIODV_26 }; 246 static const unsigned int dvin_de_pins[] = { GPIODV_27 }; 247 248 static const unsigned int enc_0_pins[] = { GPIODV_0 }; 249 static const unsigned int enc_1_pins[] = { GPIODV_1 }; 250 static const unsigned int enc_2_pins[] = { GPIODV_2 }; 251 static const unsigned int enc_3_pins[] = { GPIODV_3 }; 252 static const unsigned int enc_4_pins[] = { GPIODV_4 }; 253 static const unsigned int enc_5_pins[] = { GPIODV_5 }; 254 static const unsigned int enc_6_pins[] = { GPIODV_6 }; 255 static const unsigned int enc_7_pins[] = { GPIODV_7 }; 256 static const unsigned int enc_8_pins[] = { GPIODV_8 }; 257 static const unsigned int enc_9_pins[] = { GPIODV_9 }; 258 static const unsigned int enc_10_pins[] = { GPIODV_10 }; 259 static const unsigned int enc_11_pins[] = { GPIODV_11 }; 260 static const unsigned int enc_12_pins[] = { GPIODV_12 }; 261 static const unsigned int enc_13_pins[] = { GPIODV_13 }; 262 static const unsigned int enc_14_pins[] = { GPIODV_14 }; 263 static const unsigned int enc_15_pins[] = { GPIODV_15 }; 264 static const unsigned int enc_16_pins[] = { GPIODV_16 }; 265 static const unsigned int enc_17_pins[] = { GPIODV_17 }; 266 267 static const unsigned int uart_tx_b1_pins[] = { GPIODV_24 }; 268 static const unsigned int uart_rx_b1_pins[] = { GPIODV_25 }; 269 static const unsigned int uart_cts_b1_pins[] = { GPIODV_26 }; 270 static const unsigned int uart_rts_b1_pins[] = { GPIODV_27 }; 271 272 static const unsigned int vga_vs_pins[] = { GPIODV_24 }; 273 static const unsigned int vga_hs_pins[] = { GPIODV_25 }; 274 275 static const unsigned int pwm_c_dv9_pins[] = { GPIODV_9 }; 276 static const unsigned int pwm_c_dv29_pins[] = { GPIODV_29 }; 277 static const unsigned int pwm_d_pins[] = { GPIODV_28 }; 278 279 /* bank H */ 280 static const unsigned int hdmi_hpd_pins[] = { GPIOH_0 }; 281 static const unsigned int hdmi_sda_pins[] = { GPIOH_1 }; 282 static const unsigned int hdmi_scl_pins[] = { GPIOH_2 }; 283 static const unsigned int hdmi_cec_pins[] = { GPIOH_3 }; 284 285 static const unsigned int spi_ss0_0_pins[] = { GPIOH_3 }; 286 static const unsigned int spi_miso_0_pins[] = { GPIOH_4 }; 287 static const unsigned int spi_mosi_0_pins[] = { GPIOH_5 }; 288 static const unsigned int spi_sclk_0_pins[] = { GPIOH_6 }; 289 290 static const unsigned int i2c_sda_d1_pins[] = { GPIOH_7 }; 291 static const unsigned int i2c_sck_d1_pins[] = { GPIOH_8 }; 292 293 /* bank Z */ 294 static const unsigned int spi_ss0_1_pins[] = { GPIOZ_9 }; 295 static const unsigned int spi_ss1_1_pins[] = { GPIOZ_10 }; 296 static const unsigned int spi_sclk_1_pins[] = { GPIOZ_11 }; 297 static const unsigned int spi_mosi_1_pins[] = { GPIOZ_12 }; 298 static const unsigned int spi_miso_1_pins[] = { GPIOZ_13 }; 299 static const unsigned int spi_ss2_1_pins[] = { GPIOZ_14 }; 300 301 static const unsigned int eth_tx_clk_50m_pins[] = { GPIOZ_4 }; 302 static const unsigned int eth_tx_en_pins[] = { GPIOZ_5 }; 303 static const unsigned int eth_txd1_pins[] = { GPIOZ_6 }; 304 static const unsigned int eth_txd0_pins[] = { GPIOZ_7 }; 305 static const unsigned int eth_rx_clk_in_pins[] = { GPIOZ_8 }; 306 static const unsigned int eth_rx_dv_pins[] = { GPIOZ_9 }; 307 static const unsigned int eth_rxd1_pins[] = { GPIOZ_10 }; 308 static const unsigned int eth_rxd0_pins[] = { GPIOZ_11 }; 309 static const unsigned int eth_mdio_pins[] = { GPIOZ_12 }; 310 static const unsigned int eth_mdc_pins[] = { GPIOZ_13 }; 311 312 static const unsigned int i2c_sda_a0_pins[] = { GPIOZ_0 }; 313 static const unsigned int i2c_sck_a0_pins[] = { GPIOZ_1 }; 314 315 static const unsigned int i2c_sda_b_pins[] = { GPIOZ_2 }; 316 static const unsigned int i2c_sck_b_pins[] = { GPIOZ_3 }; 317 318 static const unsigned int i2c_sda_c1_pins[] = { GPIOZ_4 }; 319 static const unsigned int i2c_sck_c1_pins[] = { GPIOZ_5 }; 320 321 static const unsigned int i2c_sda_a1_pins[] = { GPIOZ_0 }; 322 static const unsigned int i2c_sck_a1_pins[] = { GPIOZ_1 }; 323 324 static const unsigned int i2c_sda_a2_pins[] = { GPIOZ_0 }; 325 static const unsigned int i2c_sck_a2_pins[] = { GPIOZ_1 }; 326 327 static const unsigned int pwm_a_z0_pins[] = { GPIOZ_0 }; 328 static const unsigned int pwm_a_z7_pins[] = { GPIOZ_7 }; 329 static const unsigned int pwm_b_z_pins[] = { GPIOZ_1 }; 330 static const unsigned int pwm_c_z_pins[] = { GPIOZ_8 }; 331 332 /* bank BOOT */ 333 static const unsigned int sd_d0_c_pins[] = { BOOT_0 }; 334 static const unsigned int sd_d1_c_pins[] = { BOOT_1 }; 335 static const unsigned int sd_d2_c_pins[] = { BOOT_2 }; 336 static const unsigned int sd_d3_c_pins[] = { BOOT_3 }; 337 static const unsigned int sd_cmd_c_pins[] = { BOOT_16 }; 338 static const unsigned int sd_clk_c_pins[] = { BOOT_17 }; 339 340 static const unsigned int sdxc_d0_c_pins[] = { BOOT_0}; 341 static const unsigned int sdxc_d13_c_pins[] = { BOOT_1, BOOT_2, BOOT_3 }; 342 static const unsigned int sdxc_d47_c_pins[] = { BOOT_4, BOOT_5, BOOT_6, 343 BOOT_7 }; 344 static const unsigned int sdxc_cmd_c_pins[] = { BOOT_16 }; 345 static const unsigned int sdxc_clk_c_pins[] = { BOOT_17 }; 346 347 static const unsigned int nand_io_pins[] = { 348 BOOT_0, BOOT_1, BOOT_2, BOOT_3, BOOT_4, BOOT_5, BOOT_6, BOOT_7 349 }; 350 static const unsigned int nand_io_ce0_pins[] = { BOOT_8 }; 351 static const unsigned int nand_io_ce1_pins[] = { BOOT_9 }; 352 static const unsigned int nand_io_rb0_pins[] = { BOOT_10 }; 353 static const unsigned int nand_ale_pins[] = { BOOT_11 }; 354 static const unsigned int nand_cle_pins[] = { BOOT_12 }; 355 static const unsigned int nand_wen_clk_pins[] = { BOOT_13 }; 356 static const unsigned int nand_ren_clk_pins[] = { BOOT_14 }; 357 static const unsigned int nand_dqs_pins[] = { BOOT_15 }; 358 static const unsigned int nand_ce2_pins[] = { BOOT_16 }; 359 static const unsigned int nand_ce3_pins[] = { BOOT_17 }; 360 361 static const unsigned int nor_d_pins[] = { BOOT_11 }; 362 static const unsigned int nor_q_pins[] = { BOOT_12 }; 363 static const unsigned int nor_c_pins[] = { BOOT_13 }; 364 static const unsigned int nor_cs_pins[] = { BOOT_18 }; 365 366 /* bank CARD */ 367 static const unsigned int sd_d1_b_pins[] = { CARD_0 }; 368 static const unsigned int sd_d0_b_pins[] = { CARD_1 }; 369 static const unsigned int sd_clk_b_pins[] = { CARD_2 }; 370 static const unsigned int sd_cmd_b_pins[] = { CARD_3 }; 371 static const unsigned int sd_d3_b_pins[] = { CARD_4 }; 372 static const unsigned int sd_d2_b_pins[] = { CARD_5 }; 373 374 static const unsigned int sdxc_d13_b_pins[] = { CARD_0, CARD_4, CARD_5 }; 375 static const unsigned int sdxc_d0_b_pins[] = { CARD_1 }; 376 static const unsigned int sdxc_clk_b_pins[] = { CARD_2 }; 377 static const unsigned int sdxc_cmd_b_pins[] = { CARD_3 }; 378 379 /* bank AO */ 380 static const unsigned int uart_tx_ao_a_pins[] = { GPIOAO_0 }; 381 static const unsigned int uart_rx_ao_a_pins[] = { GPIOAO_1 }; 382 static const unsigned int uart_cts_ao_a_pins[] = { GPIOAO_2 }; 383 static const unsigned int uart_rts_ao_a_pins[] = { GPIOAO_3 }; 384 385 static const unsigned int remote_input_pins[] = { GPIOAO_7 }; 386 static const unsigned int remote_output_ao_pins[] = { GPIOAO_13 }; 387 388 static const unsigned int i2c_slave_sck_ao_pins[] = { GPIOAO_4 }; 389 static const unsigned int i2c_slave_sda_ao_pins[] = { GPIOAO_5 }; 390 391 static const unsigned int uart_tx_ao_b0_pins[] = { GPIOAO_0 }; 392 static const unsigned int uart_rx_ao_b0_pins[] = { GPIOAO_1 }; 393 394 static const unsigned int uart_tx_ao_b1_pins[] = { GPIOAO_4 }; 395 static const unsigned int uart_rx_ao_b1_pins[] = { GPIOAO_5 }; 396 397 static const unsigned int i2c_mst_sck_ao_pins[] = { GPIOAO_4 }; 398 static const unsigned int i2c_mst_sda_ao_pins[] = { GPIOAO_5 }; 399 400 static const unsigned int pwm_f_ao_pins[] = { GPIO_TEST_N }; 401 402 static const unsigned int i2s_am_clk_out_ao_pins[] = { GPIOAO_8 }; 403 static const unsigned int i2s_ao_clk_out_ao_pins[] = { GPIOAO_9 }; 404 static const unsigned int i2s_lr_clk_out_ao_pins[] = { GPIOAO_10 }; 405 static const unsigned int i2s_out_ch01_ao_pins[] = { GPIOAO_11 }; 406 407 static const unsigned int hdmi_cec_ao_pins[] = { GPIOAO_12 }; 408 409 static struct meson_pmx_group meson8_cbus_groups[] = { 410 GPIO_GROUP(GPIOX_0), 411 GPIO_GROUP(GPIOX_1), 412 GPIO_GROUP(GPIOX_2), 413 GPIO_GROUP(GPIOX_3), 414 GPIO_GROUP(GPIOX_4), 415 GPIO_GROUP(GPIOX_5), 416 GPIO_GROUP(GPIOX_6), 417 GPIO_GROUP(GPIOX_7), 418 GPIO_GROUP(GPIOX_8), 419 GPIO_GROUP(GPIOX_9), 420 GPIO_GROUP(GPIOX_10), 421 GPIO_GROUP(GPIOX_11), 422 GPIO_GROUP(GPIOX_12), 423 GPIO_GROUP(GPIOX_13), 424 GPIO_GROUP(GPIOX_14), 425 GPIO_GROUP(GPIOX_15), 426 GPIO_GROUP(GPIOX_16), 427 GPIO_GROUP(GPIOX_17), 428 GPIO_GROUP(GPIOX_18), 429 GPIO_GROUP(GPIOX_19), 430 GPIO_GROUP(GPIOX_20), 431 GPIO_GROUP(GPIOX_21), 432 GPIO_GROUP(GPIOY_0), 433 GPIO_GROUP(GPIOY_1), 434 GPIO_GROUP(GPIOY_2), 435 GPIO_GROUP(GPIOY_3), 436 GPIO_GROUP(GPIOY_4), 437 GPIO_GROUP(GPIOY_5), 438 GPIO_GROUP(GPIOY_6), 439 GPIO_GROUP(GPIOY_7), 440 GPIO_GROUP(GPIOY_8), 441 GPIO_GROUP(GPIOY_9), 442 GPIO_GROUP(GPIOY_10), 443 GPIO_GROUP(GPIOY_11), 444 GPIO_GROUP(GPIOY_12), 445 GPIO_GROUP(GPIOY_13), 446 GPIO_GROUP(GPIOY_14), 447 GPIO_GROUP(GPIOY_15), 448 GPIO_GROUP(GPIOY_16), 449 GPIO_GROUP(GPIODV_0), 450 GPIO_GROUP(GPIODV_1), 451 GPIO_GROUP(GPIODV_2), 452 GPIO_GROUP(GPIODV_3), 453 GPIO_GROUP(GPIODV_4), 454 GPIO_GROUP(GPIODV_5), 455 GPIO_GROUP(GPIODV_6), 456 GPIO_GROUP(GPIODV_7), 457 GPIO_GROUP(GPIODV_8), 458 GPIO_GROUP(GPIODV_9), 459 GPIO_GROUP(GPIODV_10), 460 GPIO_GROUP(GPIODV_11), 461 GPIO_GROUP(GPIODV_12), 462 GPIO_GROUP(GPIODV_13), 463 GPIO_GROUP(GPIODV_14), 464 GPIO_GROUP(GPIODV_15), 465 GPIO_GROUP(GPIODV_16), 466 GPIO_GROUP(GPIODV_17), 467 GPIO_GROUP(GPIODV_18), 468 GPIO_GROUP(GPIODV_19), 469 GPIO_GROUP(GPIODV_20), 470 GPIO_GROUP(GPIODV_21), 471 GPIO_GROUP(GPIODV_22), 472 GPIO_GROUP(GPIODV_23), 473 GPIO_GROUP(GPIODV_24), 474 GPIO_GROUP(GPIODV_25), 475 GPIO_GROUP(GPIODV_26), 476 GPIO_GROUP(GPIODV_27), 477 GPIO_GROUP(GPIODV_28), 478 GPIO_GROUP(GPIODV_29), 479 GPIO_GROUP(GPIOH_0), 480 GPIO_GROUP(GPIOH_1), 481 GPIO_GROUP(GPIOH_2), 482 GPIO_GROUP(GPIOH_3), 483 GPIO_GROUP(GPIOH_4), 484 GPIO_GROUP(GPIOH_5), 485 GPIO_GROUP(GPIOH_6), 486 GPIO_GROUP(GPIOH_7), 487 GPIO_GROUP(GPIOH_8), 488 GPIO_GROUP(GPIOH_9), 489 GPIO_GROUP(GPIOZ_0), 490 GPIO_GROUP(GPIOZ_1), 491 GPIO_GROUP(GPIOZ_2), 492 GPIO_GROUP(GPIOZ_3), 493 GPIO_GROUP(GPIOZ_4), 494 GPIO_GROUP(GPIOZ_5), 495 GPIO_GROUP(GPIOZ_6), 496 GPIO_GROUP(GPIOZ_7), 497 GPIO_GROUP(GPIOZ_8), 498 GPIO_GROUP(GPIOZ_9), 499 GPIO_GROUP(GPIOZ_10), 500 GPIO_GROUP(GPIOZ_11), 501 GPIO_GROUP(GPIOZ_12), 502 GPIO_GROUP(GPIOZ_13), 503 GPIO_GROUP(GPIOZ_14), 504 505 /* bank X */ 506 GROUP(sd_d0_a, 8, 5), 507 GROUP(sd_d1_a, 8, 4), 508 GROUP(sd_d2_a, 8, 3), 509 GROUP(sd_d3_a, 8, 2), 510 GROUP(sd_clk_a, 8, 1), 511 GROUP(sd_cmd_a, 8, 0), 512 513 GROUP(sdxc_d0_a, 5, 14), 514 GROUP(sdxc_d13_a, 5, 13), 515 GROUP(sdxc_d47_a, 5, 12), 516 GROUP(sdxc_clk_a, 5, 11), 517 GROUP(sdxc_cmd_a, 5, 10), 518 519 GROUP(pcm_out_a, 3, 30), 520 GROUP(pcm_in_a, 3, 29), 521 GROUP(pcm_fs_a, 3, 28), 522 GROUP(pcm_clk_a, 3, 27), 523 524 GROUP(uart_tx_a0, 4, 17), 525 GROUP(uart_rx_a0, 4, 16), 526 GROUP(uart_cts_a0, 4, 15), 527 GROUP(uart_rts_a0, 4, 14), 528 529 GROUP(uart_tx_a1, 4, 13), 530 GROUP(uart_rx_a1, 4, 12), 531 GROUP(uart_cts_a1, 4, 11), 532 GROUP(uart_rts_a1, 4, 10), 533 534 GROUP(uart_tx_b0, 4, 9), 535 GROUP(uart_rx_b0, 4, 8), 536 GROUP(uart_cts_b0, 4, 7), 537 GROUP(uart_rts_b0, 4, 6), 538 539 GROUP(iso7816_det, 4, 21), 540 GROUP(iso7816_reset, 4, 20), 541 GROUP(iso7816_clk, 4, 19), 542 GROUP(iso7816_data, 4, 18), 543 544 GROUP(i2c_sda_d0, 4, 5), 545 GROUP(i2c_sck_d0, 4, 4), 546 547 GROUP(xtal_32k_out, 3, 22), 548 GROUP(xtal_24m_out, 3, 23), 549 550 GROUP(pwm_e, 9, 19), 551 GROUP(pwm_b_x, 2, 3), 552 553 /* bank Y */ 554 GROUP(uart_tx_c, 1, 19), 555 GROUP(uart_rx_c, 1, 18), 556 GROUP(uart_cts_c, 1, 17), 557 GROUP(uart_rts_c, 1, 16), 558 559 GROUP(pcm_out_b, 4, 25), 560 GROUP(pcm_in_b, 4, 24), 561 GROUP(pcm_fs_b, 4, 23), 562 GROUP(pcm_clk_b, 4, 22), 563 564 GROUP(i2c_sda_c0, 1, 15), 565 GROUP(i2c_sck_c0, 1, 14), 566 567 GROUP(pwm_a_y, 9, 14), 568 569 GROUP(i2s_out_ch45, 1, 10), 570 GROUP(i2s_out_ch23, 1, 19), 571 GROUP(i2s_out_ch01, 1, 6), 572 GROUP(i2s_in_ch01, 1, 5), 573 GROUP(i2s_lr_clk_in, 1, 4), 574 GROUP(i2s_ao_clk_in, 1, 2), 575 GROUP(i2s_am_clk, 1, 0), 576 GROUP(i2s_out_ch78, 1, 11), 577 578 GROUP(spdif_in, 1, 8), 579 GROUP(spdif_out, 1, 7), 580 581 /* bank DV */ 582 GROUP(dvin_rgb, 0, 6), 583 GROUP(dvin_vs, 0, 9), 584 GROUP(dvin_hs, 0, 8), 585 GROUP(dvin_clk, 0, 7), 586 GROUP(dvin_de, 0, 10), 587 588 GROUP(enc_0, 7, 0), 589 GROUP(enc_1, 7, 1), 590 GROUP(enc_2, 7, 2), 591 GROUP(enc_3, 7, 3), 592 GROUP(enc_4, 7, 4), 593 GROUP(enc_5, 7, 5), 594 GROUP(enc_6, 7, 6), 595 GROUP(enc_7, 7, 7), 596 GROUP(enc_8, 7, 8), 597 GROUP(enc_9, 7, 9), 598 GROUP(enc_10, 7, 10), 599 GROUP(enc_11, 7, 11), 600 GROUP(enc_12, 7, 12), 601 GROUP(enc_13, 7, 13), 602 GROUP(enc_14, 7, 14), 603 GROUP(enc_15, 7, 15), 604 GROUP(enc_16, 7, 16), 605 GROUP(enc_17, 7, 17), 606 607 GROUP(uart_tx_b1, 6, 23), 608 GROUP(uart_rx_b1, 6, 22), 609 GROUP(uart_cts_b1, 6, 21), 610 GROUP(uart_rts_b1, 6, 20), 611 612 GROUP(vga_vs, 0, 21), 613 GROUP(vga_hs, 0, 20), 614 615 GROUP(pwm_c_dv9, 3, 24), 616 GROUP(pwm_c_dv29, 3, 25), 617 GROUP(pwm_d, 3, 26), 618 619 /* bank H */ 620 GROUP(hdmi_hpd, 1, 26), 621 GROUP(hdmi_sda, 1, 25), 622 GROUP(hdmi_scl, 1, 24), 623 GROUP(hdmi_cec, 1, 23), 624 625 GROUP(spi_ss0_0, 9, 13), 626 GROUP(spi_miso_0, 9, 12), 627 GROUP(spi_mosi_0, 9, 11), 628 GROUP(spi_sclk_0, 9, 10), 629 630 GROUP(i2c_sda_d1, 4, 3), 631 GROUP(i2c_sck_d1, 4, 2), 632 633 /* bank Z */ 634 GROUP(spi_ss0_1, 8, 16), 635 GROUP(spi_ss1_1, 8, 12), 636 GROUP(spi_sclk_1, 8, 15), 637 GROUP(spi_mosi_1, 8, 14), 638 GROUP(spi_miso_1, 8, 13), 639 GROUP(spi_ss2_1, 8, 17), 640 641 GROUP(eth_tx_clk_50m, 6, 15), 642 GROUP(eth_tx_en, 6, 14), 643 GROUP(eth_txd1, 6, 13), 644 GROUP(eth_txd0, 6, 12), 645 GROUP(eth_rx_clk_in, 6, 10), 646 GROUP(eth_rx_dv, 6, 11), 647 GROUP(eth_rxd1, 6, 8), 648 GROUP(eth_rxd0, 6, 7), 649 GROUP(eth_mdio, 6, 6), 650 GROUP(eth_mdc, 6, 5), 651 652 GROUP(i2c_sda_a0, 5, 31), 653 GROUP(i2c_sck_a0, 5, 30), 654 655 GROUP(i2c_sda_b, 5, 27), 656 GROUP(i2c_sck_b, 5, 26), 657 658 GROUP(i2c_sda_c1, 5, 25), 659 GROUP(i2c_sck_c1, 5, 24), 660 661 GROUP(i2c_sda_a1, 5, 9), 662 GROUP(i2c_sck_a1, 5, 8), 663 664 GROUP(i2c_sda_a2, 5, 7), 665 GROUP(i2c_sck_a2, 5, 6), 666 667 GROUP(pwm_a_z0, 9, 16), 668 GROUP(pwm_a_z7, 2, 0), 669 GROUP(pwm_b_z, 9, 15), 670 GROUP(pwm_c_z, 2, 1), 671 672 /* bank BOOT */ 673 GROUP(sd_d0_c, 6, 29), 674 GROUP(sd_d1_c, 6, 28), 675 GROUP(sd_d2_c, 6, 27), 676 GROUP(sd_d3_c, 6, 26), 677 GROUP(sd_cmd_c, 6, 25), 678 GROUP(sd_clk_c, 6, 24), 679 680 GROUP(sdxc_d0_c, 4, 30), 681 GROUP(sdxc_d13_c, 4, 29), 682 GROUP(sdxc_d47_c, 4, 28), 683 GROUP(sdxc_cmd_c, 4, 27), 684 GROUP(sdxc_clk_c, 4, 26), 685 686 GROUP(nand_io, 2, 26), 687 GROUP(nand_io_ce0, 2, 25), 688 GROUP(nand_io_ce1, 2, 24), 689 GROUP(nand_io_rb0, 2, 17), 690 GROUP(nand_ale, 2, 21), 691 GROUP(nand_cle, 2, 20), 692 GROUP(nand_wen_clk, 2, 19), 693 GROUP(nand_ren_clk, 2, 18), 694 GROUP(nand_dqs, 2, 27), 695 GROUP(nand_ce2, 2, 23), 696 GROUP(nand_ce3, 2, 22), 697 698 GROUP(nor_d, 5, 1), 699 GROUP(nor_q, 5, 3), 700 GROUP(nor_c, 5, 2), 701 GROUP(nor_cs, 5, 0), 702 703 /* bank CARD */ 704 GROUP(sd_d1_b, 2, 14), 705 GROUP(sd_d0_b, 2, 15), 706 GROUP(sd_clk_b, 2, 11), 707 GROUP(sd_cmd_b, 2, 10), 708 GROUP(sd_d3_b, 2, 12), 709 GROUP(sd_d2_b, 2, 13), 710 711 GROUP(sdxc_d13_b, 2, 6), 712 GROUP(sdxc_d0_b, 2, 7), 713 GROUP(sdxc_clk_b, 2, 5), 714 GROUP(sdxc_cmd_b, 2, 4), 715 }; 716 717 static struct meson_pmx_group meson8_aobus_groups[] = { 718 GPIO_GROUP(GPIOAO_0), 719 GPIO_GROUP(GPIOAO_1), 720 GPIO_GROUP(GPIOAO_2), 721 GPIO_GROUP(GPIOAO_3), 722 GPIO_GROUP(GPIOAO_4), 723 GPIO_GROUP(GPIOAO_5), 724 GPIO_GROUP(GPIOAO_6), 725 GPIO_GROUP(GPIOAO_7), 726 GPIO_GROUP(GPIOAO_8), 727 GPIO_GROUP(GPIOAO_9), 728 GPIO_GROUP(GPIOAO_10), 729 GPIO_GROUP(GPIOAO_11), 730 GPIO_GROUP(GPIOAO_12), 731 GPIO_GROUP(GPIOAO_13), 732 GPIO_GROUP(GPIO_BSD_EN), 733 GPIO_GROUP(GPIO_TEST_N), 734 735 /* bank AO */ 736 GROUP(uart_tx_ao_a, 0, 12), 737 GROUP(uart_rx_ao_a, 0, 11), 738 GROUP(uart_cts_ao_a, 0, 10), 739 GROUP(uart_rts_ao_a, 0, 9), 740 741 GROUP(remote_input, 0, 0), 742 GROUP(remote_output_ao, 0, 31), 743 744 GROUP(i2c_slave_sck_ao, 0, 2), 745 GROUP(i2c_slave_sda_ao, 0, 1), 746 747 GROUP(uart_tx_ao_b0, 0, 26), 748 GROUP(uart_rx_ao_b0, 0, 25), 749 750 GROUP(uart_tx_ao_b1, 0, 24), 751 GROUP(uart_rx_ao_b1, 0, 23), 752 753 GROUP(i2c_mst_sck_ao, 0, 6), 754 GROUP(i2c_mst_sda_ao, 0, 5), 755 756 GROUP(pwm_f_ao, 0, 19), 757 758 GROUP(i2s_am_clk_out_ao, 0, 30), 759 GROUP(i2s_ao_clk_out_ao, 0, 29), 760 GROUP(i2s_lr_clk_out_ao, 0, 28), 761 GROUP(i2s_out_ch01_ao, 0, 27), 762 763 GROUP(hdmi_cec_ao, 0, 17), 764 }; 765 766 static const char * const gpio_groups[] = { 767 "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", "GPIOX_4", 768 "GPIOX_5", "GPIOX_6", "GPIOX_7", "GPIOX_8", "GPIOX_9", 769 "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14", 770 "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18", "GPIOX_19", 771 "GPIOX_20", "GPIOX_21", 772 773 "GPIOY_0", "GPIOY_1", "GPIOY_2", "GPIOY_3", "GPIOY_4", 774 "GPIOY_5", "GPIOY_6", "GPIOY_7", "GPIOY_8", "GPIOY_9", 775 "GPIOY_10", "GPIOY_11", "GPIOY_12", "GPIOY_13", "GPIOY_14", 776 "GPIOY_15", "GPIOY_16", 777 778 "GPIODV_0", "GPIODV_1", "GPIODV_2", "GPIODV_3", "GPIODV_4", 779 "GPIODV_5", "GPIODV_6", "GPIODV_7", "GPIODV_8", "GPIODV_9", 780 "GPIODV_10", "GPIODV_11", "GPIODV_12", "GPIODV_13", "GPIODV_14", 781 "GPIODV_15", "GPIODV_16", "GPIODV_17", "GPIODV_18", "GPIODV_19", 782 "GPIODV_20", "GPIODV_21", "GPIODV_22", "GPIODV_23", "GPIODV_24", 783 "GPIODV_25", "GPIODV_26", "GPIODV_27", "GPIODV_28", "GPIODV_29", 784 785 "GPIOH_0", "GPIOH_1", "GPIOH_2", "GPIOH_3", "GPIOH_4", 786 "GPIOH_5", "GPIOH_6", "GPIOH_7", "GPIOH_8", "GPIOH_9", 787 788 "GPIOZ_0", "GPIOZ_1", "GPIOZ_2", "GPIOZ_3", "GPIOZ_4", 789 "GPIOZ_5", "GPIOZ_6", "GPIOZ_7", "GPIOZ_8", "GPIOZ_9", 790 "GPIOZ_10", "GPIOZ_11", "GPIOZ_12", "GPIOZ_13", "GPIOZ_14", 791 792 "CARD_0", "CARD_1", "CARD_2", "CARD_3", "CARD_4", 793 "CARD_5", "CARD_6", 794 795 "BOOT_0", "BOOT_1", "BOOT_2", "BOOT_3", "BOOT_4", 796 "BOOT_5", "BOOT_6", "BOOT_7", "BOOT_8", "BOOT_9", 797 "BOOT_10", "BOOT_11", "BOOT_12", "BOOT_13", "BOOT_14", 798 "BOOT_15", "BOOT_16", "BOOT_17", "BOOT_18", 799 800 "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", 801 "GPIOAO_4", "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", 802 "GPIOAO_8", "GPIOAO_9", "GPIOAO_10", "GPIOAO_11", 803 "GPIOAO_12", "GPIOAO_13", "GPIO_BSD_EN", "GPIO_TEST_N" 804 }; 805 806 static const char * const sd_a_groups[] = { 807 "sd_d0_a", "sd_d1_a", "sd_d2_a", "sd_d3_a", "sd_clk_a", "sd_cmd_a" 808 }; 809 810 static const char * const sdxc_a_groups[] = { 811 "sdxc_d0_a", "sdxc_d13_a", "sdxc_d47_a", "sdxc_clk_a", "sdxc_cmd_a" 812 }; 813 814 static const char * const pcm_a_groups[] = { 815 "pcm_out_a", "pcm_in_a", "pcm_fs_a", "pcm_clk_a" 816 }; 817 818 static const char * const uart_a_groups[] = { 819 "uart_tx_a0", "uart_rx_a0", "uart_cts_a0", "uart_rts_a0", 820 "uart_tx_a1", "uart_rx_a1", "uart_cts_a1", "uart_rts_a1" 821 }; 822 823 static const char * const uart_b_groups[] = { 824 "uart_tx_b0", "uart_rx_b0", "uart_cts_b0", "uart_rts_b0", 825 "uart_tx_b1", "uart_rx_b1", "uart_cts_b1", "uart_rts_b1" 826 }; 827 828 static const char * const iso7816_groups[] = { 829 "iso7816_det", "iso7816_reset", "iso7816_clk", "iso7816_data" 830 }; 831 832 static const char * const i2c_d_groups[] = { 833 "i2c_sda_d0", "i2c_sck_d0", "i2c_sda_d1", "i2c_sck_d1" 834 }; 835 836 static const char * const xtal_groups[] = { 837 "xtal_32k_out", "xtal_24m_out" 838 }; 839 840 static const char * const uart_c_groups[] = { 841 "uart_tx_c", "uart_rx_c", "uart_cts_c", "uart_rts_c" 842 }; 843 844 static const char * const pcm_b_groups[] = { 845 "pcm_out_b", "pcm_in_b", "pcm_fs_b", "pcm_clk_b" 846 }; 847 848 static const char * const i2c_c_groups[] = { 849 "i2c_sda_c0", "i2c_sck_c0", "i2c_sda_c1", "i2c_sck_c1" 850 }; 851 852 static const char * const dvin_groups[] = { 853 "dvin_rgb", "dvin_vs", "dvin_hs", "dvin_clk", "dvin_de" 854 }; 855 856 static const char * const enc_groups[] = { 857 "enc_0", "enc_1", "enc_2", "enc_3", "enc_4", "enc_5", 858 "enc_6", "enc_7", "enc_8", "enc_9", "enc_10", "enc_11", 859 "enc_12", "enc_13", "enc_14", "enc_15", "enc_16", "enc_17" 860 }; 861 862 static const char * const vga_groups[] = { 863 "vga_vs", "vga_hs" 864 }; 865 866 static const char * const hdmi_groups[] = { 867 "hdmi_hpd", "hdmi_sda", "hdmi_scl", "hdmi_cec" 868 }; 869 870 static const char * const spi_groups[] = { 871 "spi_ss0_0", "spi_miso_0", "spi_mosi_0", "spi_sclk_0", 872 "spi_ss0_1", "spi_ss1_1", "spi_sclk_1", "spi_mosi_1", 873 "spi_miso_1", "spi_ss2_1" 874 }; 875 876 static const char * const ethernet_groups[] = { 877 "eth_tx_clk_50m", "eth_tx_en", "eth_txd1", 878 "eth_txd0", "eth_rx_clk_in", "eth_rx_dv", 879 "eth_rxd1", "eth_rxd0", "eth_mdio", "eth_mdc" 880 }; 881 882 static const char * const i2c_a_groups[] = { 883 "i2c_sda_a0", "i2c_sck_a0", "i2c_sda_a1", "i2c_sck_a1", 884 "i2c_sda_a2", "i2c_sck_a2" 885 }; 886 887 static const char * const i2c_b_groups[] = { 888 "i2c_sda_b", "i2c_sck_b" 889 }; 890 891 static const char * const i2s_groups[] = { 892 "i2s_out_ch45", "i2s_out_ch23_pins", "i2s_out_ch01_pins", 893 "i2s_in_ch01_pins", "i2s_lr_clk_in_pins", "i2s_ao_clk_in_pins", 894 "i2s_am_clk_pins", "i2s_out_ch78_pins" 895 }; 896 897 static const char * const sd_c_groups[] = { 898 "sd_d0_c", "sd_d1_c", "sd_d2_c", "sd_d3_c", 899 "sd_cmd_c", "sd_clk_c" 900 }; 901 902 static const char * const sdxc_c_groups[] = { 903 "sdxc_d0_c", "sdxc_d13_c", "sdxc_d47_c", "sdxc_cmd_c", 904 "sdxc_clk_c" 905 }; 906 907 static const char * const nand_groups[] = { 908 "nand_io", "nand_io_ce0", "nand_io_ce1", 909 "nand_io_rb0", "nand_ale", "nand_cle", 910 "nand_wen_clk", "nand_ren_clk", "nand_dqs", 911 "nand_ce2", "nand_ce3" 912 }; 913 914 static const char * const nor_groups[] = { 915 "nor_d", "nor_q", "nor_c", "nor_cs" 916 }; 917 918 static const char * const pwm_a_groups[] = { 919 "pwm_a_y", "pwm_a_z0", "pwm_a_z7" 920 }; 921 922 static const char * const pwm_b_groups[] = { 923 "pwm_b_x", "pwm_b_z" 924 }; 925 926 static const char * const pwm_c_groups[] = { 927 "pwm_c_dv9", "pwm_c_dv29", "pwm_c_z" 928 }; 929 930 static const char * const pwm_d_groups[] = { 931 "pwm_d" 932 }; 933 934 static const char * const pwm_e_groups[] = { 935 "pwm_e" 936 }; 937 938 static const char * const sd_b_groups[] = { 939 "sd_d1_b", "sd_d0_b", "sd_clk_b", "sd_cmd_b", 940 "sd_d3_b", "sd_d2_b" 941 }; 942 943 static const char * const sdxc_b_groups[] = { 944 "sdxc_d13_b", "sdxc_d0_b", "sdxc_clk_b", "sdxc_cmd_b" 945 }; 946 947 static const char * const spdif_groups[] = { 948 "spdif_in", "spdif_out" 949 }; 950 951 static const char * const uart_ao_groups[] = { 952 "uart_tx_ao_a", "uart_rx_ao_a", "uart_cts_ao_a", "uart_rts_ao_a" 953 }; 954 955 static const char * const remote_groups[] = { 956 "remote_input", "remote_output_ao" 957 }; 958 959 static const char * const i2c_slave_ao_groups[] = { 960 "i2c_slave_sck_ao", "i2c_slave_sda_ao" 961 }; 962 963 static const char * const uart_ao_b_groups[] = { 964 "uart_tx_ao_b0", "uart_rx_ao_b0", "uart_tx_ao_b1", "uart_rx_ao_b1" 965 }; 966 967 static const char * const i2c_mst_ao_groups[] = { 968 "i2c_mst_sck_ao", "i2c_mst_sda_ao" 969 }; 970 971 static const char * const pwm_f_ao_groups[] = { 972 "pwm_f_ao" 973 }; 974 975 static const char * const i2s_ao_groups[] = { 976 "i2s_am_clk_out_ao", "i2s_ao_clk_out_ao", "i2s_lr_clk_out_ao", 977 "i2s_out_ch01_ao" 978 }; 979 980 static const char * const hdmi_cec_ao_groups[] = { 981 "hdmi_cec_ao" 982 }; 983 984 static struct meson_pmx_func meson8_cbus_functions[] = { 985 FUNCTION(gpio), 986 FUNCTION(sd_a), 987 FUNCTION(sdxc_a), 988 FUNCTION(pcm_a), 989 FUNCTION(uart_a), 990 FUNCTION(uart_b), 991 FUNCTION(iso7816), 992 FUNCTION(i2c_d), 993 FUNCTION(xtal), 994 FUNCTION(uart_c), 995 FUNCTION(pcm_b), 996 FUNCTION(i2c_c), 997 FUNCTION(dvin), 998 FUNCTION(enc), 999 FUNCTION(vga), 1000 FUNCTION(hdmi), 1001 FUNCTION(spi), 1002 FUNCTION(ethernet), 1003 FUNCTION(i2c_a), 1004 FUNCTION(i2c_b), 1005 FUNCTION(sd_c), 1006 FUNCTION(sdxc_c), 1007 FUNCTION(nand), 1008 FUNCTION(nor), 1009 FUNCTION(sd_b), 1010 FUNCTION(sdxc_b), 1011 FUNCTION(pwm_a), 1012 FUNCTION(pwm_b), 1013 FUNCTION(pwm_c), 1014 FUNCTION(pwm_d), 1015 FUNCTION(pwm_e), 1016 FUNCTION(i2s), 1017 FUNCTION(spdif), 1018 }; 1019 1020 static struct meson_pmx_func meson8_aobus_functions[] = { 1021 FUNCTION(uart_ao), 1022 FUNCTION(remote), 1023 FUNCTION(i2c_slave_ao), 1024 FUNCTION(uart_ao_b), 1025 FUNCTION(i2c_mst_ao), 1026 FUNCTION(pwm_f_ao), 1027 FUNCTION(i2s_ao), 1028 FUNCTION(hdmi_cec_ao), 1029 }; 1030 1031 static struct meson_bank meson8_cbus_banks[] = { 1032 /* name first last irq pullen pull dir out in */ 1033 BANK("X", GPIOX_0, GPIOX_21, 112, 133, 4, 0, 4, 0, 0, 0, 1, 0, 2, 0), 1034 BANK("Y", GPIOY_0, GPIOY_16, 95, 111, 3, 0, 3, 0, 3, 0, 4, 0, 5, 0), 1035 BANK("DV", GPIODV_0, GPIODV_29, 65, 94, 0, 0, 0, 0, 7, 0, 8, 0, 9, 0), 1036 BANK("H", GPIOH_0, GPIOH_9, 29, 38, 1, 16, 1, 16, 9, 19, 10, 19, 11, 19), 1037 BANK("Z", GPIOZ_0, GPIOZ_14, 14, 28, 1, 0, 1, 0, 3, 17, 4, 17, 5, 17), 1038 BANK("CARD", CARD_0, CARD_6, 58, 64, 2, 20, 2, 20, 0, 22, 1, 22, 2, 22), 1039 BANK("BOOT", BOOT_0, BOOT_18, 39, 57, 2, 0, 2, 0, 9, 0, 10, 0, 11, 0), 1040 }; 1041 1042 static struct meson_bank meson8_aobus_banks[] = { 1043 /* name first last irq pullen pull dir out in */ 1044 BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 1045 }; 1046 1047 struct meson_pinctrl_data meson8_cbus_pinctrl_data = { 1048 .name = "cbus-banks", 1049 .pins = meson8_cbus_pins, 1050 .groups = meson8_cbus_groups, 1051 .funcs = meson8_cbus_functions, 1052 .banks = meson8_cbus_banks, 1053 .num_pins = ARRAY_SIZE(meson8_cbus_pins), 1054 .num_groups = ARRAY_SIZE(meson8_cbus_groups), 1055 .num_funcs = ARRAY_SIZE(meson8_cbus_functions), 1056 .num_banks = ARRAY_SIZE(meson8_cbus_banks), 1057 }; 1058 1059 struct meson_pinctrl_data meson8_aobus_pinctrl_data = { 1060 .name = "ao-bank", 1061 .pins = meson8_aobus_pins, 1062 .groups = meson8_aobus_groups, 1063 .funcs = meson8_aobus_functions, 1064 .banks = meson8_aobus_banks, 1065 .num_pins = ARRAY_SIZE(meson8_aobus_pins), 1066 .num_groups = ARRAY_SIZE(meson8_aobus_groups), 1067 .num_funcs = ARRAY_SIZE(meson8_aobus_functions), 1068 .num_banks = ARRAY_SIZE(meson8_aobus_banks), 1069 }; 1070