diff options
author | Tim Harvey <tharvey@gateworks.com> | 2017-03-13 08:51:08 -0700 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2017-03-19 17:30:07 +0100 |
commit | f3a8546b8f1b24efbf7a5878ec915d69c5082cf1 (patch) | |
tree | ebc59fb691c9f47ccd56bb23c98d064a370ad45c | |
parent | f938500f2c810b7535aa6d7ff6d70ff32608572e (diff) |
imx: ventana: make SD3_VSELECT board specific
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
-rw-r--r-- | board/gateworks/gw_ventana/common.c | 30 | ||||
-rw-r--r-- | board/gateworks/gw_ventana/common.h | 2 |
2 files changed, 18 insertions, 14 deletions
diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c index a33c112057f..3dc5f88102f 100644 --- a/board/gateworks/gw_ventana/common.c +++ b/board/gateworks/gw_ventana/common.c @@ -143,12 +143,6 @@ void setup_ventana_i2c(void) * Baseboard specific GPIO */ -/* common to add baseboards */ -static iomux_v3_cfg_t const gw_gpio_pads[] = { - /* SD3_VSELECT */ - IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), -}; - /* prototype */ static iomux_v3_cfg_t const gwproto_gpio_pads[] = { /* RS232_EN# */ @@ -196,6 +190,8 @@ static iomux_v3_cfg_t const gw51xx_gpio_pads[] = { }; static iomux_v3_cfg_t const gw52xx_gpio_pads[] = { + /* SD3_VSELECT */ + IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), /* RS232_EN# */ IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), /* MSATA_EN */ @@ -229,6 +225,8 @@ static iomux_v3_cfg_t const gw52xx_gpio_pads[] = { }; static iomux_v3_cfg_t const gw53xx_gpio_pads[] = { + /* SD3_VSELECT */ + IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), /* RS232_EN# */ IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), /* MSATA_EN */ @@ -262,6 +260,8 @@ static iomux_v3_cfg_t const gw53xx_gpio_pads[] = { }; static iomux_v3_cfg_t const gw54xx_gpio_pads[] = { + /* SD3_VSELECT */ + IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), /* RS232_EN# */ IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), /* MSATA_EN */ @@ -338,11 +338,12 @@ static iomux_v3_cfg_t const gw552x_gpio_pads[] = { }; static iomux_v3_cfg_t const gw553x_gpio_pads[] = { + /* SD3_VSELECT */ + IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), /* PANLEDG# */ IOMUX_PADS(PAD_KEY_COL2__GPIO4_IO10 | DIO_PAD_CFG), /* PANLEDR# */ IOMUX_PADS(PAD_KEY_ROW2__GPIO4_IO11 | DIO_PAD_CFG), - /* VID_PWR */ IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20 | DIO_PAD_CFG), /* PCI_RST# */ @@ -629,6 +630,7 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .msata_en = GP_MSATA_SEL, .rs232_en = GP_RS232_EN, .otgpwr_en = IMX_GPIO_NR(3, 22), + .vsel_pin = IMX_GPIO_NR(6, 14), }, /* GW53xx */ @@ -651,6 +653,7 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .msata_en = GP_MSATA_SEL, .rs232_en = GP_RS232_EN, .otgpwr_en = IMX_GPIO_NR(3, 22), + .vsel_pin = IMX_GPIO_NR(6, 14), }, /* GW54xx */ @@ -675,6 +678,7 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .msata_en = GP_MSATA_SEL, .rs232_en = GP_RS232_EN, .otgpwr_en = IMX_GPIO_NR(3, 22), + .vsel_pin = IMX_GPIO_NR(6, 14), }, /* GW551x */ @@ -721,6 +725,7 @@ struct ventana gpio_cfg[GW_UNKNOWN] = { .vidin_en = IMX_GPIO_NR(5, 20), .wdis = IMX_GPIO_NR(7, 12), .otgpwr_en = IMX_GPIO_NR(3, 22), + .vsel_pin = IMX_GPIO_NR(6, 14), }, }; @@ -728,9 +733,6 @@ void setup_iomux_gpio(int board, struct ventana_board_info *info) { int i; - /* iomux common to all Ventana boards */ - SETUP_IOMUX_PADS(gw_gpio_pads); - if (board >= GW_UNKNOWN) return; @@ -827,9 +829,11 @@ void setup_iomux_gpio(int board, struct ventana_board_info *info) } /* sense vselect pin to see if we support uhs-i */ - gpio_request(GP_SD3_VSELECT, "sd3_vselect"); - gpio_direction_input(GP_SD3_VSELECT); - gpio_cfg[board].usd_vsel = !gpio_get_value(GP_SD3_VSELECT); + if (gpio_cfg[board].vsel_pin) { + gpio_request(gpio_cfg[board].vsel_pin, "sd3_vselect"); + gpio_direction_input(gpio_cfg[board].vsel_pin); + gpio_cfg[board].usd_vsel = !gpio_get_value(gpio_cfg[board].vsel_pin); + } } /* setup GPIO pinmux and default configuration per baseboard and env */ diff --git a/board/gateworks/gw_ventana/common.h b/board/gateworks/gw_ventana/common.h index 693923346f2..18909a02b58 100644 --- a/board/gateworks/gw_ventana/common.h +++ b/board/gateworks/gw_ventana/common.h @@ -16,7 +16,6 @@ #define GP_SD3_CD IMX_GPIO_NR(7, 0) #define GP_RS232_EN IMX_GPIO_NR(2, 11) #define GP_MSATA_SEL IMX_GPIO_NR(2, 8) -#define GP_SD3_VSELECT IMX_GPIO_NR(6, 14) #define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ @@ -79,6 +78,7 @@ struct ventana { int msata_en; int rs232_en; int otgpwr_en; + int vsel_pin; /* various features */ bool usd_vsel; }; |