Lines Matching +full:board +full:- +full:2
1 // SPDX-License-Identifier: GPL-2.0+
9 #include <asm/arch/mx6-pins.h>
12 #include <asm/mach-imx/mxc_i2c.h>
46 /* 4-bit microSD on SD2 */
57 /* 8-bit eMMC on SD2/NAND */
560 2
587 2
614 2
641 2
645 IMX_GPIO_NR(2, 9),
651 IMX_GPIO_NR(2, 10),
662 2
683 2
746 2
773 2
857 2
873 IMX_GPIO_NR(2, 0),
879 IMX_GPIO_NR(2, 1),
885 IMX_GPIO_NR(2, 2),
891 IMX_GPIO_NR(2, 3),
897 IMX_GPIO_NR(2, 4),
903 IMX_GPIO_NR(2, 5),
909 IMX_GPIO_NR(2, 6),
915 IMX_GPIO_NR(2, 7),
932 2
949 * Board Specific GPIO
955 .num_pads = ARRAY_SIZE(gw54xx_gpio_pads)/2,
976 .num_pads = ARRAY_SIZE(gw51xx_gpio_pads)/2,
984 .mezz_pwren = IMX_GPIO_NR(2, 19),
985 .mezz_irq = IMX_GPIO_NR(2, 18),
986 .gps_shdn = IMX_GPIO_NR(1, 2),
996 .num_pads = ARRAY_SIZE(gw52xx_gpio_pads)/2,
1005 .mezz_pwren = IMX_GPIO_NR(2, 19),
1006 .mezz_irq = IMX_GPIO_NR(2, 18),
1009 .usb_sel = IMX_GPIO_NR(1, 2),
1022 .num_pads = ARRAY_SIZE(gw53xx_gpio_pads)/2,
1031 .mezz_pwren = IMX_GPIO_NR(2, 19),
1032 .mezz_irq = IMX_GPIO_NR(2, 18),
1047 .num_pads = ARRAY_SIZE(gw54xx_gpio_pads)/2,
1056 .mezz_pwren = IMX_GPIO_NR(2, 19),
1057 .mezz_irq = IMX_GPIO_NR(2, 18),
1074 .num_pads = ARRAY_SIZE(gw551x_gpio_pads)/2,
1088 .num_pads = ARRAY_SIZE(gw552x_gpio_pads)/2,
1106 .num_pads = ARRAY_SIZE(gw553x_gpio_pads)/2,
1125 .num_pads = ARRAY_SIZE(gw560x_gpio_pads)/2,
1134 .mezz_pwren = IMX_GPIO_NR(2, 19),
1135 .mezz_irq = IMX_GPIO_NR(2, 18),
1146 .num_pads = ARRAY_SIZE(gw5901_gpio_pads)/2,
1158 .num_pads = ARRAY_SIZE(gw5902_gpio_pads)/2,
1172 .num_pads = ARRAY_SIZE(gw5903_gpio_pads)/2,
1185 .num_pads = ARRAY_SIZE(gw5904_gpio_pads)/2,
1194 .mezz_pwren = IMX_GPIO_NR(2, 19),
1195 .mezz_irq = IMX_GPIO_NR(2, 18),
1202 .num_pads = ARRAY_SIZE(gw5905_gpio_pads)/2,
1213 .num_pads = ARRAY_SIZE(gw552x_gpio_pads)/2,
1231 .num_pads = ARRAY_SIZE(gw51xx_gpio_pads)/2,
1246 .num_pads = ARRAY_SIZE(gw53xx_gpio_pads)/2,
1255 .mezz_pwren = IMX_GPIO_NR(2, 19),
1256 .mezz_irq = IMX_GPIO_NR(2, 18),
1267 .num_pads = ARRAY_SIZE(gw5904_gpio_pads)/2,
1276 .mezz_pwren = IMX_GPIO_NR(2, 19),
1277 .mezz_irq = IMX_GPIO_NR(2, 18),
1288 void setup_iomux_gpio(int board, struct ventana_board_info *info) in setup_iomux_gpio() argument
1292 if (board >= GW_UNKNOWN) in setup_iomux_gpio()
1295 /* board specific iomux */ in setup_iomux_gpio()
1296 imx_iomux_v3_setup_multiple_pads(gpio_cfg[board].gpio_pads, in setup_iomux_gpio()
1297 gpio_cfg[board].num_pads); in setup_iomux_gpio()
1300 if (gpio_cfg[board].rs232_en) { in setup_iomux_gpio()
1301 gpio_request(gpio_cfg[board].rs232_en, "rs232_en#"); in setup_iomux_gpio()
1302 gpio_direction_output(gpio_cfg[board].rs232_en, 0); in setup_iomux_gpio()
1306 if (board == GW52xx && info->model[4] == '2') in setup_iomux_gpio()
1307 gpio_cfg[board].pcie_rst = IMX_GPIO_NR(3, 23); in setup_iomux_gpio()
1310 gpio_request(gpio_cfg[board].pcie_rst, "pci_rst#"); in setup_iomux_gpio()
1311 gpio_direction_output(gpio_cfg[board].pcie_rst, 0); in setup_iomux_gpio()
1313 /* turn off (active-high) user LED's */ in setup_iomux_gpio()
1314 for (i = 0; i < ARRAY_SIZE(gpio_cfg[board].leds); i++) { in setup_iomux_gpio()
1316 if (gpio_cfg[board].leds[i]) { in setup_iomux_gpio()
1318 gpio_request(gpio_cfg[board].leds[i], name); in setup_iomux_gpio()
1319 gpio_direction_output(gpio_cfg[board].leds[i], 1); in setup_iomux_gpio()
1323 /* MSATA Enable - default to PCI */ in setup_iomux_gpio()
1324 if (gpio_cfg[board].msata_en) { in setup_iomux_gpio()
1325 gpio_request(gpio_cfg[board].msata_en, "msata_en"); in setup_iomux_gpio()
1326 gpio_direction_output(gpio_cfg[board].msata_en, 0); in setup_iomux_gpio()
1330 if (gpio_cfg[board].mezz_pwren) { in setup_iomux_gpio()
1331 gpio_request(gpio_cfg[board].mezz_pwren, "mezz_pwr"); in setup_iomux_gpio()
1332 gpio_direction_output(gpio_cfg[board].mezz_pwren, 0); in setup_iomux_gpio()
1334 if (gpio_cfg[board].mezz_irq) { in setup_iomux_gpio()
1335 gpio_request(gpio_cfg[board].mezz_irq, "mezz_irq#"); in setup_iomux_gpio()
1336 gpio_direction_input(gpio_cfg[board].mezz_irq); in setup_iomux_gpio()
1340 if (gpio_cfg[board].rs485en) { in setup_iomux_gpio()
1341 gpio_request(gpio_cfg[board].rs485en, "rs485_en"); in setup_iomux_gpio()
1342 gpio_direction_output(gpio_cfg[board].rs485en, 0); in setup_iomux_gpio()
1346 if (gpio_cfg[board].gps_shdn) { in setup_iomux_gpio()
1347 gpio_request(gpio_cfg[board].gps_shdn, "gps_shdn"); in setup_iomux_gpio()
1348 gpio_direction_output(gpio_cfg[board].gps_shdn, 1); in setup_iomux_gpio()
1352 if (gpio_cfg[board].vidin_en) { in setup_iomux_gpio()
1353 gpio_request(gpio_cfg[board].vidin_en, "anavidin_en"); in setup_iomux_gpio()
1354 gpio_direction_output(gpio_cfg[board].vidin_en, 1); in setup_iomux_gpio()
1358 if (gpio_cfg[board].dioi2c_en) { in setup_iomux_gpio()
1359 gpio_request(gpio_cfg[board].dioi2c_en, "dioi2c_dis#"); in setup_iomux_gpio()
1360 gpio_direction_output(gpio_cfg[board].dioi2c_en, 0); in setup_iomux_gpio()
1363 /* PCICK_SSON: disable spread-spectrum clock */ in setup_iomux_gpio()
1364 if (gpio_cfg[board].pcie_sson) { in setup_iomux_gpio()
1365 gpio_request(gpio_cfg[board].pcie_sson, "pci_sson"); in setup_iomux_gpio()
1366 gpio_direction_output(gpio_cfg[board].pcie_sson, 0); in setup_iomux_gpio()
1370 if (gpio_cfg[board].usb_sel) { in setup_iomux_gpio()
1371 gpio_request(gpio_cfg[board].usb_sel, "usb_pcisel"); in setup_iomux_gpio()
1372 gpio_direction_output(gpio_cfg[board].usb_sel, 0); in setup_iomux_gpio()
1376 if (gpio_cfg[board].wdis) { in setup_iomux_gpio()
1377 gpio_request(gpio_cfg[board].wdis, "wlan_dis"); in setup_iomux_gpio()
1378 gpio_direction_output(gpio_cfg[board].wdis, 1); in setup_iomux_gpio()
1382 if (gpio_cfg[board].otgpwr_en) { in setup_iomux_gpio()
1383 gpio_request(gpio_cfg[board].otgpwr_en, "usbotg_pwr"); in setup_iomux_gpio()
1384 gpio_direction_output(gpio_cfg[board].otgpwr_en, 0); in setup_iomux_gpio()
1387 /* sense vselect pin to see if we support uhs-i */ in setup_iomux_gpio()
1388 if (gpio_cfg[board].vsel_pin) { in setup_iomux_gpio()
1389 gpio_request(gpio_cfg[board].vsel_pin, "sd3_vselect"); in setup_iomux_gpio()
1390 gpio_direction_input(gpio_cfg[board].vsel_pin); in setup_iomux_gpio()
1391 gpio_cfg[board].usd_vsel = !gpio_get_value(gpio_cfg[board].vsel_pin); in setup_iomux_gpio()
1395 if (gpio_cfg[board].mmc_cd) { in setup_iomux_gpio()
1396 gpio_request(gpio_cfg[board].mmc_cd, "sd_cd"); in setup_iomux_gpio()
1397 gpio_direction_input(gpio_cfg[board].mmc_cd); in setup_iomux_gpio()
1400 /* Anything else board specific */ in setup_iomux_gpio()
1401 switch(board) { in setup_iomux_gpio()
1407 SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 2), "can_stby", 0); in setup_iomux_gpio()
1410 SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 2), "can1_stby", 0); in setup_iomux_gpio()
1415 gpio_request(IMX_GPIO_NR(3, 31) , "usbh1-ehci_pwr"); in setup_iomux_gpio()
1417 gpio_request(IMX_GPIO_NR(4, 15) , "usbh2-otg_pwr"); in setup_iomux_gpio()
1452 SETUP_GPIO_OUTPUT(IMX_GPIO_NR(2, 3), "emmy_pdwn#", 1); in setup_iomux_gpio()
1473 void setup_board_gpio(int board, struct ventana_board_info *info) in setup_board_gpio() argument
1481 if (board >= GW_UNKNOWN) in setup_board_gpio()
1485 if (gpio_cfg[board].rs232_en) { in setup_board_gpio()
1486 gpio_direction_output(gpio_cfg[board].rs232_en, in setup_board_gpio()
1491 if (gpio_cfg[board].msata_en && is_cpu_type(MXC_CPU_MX6Q)) { in setup_board_gpio()
1497 if (gpio_cfg[board].usb_sel) { in setup_board_gpio()
1498 gpio_direction_output(gpio_cfg[board].usb_sel, in setup_board_gpio()
1506 for (i = 0; i < gpio_cfg[board].dio_num; i++) { in setup_board_gpio()
1507 struct dio_cfg *cfg = &gpio_cfg[board].dio_cfg[i]; in setup_board_gpio()
1511 if (!cfg->gpio_padmux[0] && !cfg->gpio_padmux[1]) in setup_board_gpio()
1523 printf("DIO%d: GPIO%d_IO%02d (gpio-%d)\n", i, in setup_board_gpio()
1524 (cfg->gpio_param/32)+1, in setup_board_gpio()
1525 cfg->gpio_param%32, in setup_board_gpio()
1526 cfg->gpio_param); in setup_board_gpio()
1528 imx_iomux_v3_setup_pad(cfg->gpio_padmux[cputype] | in setup_board_gpio()
1530 gpio_requestf(cfg->gpio_param, "dio%d", i); in setup_board_gpio()
1531 gpio_direction_input(cfg->gpio_param); in setup_board_gpio()
1533 cfg->pwm_padmux) { in setup_board_gpio()
1534 if (!cfg->pwm_param) { in setup_board_gpio()
1540 printf("DIO%d: pwm%d\n", i, cfg->pwm_param); in setup_board_gpio()
1541 imx_iomux_v3_setup_pad(cfg->pwm_padmux[cputype] | in setup_board_gpio()
1547 if (gpio_cfg[board].msata_en && is_cpu_type(MXC_CPU_MX6Q)) { in setup_board_gpio()
1551 if (gpio_cfg[board].rs232_en) { in setup_board_gpio()
1558 /* setup board specific PMIC */
1563 int board = read_eeprom(CONFIG_I2C_GSC, &ventana_info); in setup_pmic() local
1601 * set board-specific scalar for max CPU frequency in setup_pmic()
1609 switch (board) { in setup_pmic()
1660 static struct fsl_esdhc_cfg usdhc_cfg[2];
1680 /* usdhc2: 8-bit eMMC */ in board_mmc_init()
1688 /* usdhc3: 4-bit microSD */ in board_mmc_init()
1695 /* usdhc3: 8-bit eMMC */ in board_mmc_init()
1703 /* usdhc2: 4-bit microSD */ in board_mmc_init()
1720 return -1; in board_mmc_init()
1727 struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; in board_mmc_getcd()
1728 int board = read_eeprom(CONFIG_I2C_GSC, &ventana_info); in board_mmc_getcd() local
1729 int gpio = gpio_cfg[board].mmc_cd; in board_mmc_getcd()
1732 switch (board) { in board_mmc_getcd()
1735 if (cfg->esdhc_base == USDHC2_BASE_ADDR) in board_mmc_getcd()
1743 if (cfg->esdhc_base == USDHC3_BASE_ADDR) in board_mmc_getcd()
1753 return -1; in board_mmc_getcd()