diff options
author | Luotao Fu <l.fu@pengutronix.de> | 2009-06-25 11:17:51 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-07-01 09:17:40 +0200 |
commit | c404baabf3df5ca364529527cfd78b6e1a4b325f (patch) | |
tree | a5f4ac0b2519fa56bb4ec95500e8114f61b2cc06 | |
parent | ae1d49ece17509f6db171c235ca9741a63d56d84 (diff) | |
download | linux-2.6-c404baabf3df5ca364529527cfd78b6e1a4b325f.tar.gz linux-2.6-c404baabf3df5ca364529527cfd78b6e1a4b325f.tar.xz |
pca100: add chipselect for host usb phy
deactivate usb phy by pulling up the chipselect line during initialization of
usb host controller to prevent phy crash caused by undefined behaviour of mx2
usb controller during initialization
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
-rw-r--r-- | arch/arm/mach-mx2/pca100.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-mx2/pca100.c b/arch/arm/mach-mx2/pca100.c index d7c08472510..ed801feb9d4 100644 --- a/arch/arm/mach-mx2/pca100.c +++ b/arch/arm/mach-mx2/pca100.c @@ -28,6 +28,7 @@ #include <linux/spi/eeprom.h> #include <linux/delay.h> #include <linux/irq.h> +#include <linux/gpio.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> @@ -274,6 +275,12 @@ static int pca100_usbh2_init(struct platform_device *pdev) int ret; uint32_t temp; + ret = gpio_request(GPIO_PORTB + 24, "usb-host-cs"); + if (ret) + return ret; + /* disable phy chip select */ + gpio_direction_output(GPIO_PORTB + 24, 1); + ret = mxc_gpio_setup_multiple_pins(mxc_usbh2_pins, ARRAY_SIZE(mxc_usbh2_pins), "usbh2"); if (ret) @@ -291,6 +298,10 @@ static int pca100_usbh2_init(struct platform_device *pdev) mdelay(10); + /* enable phy */ + gpio_set_value(GPIO_PORTB + 24, 0); + udelay(10); + ret = isp1504_set_vbus_power(IO_ADDRESS(OTG_BASE_ADDR + 0x570), 1); if (ret) mxc_gpio_release_multiple_pins(mxc_usbh2_pins, @@ -378,6 +389,9 @@ static void __init pca100_init(void) ARRAY_SIZE(pca100_i2c_devices)); mxc_register_device(&mxc_i2c_device1, &pca100_i2c_1_data); + + /* cs on usbh2 phy */ + mxc_gpio_mode((GPIO_PORTB | 24) | GPIO_GPIO | GPIO_OUT); mxc_register_device(&mxc_ehci2, &ehci2_pdata); mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT); |