imx: ventana: enable dm support for USB

Enable dm support for USB (which also requires dm support for fixed
regulators used for vbus enable) and remove usb iomux which is no
longer needed.

We can remove the handling of otgpwr_en gpio as this is defined in
dt as usbotg vbus-supply but we need to keep the handling of
USB_HUB_RST# for boards that have a USB HUB as that isn't defined in
the dt's currently.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
This commit is contained in:
Tim Harvey 2021-03-01 14:33:34 -08:00 committed by Stefano Babic
parent ee025c13b2
commit 72c46327f0
7 changed files with 13 additions and 37 deletions

View File

@ -970,7 +970,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
.rs485en = IMX_GPIO_NR(3, 24), .rs485en = IMX_GPIO_NR(3, 24),
.dioi2c_en = IMX_GPIO_NR(4, 5), .dioi2c_en = IMX_GPIO_NR(4, 5),
.pcie_sson = IMX_GPIO_NR(1, 20), .pcie_sson = IMX_GPIO_NR(1, 20),
.otgpwr_en = IMX_GPIO_NR(3, 22),
.mmc_cd = IMX_GPIO_NR(7, 0), .mmc_cd = IMX_GPIO_NR(7, 0),
}, },
@ -990,7 +989,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
.gps_shdn = IMX_GPIO_NR(1, 2), .gps_shdn = IMX_GPIO_NR(1, 2),
.vidin_en = IMX_GPIO_NR(5, 20), .vidin_en = IMX_GPIO_NR(5, 20),
.wdis = IMX_GPIO_NR(7, 12), .wdis = IMX_GPIO_NR(7, 12),
.otgpwr_en = IMX_GPIO_NR(3, 22),
.nand = true, .nand = true,
}, },
@ -1014,7 +1012,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
.wdis = IMX_GPIO_NR(7, 12), .wdis = IMX_GPIO_NR(7, 12),
.msata_en = GP_MSATA_SEL, .msata_en = GP_MSATA_SEL,
.rs232_en = GP_RS232_EN, .rs232_en = GP_RS232_EN,
.otgpwr_en = IMX_GPIO_NR(3, 22),
.vsel_pin = IMX_GPIO_NR(6, 14), .vsel_pin = IMX_GPIO_NR(6, 14),
.mmc_cd = IMX_GPIO_NR(7, 0), .mmc_cd = IMX_GPIO_NR(7, 0),
.nand = true, .nand = true,
@ -1039,7 +1036,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
.wdis = IMX_GPIO_NR(7, 12), .wdis = IMX_GPIO_NR(7, 12),
.msata_en = GP_MSATA_SEL, .msata_en = GP_MSATA_SEL,
.rs232_en = GP_RS232_EN, .rs232_en = GP_RS232_EN,
.otgpwr_en = IMX_GPIO_NR(3, 22),
.vsel_pin = IMX_GPIO_NR(6, 14), .vsel_pin = IMX_GPIO_NR(6, 14),
.mmc_cd = IMX_GPIO_NR(7, 0), .mmc_cd = IMX_GPIO_NR(7, 0),
.nand = true, .nand = true,
@ -1066,7 +1062,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
.wdis = IMX_GPIO_NR(5, 17), .wdis = IMX_GPIO_NR(5, 17),
.msata_en = GP_MSATA_SEL, .msata_en = GP_MSATA_SEL,
.rs232_en = GP_RS232_EN, .rs232_en = GP_RS232_EN,
.otgpwr_en = IMX_GPIO_NR(3, 22),
.vsel_pin = IMX_GPIO_NR(6, 14), .vsel_pin = IMX_GPIO_NR(6, 14),
.mmc_cd = IMX_GPIO_NR(7, 0), .mmc_cd = IMX_GPIO_NR(7, 0),
.nand = true, .nand = true,
@ -1117,7 +1112,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
.pcie_rst = IMX_GPIO_NR(1, 0), .pcie_rst = IMX_GPIO_NR(1, 0),
.vidin_en = IMX_GPIO_NR(5, 20), .vidin_en = IMX_GPIO_NR(5, 20),
.wdis = IMX_GPIO_NR(7, 12), .wdis = IMX_GPIO_NR(7, 12),
.otgpwr_en = IMX_GPIO_NR(3, 22),
.vsel_pin = IMX_GPIO_NR(6, 14), .vsel_pin = IMX_GPIO_NR(6, 14),
.mmc_cd = IMX_GPIO_NR(7, 0), .mmc_cd = IMX_GPIO_NR(7, 0),
.nand = true, .nand = true,
@ -1140,7 +1134,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
.rs232_en = GP_RS232_EN, .rs232_en = GP_RS232_EN,
.vidin_en = IMX_GPIO_NR(3, 31), .vidin_en = IMX_GPIO_NR(3, 31),
.wdis = IMX_GPIO_NR(7, 12), .wdis = IMX_GPIO_NR(7, 12),
.otgpwr_en = IMX_GPIO_NR(4, 15),
.mmc_cd = IMX_GPIO_NR(7, 0), .mmc_cd = IMX_GPIO_NR(7, 0),
}, },
@ -1166,7 +1159,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
}, },
.pcie_rst = IMX_GPIO_NR(1, 0), .pcie_rst = IMX_GPIO_NR(1, 0),
.rs232_en = GP_RS232_EN, .rs232_en = GP_RS232_EN,
.otgpwr_en = IMX_GPIO_NR(3, 23),
.nand = true, .nand = true,
}, },
@ -1179,7 +1171,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
.leds = { .leds = {
IMX_GPIO_NR(6, 14), IMX_GPIO_NR(6, 14),
}, },
.otgpwr_en = IMX_GPIO_NR(4, 15),
.mmc_cd = IMX_GPIO_NR(6, 11), .mmc_cd = IMX_GPIO_NR(6, 11),
}, },
@ -1197,7 +1188,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
.pcie_rst = IMX_GPIO_NR(1, 0), .pcie_rst = IMX_GPIO_NR(1, 0),
.mezz_pwren = IMX_GPIO_NR(2, 19), .mezz_pwren = IMX_GPIO_NR(2, 19),
.mezz_irq = IMX_GPIO_NR(2, 18), .mezz_irq = IMX_GPIO_NR(2, 18),
.otgpwr_en = IMX_GPIO_NR(3, 22),
}, },
/* GW5905 */ /* GW5905 */
@ -1279,7 +1269,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
.pcie_rst = IMX_GPIO_NR(1, 0), .pcie_rst = IMX_GPIO_NR(1, 0),
.mezz_pwren = IMX_GPIO_NR(2, 19), .mezz_pwren = IMX_GPIO_NR(2, 19),
.mezz_irq = IMX_GPIO_NR(2, 18), .mezz_irq = IMX_GPIO_NR(2, 18),
.otgpwr_en = IMX_GPIO_NR(3, 22),
}, },
}; };
@ -1382,12 +1371,6 @@ void setup_iomux_gpio(int board, struct ventana_board_info *info)
gpio_direction_output(gpio_cfg[board].wdis, 1); gpio_direction_output(gpio_cfg[board].wdis, 1);
} }
/* OTG power off */
if (gpio_cfg[board].otgpwr_en) {
gpio_request(gpio_cfg[board].otgpwr_en, "usbotg_pwr");
gpio_direction_output(gpio_cfg[board].otgpwr_en, 0);
}
/* sense vselect pin to see if we support uhs-i */ /* sense vselect pin to see if we support uhs-i */
if (gpio_cfg[board].vsel_pin) { if (gpio_cfg[board].vsel_pin) {
gpio_request(gpio_cfg[board].vsel_pin, "sd3_vselect"); gpio_request(gpio_cfg[board].vsel_pin, "sd3_vselect");

View File

@ -75,7 +75,6 @@ struct ventana {
int wdis; int wdis;
int msata_en; int msata_en;
int rs232_en; int rs232_en;
int otgpwr_en;
int vsel_pin; int vsel_pin;
int mmc_cd; int mmc_cd;
/* various features */ /* various features */

View File

@ -142,18 +142,14 @@ static void setup_iomux_enet(int gpio)
} }
#ifdef CONFIG_USB_EHCI_MX6 #ifdef CONFIG_USB_EHCI_MX6
static iomux_v3_cfg_t const usb_pads[] = { /* toggle USB_HUB_RST# for boards that have it; it is not defined in dt */
IOMUX_PADS(PAD_GPIO_1__USB_OTG_ID | DIO_PAD_CFG),
IOMUX_PADS(PAD_KEY_COL4__USB_OTG_OC | DIO_PAD_CFG),
/* OTG PWR */
IOMUX_PADS(PAD_EIM_D22__GPIO3_IO22 | DIO_PAD_CFG),
};
int board_ehci_hcd_init(int port) int board_ehci_hcd_init(int port)
{ {
int gpio; int gpio;
SETUP_IOMUX_PADS(usb_pads); /* USB HUB is always on P1 */
if (port == 0)
return 0;
/* Reset USB HUB */ /* Reset USB HUB */
switch (board_type) { switch (board_type) {
@ -178,16 +174,6 @@ int board_ehci_hcd_init(int port)
return 0; return 0;
} }
int board_ehci_power(int port, int on)
{
/* enable OTG VBUS */
if (!port && board_type < GW_UNKNOWN) {
if (gpio_cfg[board_type].otgpwr_en)
gpio_set_value(gpio_cfg[board_type].otgpwr_en, on);
}
return 0;
}
#endif /* CONFIG_USB_EHCI_MX6 */ #endif /* CONFIG_USB_EHCI_MX6 */
#ifdef CONFIG_MXC_SPI #ifdef CONFIG_MXC_SPI

View File

@ -89,12 +89,15 @@ CONFIG_MII=y
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_PINCTRL=y CONFIG_PINCTRL=y
CONFIG_PINCTRL_IMX6=y CONFIG_PINCTRL_IMX6=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_CONS_INDEX=2 CONFIG_CONS_INDEX=2
CONFIG_DM_SERIAL=y CONFIG_DM_SERIAL=y
CONFIG_MXC_UART=y CONFIG_MXC_UART=y
CONFIG_DM_THERMAL=y CONFIG_DM_THERMAL=y
CONFIG_IMX_THERMAL=y CONFIG_IMX_THERMAL=y
CONFIG_USB=y CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE=y
CONFIG_USB_KEYBOARD=y CONFIG_USB_KEYBOARD=y
CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y

View File

@ -93,12 +93,15 @@ CONFIG_MII=y
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_PINCTRL=y CONFIG_PINCTRL=y
CONFIG_PINCTRL_IMX6=y CONFIG_PINCTRL_IMX6=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_CONS_INDEX=2 CONFIG_CONS_INDEX=2
CONFIG_DM_SERIAL=y CONFIG_DM_SERIAL=y
CONFIG_MXC_UART=y CONFIG_MXC_UART=y
CONFIG_DM_THERMAL=y CONFIG_DM_THERMAL=y
CONFIG_IMX_THERMAL=y CONFIG_IMX_THERMAL=y
CONFIG_USB=y CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE=y
CONFIG_USB_KEYBOARD=y CONFIG_USB_KEYBOARD=y
CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y

View File

@ -93,12 +93,15 @@ CONFIG_MII=y
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_PINCTRL=y CONFIG_PINCTRL=y
CONFIG_PINCTRL_IMX6=y CONFIG_PINCTRL_IMX6=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_CONS_INDEX=2 CONFIG_CONS_INDEX=2
CONFIG_DM_SERIAL=y CONFIG_DM_SERIAL=y
CONFIG_MXC_UART=y CONFIG_MXC_UART=y
CONFIG_DM_THERMAL=y CONFIG_DM_THERMAL=y
CONFIG_IMX_THERMAL=y CONFIG_IMX_THERMAL=y
CONFIG_USB=y CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE=y
CONFIG_USB_KEYBOARD=y CONFIG_USB_KEYBOARD=y
CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y

View File

@ -100,7 +100,6 @@
#define CONFIG_ARP_TIMEOUT 200UL #define CONFIG_ARP_TIMEOUT 200UL
/* USB Configs */ /* USB Configs */
#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */ #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
#define CONFIG_MXC_USB_FLAGS 0 #define CONFIG_MXC_USB_FLAGS 0