diff options
author | Wolfgang Denk <wd@denx.de> | 2011-12-12 07:58:58 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-12-12 07:58:58 +0100 |
commit | b2eb7d9bc6032e16b7dd898f7c0ea654f63b61db (patch) | |
tree | b8b649483183d93dedfcb5512d0b9720aa91644f /board/freescale/mx51evk/mx51evk.c | |
parent | 4f1a2cd1637027f31de7796aedb1fa5fc0ec0f97 (diff) | |
parent | d98d8bc1c913a5a1aea6b17365f90c430d1fc95a (diff) | |
download | u-boot-imx-b2eb7d9bc6032e16b7dd898f7c0ea654f63b61db.zip u-boot-imx-b2eb7d9bc6032e16b7dd898f7c0ea654f63b61db.tar.gz u-boot-imx-b2eb7d9bc6032e16b7dd898f7c0ea654f63b61db.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-usb
* 'master' of git://git.denx.de/u-boot-usb:
USB: efikamx: Enable USB on EfikaMX and EfikaSB
USB: Add generic ULPI layer and a viewport
USB: EHCI: Allow EHCI post-powerup configuration in board files
USB: mx51evk: add end enable USB host support on port 1
USB: mx53loco: add end enable USB host support on port 1
USB: MX5: Add MX5 usb post-init callback
USB: MX5: Abstract out mx51 USB pixmux configuration
USB: MX5: add generic USB EHCI support for mx51 and mx53
USB: MX5: add helper functions to enable USB clocks
usb:gadget:s5p Enable the USB Gadget framework at GONI
usb:gadget:s5p USB Device Controller (UDC) implementation
ehci: speed up initialization
usb: add help for missing start subcommand
cosmetic: remove excess whitespace from usb command help
usb: align usb_endpoint_descriptor to 16-bit boundary
usbtty: init endpoints prior to startup events
pxa: convert pxa27x_udc to use read and write functions
pxa: activate the first usb host port on pxa27x by default
pxa: fix usb host register mismatch
ehci-fsl: correct size of ehci caplength
USB: Add usb_event_poll() to get keyboards working with EHCI
USB: gadaget: add Marvell controller support
USB: Fix complaints about strict aliasing in OHCI-HCD
USB: Drop dead code from usb_kbd.c
USB: Rework usb_kbd.c
USB: Add functionality to poll the USB keyboard via control EP
Diffstat (limited to 'board/freescale/mx51evk/mx51evk.c')
-rw-r--r-- | board/freescale/mx51evk/mx51evk.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index e5b0929..13c5941 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -35,6 +35,7 @@ #include <pmic.h> #include <fsl_pmic.h> #include <mc13892.h> +#include <usb/ehci-fsl.h> DECLARE_GLOBAL_DATA_PTR; @@ -172,6 +173,64 @@ static void setup_iomux_spi(void) } #endif +#ifdef CONFIG_USB_EHCI_MX5 +#define MX51EVK_USBH1_HUB_RST IOMUX_TO_GPIO(MX51_PIN_GPIO1_7) /* GPIO1_7 */ +#define MX51EVK_USBH1_STP IOMUX_TO_GPIO(MX51_PIN_USBH1_STP) /* GPIO1_27 */ +#define MX51EVK_USB_CLK_EN_B IOMUX_TO_GPIO(MX51_PIN_EIM_D18) /* GPIO2_1 */ +#define MX51EVK_USB_PHY_RESET IOMUX_TO_GPIO(MX51_PIN_EIM_D21) /* GPIO2_5 */ + +#define USBH1_PAD (PAD_CTL_SRE_FAST | PAD_CTL_DRV_HIGH | \ + PAD_CTL_100K_PU | PAD_CTL_PUE_PULL | \ + PAD_CTL_PKE_ENABLE | PAD_CTL_HYS_ENABLE) +#define GPIO_PAD (PAD_CTL_DRV_HIGH | PAD_CTL_PKE_ENABLE | \ + PAD_CTL_SRE_FAST) +#define NO_PAD (1 << 16) + +static void setup_usb_h1(void) +{ + setup_iomux_usb_h1(); + + /* GPIO_1_7 for USBH1 hub reset */ + mxc_request_iomux(MX51_PIN_GPIO1_7, IOMUX_CONFIG_ALT0); + mxc_iomux_set_pad(MX51_PIN_GPIO1_7, NO_PAD); + + /* GPIO_2_1 */ + mxc_request_iomux(MX51_PIN_EIM_D17, IOMUX_CONFIG_ALT1); + mxc_iomux_set_pad(MX51_PIN_EIM_D17, GPIO_PAD); + + /* GPIO_2_5 for USB PHY reset */ + mxc_request_iomux(MX51_PIN_EIM_D21, IOMUX_CONFIG_ALT1); + mxc_iomux_set_pad(MX51_PIN_EIM_D21, GPIO_PAD); +} + +void board_ehci_hcd_init(int port) +{ + /* Set USBH1_STP to GPIO and toggle it */ + mxc_request_iomux(MX51_PIN_USBH1_STP, IOMUX_CONFIG_GPIO); + mxc_iomux_set_pad(MX51_PIN_USBH1_STP, USBH1_PAD); + + gpio_direction_output(MX51EVK_USBH1_STP, 0); + gpio_direction_output(MX51EVK_USB_PHY_RESET, 0); + mdelay(10); + gpio_set_value(MX51EVK_USBH1_STP, 1); + + /* Set back USBH1_STP to be function */ + mxc_request_iomux(MX51_PIN_USBH1_STP, IOMUX_CONFIG_ALT0); + mxc_iomux_set_pad(MX51_PIN_USBH1_STP, USBH1_PAD); + + /* De-assert USB PHY RESETB */ + gpio_set_value(MX51EVK_USB_PHY_RESET, 1); + + /* Drive USB_CLK_EN_B line low */ + gpio_direction_output(MX51EVK_USB_CLK_EN_B, 0); + + /* Reset USB hub */ + gpio_direction_output(MX51EVK_USBH1_HUB_RST, 0); + mdelay(2); + gpio_set_value(MX51EVK_USBH1_HUB_RST, 1); +} +#endif + static void power_init(void) { unsigned int val; @@ -394,6 +453,9 @@ int board_early_init_f(void) { setup_iomux_uart(); setup_iomux_fec(); +#ifdef CONFIG_USB_EHCI_MX5 + setup_usb_h1(); +#endif return 0; } |