diff options
author | Valentin Longchamp <valentin.longchamp@epfl.ch> | 2009-11-23 13:16:37 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-11-24 02:37:50 -0500 |
commit | d67d107586fa2c6fe4237292d58fb3787c75c6d1 (patch) | |
tree | f17c543ce98d77e0f0fec8e56834886302e706ca /arch/arm/mach-mx3/mx31moboard.c | |
parent | 33c4d91928bea4444b067e620496befbeb87029c (diff) |
mx31moboard: support for usbh1 and usbh2
Signed-off-by: Valentin Longchamp <valentin.longchamp@epfl.ch>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3/mx31moboard.c')
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c index 2c9ea5f61816..1ec679a3c72f 100644 --- a/arch/arm/mach-mx3/mx31moboard.c +++ b/arch/arm/mach-mx3/mx31moboard.c | |||
@@ -32,6 +32,9 @@ | |||
32 | #include <linux/spi/spi.h> | 32 | #include <linux/spi/spi.h> |
33 | #include <linux/types.h> | 33 | #include <linux/types.h> |
34 | 34 | ||
35 | #include <linux/usb/otg.h> | ||
36 | #include <linux/usb/ulpi.h> | ||
37 | |||
35 | #include <asm/mach-types.h> | 38 | #include <asm/mach-types.h> |
36 | #include <asm/mach/arch.h> | 39 | #include <asm/mach/arch.h> |
37 | #include <asm/mach/time.h> | 40 | #include <asm/mach/time.h> |
@@ -44,8 +47,10 @@ | |||
44 | #include <mach/ipu.h> | 47 | #include <mach/ipu.h> |
45 | #include <mach/i2c.h> | 48 | #include <mach/i2c.h> |
46 | #include <mach/mmc.h> | 49 | #include <mach/mmc.h> |
50 | #include <mach/mxc_ehci.h> | ||
47 | #include <mach/mx3_camera.h> | 51 | #include <mach/mx3_camera.h> |
48 | #include <mach/spi.h> | 52 | #include <mach/spi.h> |
53 | #include <mach/ulpi.h> | ||
49 | 54 | ||
50 | #include "devices.h" | 55 | #include "devices.h" |
51 | 56 | ||
@@ -79,6 +84,15 @@ static unsigned int moboard_pins[] = { | |||
79 | MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR, | 84 | MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR, |
80 | MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP, | 85 | MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP, |
81 | MX31_PIN_USB_OC__GPIO1_30, | 86 | MX31_PIN_USB_OC__GPIO1_30, |
87 | /* USB H2 */ | ||
88 | MX31_PIN_USBH2_DATA0__USBH2_DATA0, | ||
89 | MX31_PIN_USBH2_DATA1__USBH2_DATA1, | ||
90 | MX31_PIN_STXD3__USBH2_DATA2, MX31_PIN_SRXD3__USBH2_DATA3, | ||
91 | MX31_PIN_SCK3__USBH2_DATA4, MX31_PIN_SFS3__USBH2_DATA5, | ||
92 | MX31_PIN_STXD6__USBH2_DATA6, MX31_PIN_SRXD6__USBH2_DATA7, | ||
93 | MX31_PIN_USBH2_CLK__USBH2_CLK, MX31_PIN_USBH2_DIR__USBH2_DIR, | ||
94 | MX31_PIN_USBH2_NXT__USBH2_NXT, MX31_PIN_USBH2_STP__USBH2_STP, | ||
95 | MX31_PIN_SCK6__GPIO1_25, | ||
82 | /* LEDs */ | 96 | /* LEDs */ |
83 | MX31_PIN_SVEN0__GPIO2_0, MX31_PIN_STX0__GPIO2_1, | 97 | MX31_PIN_SVEN0__GPIO2_0, MX31_PIN_STX0__GPIO2_1, |
84 | MX31_PIN_SRX0__GPIO2_2, MX31_PIN_SIMPD0__GPIO2_3, | 98 | MX31_PIN_SRX0__GPIO2_2, MX31_PIN_SIMPD0__GPIO2_3, |
@@ -332,6 +346,56 @@ static struct fsl_usb2_platform_data usb_pdata = { | |||
332 | .phy_mode = FSL_USB2_PHY_ULPI, | 346 | .phy_mode = FSL_USB2_PHY_ULPI, |
333 | }; | 347 | }; |
334 | 348 | ||
349 | #define USBH2_EN_B IOMUX_TO_GPIO(MX31_PIN_SCK6) | ||
350 | |||
351 | static int moboard_usbh2_hw_init(struct platform_device *pdev) | ||
352 | { | ||
353 | int ret = gpio_request(USBH2_EN_B, "usbh2-en"); | ||
354 | if (ret) | ||
355 | return ret; | ||
356 | |||
357 | mxc_iomux_set_gpr(MUX_PGP_UH2, true); | ||
358 | |||
359 | mxc_iomux_set_pad(MX31_PIN_USBH2_CLK, USB_PAD_CFG); | ||
360 | mxc_iomux_set_pad(MX31_PIN_USBH2_DIR, USB_PAD_CFG); | ||
361 | mxc_iomux_set_pad(MX31_PIN_USBH2_NXT, USB_PAD_CFG); | ||
362 | mxc_iomux_set_pad(MX31_PIN_USBH2_STP, USB_PAD_CFG); | ||
363 | mxc_iomux_set_pad(MX31_PIN_USBH2_DATA0, USB_PAD_CFG); | ||
364 | mxc_iomux_set_pad(MX31_PIN_USBH2_DATA1, USB_PAD_CFG); | ||
365 | mxc_iomux_set_pad(MX31_PIN_SRXD6, USB_PAD_CFG); | ||
366 | mxc_iomux_set_pad(MX31_PIN_STXD6, USB_PAD_CFG); | ||
367 | mxc_iomux_set_pad(MX31_PIN_SFS3, USB_PAD_CFG); | ||
368 | mxc_iomux_set_pad(MX31_PIN_SCK3, USB_PAD_CFG); | ||
369 | mxc_iomux_set_pad(MX31_PIN_SRXD3, USB_PAD_CFG); | ||
370 | mxc_iomux_set_pad(MX31_PIN_STXD3, USB_PAD_CFG); | ||
371 | |||
372 | gpio_direction_output(USBH2_EN_B, 0); | ||
373 | |||
374 | return 0; | ||
375 | } | ||
376 | |||
377 | static int moboard_usbh2_hw_exit(struct platform_device *pdev) | ||
378 | { | ||
379 | gpio_free(USBH2_EN_B); | ||
380 | return 0; | ||
381 | } | ||
382 | |||
383 | static struct mxc_usbh_platform_data usbh2_pdata = { | ||
384 | .init = moboard_usbh2_hw_init, | ||
385 | .exit = moboard_usbh2_hw_exit, | ||
386 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | ||
387 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
388 | }; | ||
389 | |||
390 | static int __init moboard_usbh2_init(void) | ||
391 | { | ||
392 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | ||
393 | USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); | ||
394 | |||
395 | return mxc_register_device(&mx31_usbh2, &usbh2_pdata); | ||
396 | } | ||
397 | |||
398 | |||
335 | static struct gpio_led mx31moboard_leds[] = { | 399 | static struct gpio_led mx31moboard_leds[] = { |
336 | { | 400 | { |
337 | .name = "coreboard-led-0:red:running", | 401 | .name = "coreboard-led-0:red:running", |
@@ -472,6 +536,7 @@ static void __init mxc_board_init(void) | |||
472 | 536 | ||
473 | moboard_usbotg_init(); | 537 | moboard_usbotg_init(); |
474 | mxc_register_device(&mxc_otg_udc_device, &usb_pdata); | 538 | mxc_register_device(&mxc_otg_udc_device, &usb_pdata); |
539 | moboard_usbh2_init(); | ||
475 | 540 | ||
476 | switch (mx31moboard_baseboard) { | 541 | switch (mx31moboard_baseboard) { |
477 | case MX31NOBOARD: | 542 | case MX31NOBOARD: |