diff options
author | Peng Fan <Peng.Fan@freescale.com> | 2014-11-10 08:50:41 +0800 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2014-11-14 20:56:58 +0100 |
commit | 3b9c1a5dc09e5ee773f5a4fe9280e568b64b7779 (patch) | |
tree | 5cb0405f797d081b6d0ba54ed142f6e9e7d55b18 /board/freescale/mx6slevk | |
parent | 229dbba9b1a24d8f371f18fa8ff13a4cca864f06 (diff) | |
download | u-boot-imx-3b9c1a5dc09e5ee773f5a4fe9280e568b64b7779.zip u-boot-imx-3b9c1a5dc09e5ee773f5a4fe9280e568b64b7779.tar.gz u-boot-imx-3b9c1a5dc09e5ee773f5a4fe9280e568b64b7779.tar.bz2 |
imx:mx6slevk add board level support for usb
Add pinmux settings, implement board_ehci_hcd_init, board_usb_phy_mode
There are two usb port on mx6slevk board:
1. otg port
2. host port
The following are the connection between usb controller and board usb
interface, host port has not ID pin set:
otg1 core <---> board otg port
otg2 core <---> board host port
In order to make host port work, board_usb_phy_mode return USB_INIT_HOST
to let host port work in host mode.
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Signed-off-by: Ye Li <B37916@freescale.com>
Diffstat (limited to 'board/freescale/mx6slevk')
-rw-r--r-- | board/freescale/mx6slevk/mx6slevk.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index e76c343..3ae2c46 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -20,6 +20,8 @@ #include <fsl_esdhc.h> #include <mmc.h> #include <netdev.h> +#include <usb.h> +#include <usb/ehci-fsl.h> DECLARE_GLOBAL_DATA_PTR; @@ -243,6 +245,48 @@ static int setup_fec(void) } #endif +#ifdef CONFIG_USB_EHCI_MX6 +#define USB_OTHERREGS_OFFSET 0x800 +#define UCTRL_PWR_POL (1 << 9) + +static iomux_v3_cfg_t const usb_otg_pads[] = { + /* OTG1 */ + MX6_PAD_KEY_COL4__USB_USBOTG1_PWR | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_EPDC_PWRCOM__ANATOP_USBOTG1_ID | MUX_PAD_CTRL(NO_PAD_CTRL), + /* OTG2 */ + MX6_PAD_KEY_COL5__USB_USBOTG2_PWR | MUX_PAD_CTRL(NO_PAD_CTRL) +}; + +static void setup_usb(void) +{ + imx_iomux_v3_setup_multiple_pads(usb_otg_pads, + ARRAY_SIZE(usb_otg_pads)); +} + +int board_usb_phy_mode(int port) +{ + if (port == 1) + return USB_INIT_HOST; + else + return usb_phy_mode(port); +} + +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; +} +#endif int board_early_init_f(void) { @@ -261,6 +305,11 @@ int board_init(void) #ifdef CONFIG_FEC_MXC setup_fec(); #endif + +#ifdef CONFIG_USB_EHCI_MX6 + setup_usb(); +#endif + return 0; } |