Commit fdcf0753 authored by Thomas Schäfer's avatar Thomas Schäfer
Browse files

s1920: add USB hub reset



- The onboard USB hub needs a reset cycle of 3ms duration at least.
  Toggle the USB_HUB_RST# (GPIO3_IO04) line for 10ms.
Signed-off-by: Thomas Schäfer's avatarThomas Schaefer <thomas.schaefer@kontron.com>
parent 91b2c575
......@@ -293,8 +293,6 @@ static int setup_typec(void)
#if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_IMX8M)
#define USBHUB_RESET IMX_GPIO_NR(3, 4)
static iomux_v3_cfg_t usbhub_rst[] = {
IMX8MQ_PAD_NAND_CE3_B__GPIO3_IO4 | MUX_PAD_CTRL(NO_PAD_CTRL),
};
......@@ -303,7 +301,6 @@ int board_usb_init(int index, enum usb_init_type init)
{
int ret = 0;
imx_iomux_v3_setup_multiple_pads(usbhub_rst, ARRAY_SIZE(usbhub_rst));
gpio_request(USBHUB_RESET, "usbhub_reset");
imx8m_usb_power(index, true);
if (index == 0 && init == USB_INIT_DEVICE) {
......@@ -441,6 +438,8 @@ static iomux_v3_cfg_t const gpio_pads[] = {
IMX8MQ_PAD_GPIO1_IO10__GPIO1_IO10 | MUX_PAD_CTRL(NO_PAD_CTRL),
};
#define USBHUB_RESET IMX_GPIO_NR(3, 4)
int misc_init_r(void)
{
#ifdef CONFIG_EMB_EEP_SPI
......@@ -477,6 +476,15 @@ int misc_init_r(void)
gpio_request(IMX_GPIO_NR(1, 10), "GBE0_PWDN#");
gpio_direction_output(IMX_GPIO_NR(1,10), 1); /*GBE0_PWDN*/
/*
* reset USB hub as required by datasheet
* (3ms minimum reset duration, 10ms implemented)
*/
gpio_request(USBHUB_RESET, "usbhub_reset");
gpio_direction_output(USBHUB_RESET, 0);
udelay(10000);
gpio_direction_output(USBHUB_RESET, 1);
return 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment