summaryrefslogtreecommitdiff
path: root/board/technexion
diff options
context:
space:
mode:
authorVanessa Maegima <vanessa.maegima@nxp.com>2016-06-13 13:01:38 -0300
committerStefano Babic <sbabic@denx.de>2016-07-12 17:58:50 +0200
commitca103e09960cb09a0501e558bfa9c921fb61d0bc (patch)
tree012ee010efc1617d63e3dfc219f00d8b6690ba35 /board/technexion
parentd0daec670fc3747f99dce69bc508ef2cfc44e769 (diff)
pico-imx6ul: Add USB Host support
Add USB host support. Tested by connecting a USB pen drive: => usb start starting USB... USB0: Port not available. USB1: USB EHCI 1.00 scanning bus 1 for devices... 2 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found Signed-off-by: Vanessa Maegima <vanessa.maegima@nxp.com> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Diffstat (limited to 'board/technexion')
-rw-r--r--board/technexion/pico-imx6ul/pico-imx6ul.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/board/technexion/pico-imx6ul/pico-imx6ul.c b/board/technexion/pico-imx6ul/pico-imx6ul.c
index fc746ec965..b0b8f054c1 100644
--- a/board/technexion/pico-imx6ul/pico-imx6ul.c
+++ b/board/technexion/pico-imx6ul/pico-imx6ul.c
@@ -142,6 +142,9 @@ static iomux_v3_cfg_t const usdhc1_pads[] = {
MX6_PAD_NAND_CLE__USDHC1_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
};
+#define USB_OTHERREGS_OFFSET 0x800
+#define UCTRL_PWR_POL (1 << 9)
+
static iomux_v3_cfg_t const usb_otg_pad[] = {
MX6_PAD_GPIO1_IO00__ANATOP_OTG1_ID | MUX_PAD_CTRL(OTG_ID_PAD_CTRL),
};
@@ -181,7 +184,26 @@ int board_early_init_f(void)
int board_usb_phy_mode(int port)
{
- return USB_INIT_DEVICE;
+ if (port == 1)
+ return USB_INIT_HOST;
+ else
+ return USB_INIT_DEVICE;
+}
+
+int board_ehci_hcd_init(int port)
+{
+ u32 *usbnc_usb_ctrl;
+
+ if (port > 1)
+ return -EINVAL;
+
+ usbnc_usb_ctrl = (u32 *)(USB_BASE_ADDR + USB_OTHERREGS_OFFSET +
+ port * 4);
+
+ /* Set Power polarity */
+ setbits_le32(usbnc_usb_ctrl, UCTRL_PWR_POL);
+
+ return 0;
}
int board_init(void)