Commit 09cfa8ee6aa5c2a126da402af85fbfdcbf9cce06

Authored by Sanchayan Maity
Committed by Stefano Babic
1 parent 60ed286453

colibri_vf: Enable board specific USB initialisation for USB pen gpio

Add IOMUX for the pad used as USB pen. This needs to be driven low for
the Iris and Viola boards where it is pulled up high by default. This is
required for the USB host functionality to work on these boards. Use the
board specific weak initialisation function, to drive the pin low which
would be called on "usb start".

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>

Showing 2 changed files with 26 additions and 0 deletions Side-by-side Diff

arch/arm/include/asm/arch-vf610/iomux-vf610.h
... ... @@ -131,6 +131,7 @@
131 131 VF610_PAD_PTD1__QSPI0_A_CS0 = IOMUX_PAD(0x0140, 0x0140, 1, __NA_, 0, VF610_QSPI_PAD_CTRL),
132 132 VF610_PAD_PTD2__QSPI0_A_DATA3 = IOMUX_PAD(0x0144, 0x0144, 1, __NA_, 0, VF610_QSPI_PAD_CTRL),
133 133 VF610_PAD_PTD3__QSPI0_A_DATA2 = IOMUX_PAD(0x0148, 0x0148, 1, __NA_, 0, VF610_QSPI_PAD_CTRL),
  134 + VF610_PAD_PTD4__GPIO_83 = IOMUX_PAD(0x014C, 0x014C, 0, __NA_, 0, VF610_GPIO_PAD_CTRL),
134 135 VF610_PAD_PTD4__QSPI0_A_DATA1 = IOMUX_PAD(0x014c, 0x014c, 1, __NA_, 0, VF610_QSPI_PAD_CTRL),
135 136 VF610_PAD_PTD5__QSPI0_A_DATA0 = IOMUX_PAD(0x0150, 0x0150, 1, __NA_, 0, VF610_QSPI_PAD_CTRL),
136 137 VF610_PAD_PTD7__QSPI0_B_QSCK = IOMUX_PAD(0x0158, 0x0158, 1, __NA_, 0, VF610_QSPI_PAD_CTRL),
board/toradex/colibri_vf/colibri_vf.c
... ... @@ -20,6 +20,7 @@
20 20 #include <netdev.h>
21 21 #include <i2c.h>
22 22 #include <g_dnl.h>
  23 +#include <asm/gpio.h>
23 24  
24 25 DECLARE_GLOBAL_DATA_PTR;
25 26  
... ... @@ -32,6 +33,12 @@
32 33 #define ENET_PAD_CTRL (PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_HIGH | \
33 34 PAD_CTL_DSE_50ohm | PAD_CTL_OBE_IBE_ENABLE)
34 35  
  36 +#define USB_PEN_GPIO 83
  37 +
  38 +static const iomux_v3_cfg_t usb_pads[] = {
  39 + VF610_PAD_PTD4__GPIO_83,
  40 +};
  41 +
35 42 int dram_init(void)
36 43 {
37 44 static const struct ddr3_jedec_timings timings = {
... ... @@ -464,4 +471,22 @@
464 471  
465 472 return 0;
466 473 }
  474 +
  475 +#ifdef CONFIG_USB_EHCI_VF
  476 +int board_ehci_hcd_init(int port)
  477 +{
  478 + imx_iomux_v3_setup_multiple_pads(usb_pads, ARRAY_SIZE(usb_pads));
  479 +
  480 + switch (port) {
  481 + case 0:
  482 + /* USBC does not have PEN, also configured as USB client only */
  483 + break;
  484 + case 1:
  485 + gpio_request(USB_PEN_GPIO, "usb-pen-gpio");
  486 + gpio_direction_output(USB_PEN_GPIO, 0);
  487 + break;
  488 + }
  489 + return 0;
  490 +}
  491 +#endif