From 574023d8d7cda8afb8faacb4a393206a0d52dbbd Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Tue, 21 Dec 2010 16:38:21 -0200 Subject: [PATCH] --- yaml --- r: 226159 b: refs/heads/master c: 1c50e67263a6ab8abb9234e2357bd02134fb4b99 h: refs/heads/master i: 226157: 73975f9a36d85d6000cd024d30b7992c0e17c6b0 226155: ac940fea924bf4c51aab74e4dbf208596a551e3c 226151: fdd90728c373e85c08cdd7356eab3767d6c525b9 226143: 449f82f3da17894d458d05f802b008af2d3e4f17 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-mx3/Kconfig | 2 ++ trunk/arch/arm/mach-mx3/mach-mx31_3ds.c | 36 ++++++++++++++++++++++++- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 1aba7a5401e6..47c67e1a8473 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 460d30a329a4186192598131505d9f75e6c5e2bc +refs/heads/master: 1c50e67263a6ab8abb9234e2357bd02134fb4b99 diff --git a/trunk/arch/arm/mach-mx3/Kconfig b/trunk/arch/arm/mach-mx3/Kconfig index 9037c4e9bd34..0717f887cba0 100644 --- a/trunk/arch/arm/mach-mx3/Kconfig +++ b/trunk/arch/arm/mach-mx3/Kconfig @@ -96,8 +96,10 @@ config MACH_MX31_3DS select IMX_HAVE_PLATFORM_IMX2_WDT select IMX_HAVE_PLATFORM_IMX_KEYPAD select IMX_HAVE_PLATFORM_IMX_UART + select IMX_HAVE_PLATFORM_MXC_EHCI select IMX_HAVE_PLATFORM_MXC_NAND select IMX_HAVE_PLATFORM_SPI_IMX + select MXC_ULPI if USB_ULPI help Include support for MX31PDK (3DS) platform. This includes specific configurations for the board and its peripherals. diff --git a/trunk/arch/arm/mach-mx3/mach-mx31_3ds.c b/trunk/arch/arm/mach-mx3/mach-mx31_3ds.c index c488491bf938..fd7b722dff63 100644 --- a/trunk/arch/arm/mach-mx3/mach-mx31_3ds.c +++ b/trunk/arch/arm/mach-mx3/mach-mx31_3ds.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include @@ -32,6 +34,7 @@ #include #include #include +#include #include "devices-imx31.h" #include "devices.h" @@ -212,11 +215,33 @@ static int mx31_3ds_usbotg_init(void) return err; } +#if defined(CONFIG_USB_ULPI) +static struct mxc_usbh_platform_data otg_pdata __initdata = { + .portsc = MXC_EHCI_MODE_ULPI, + .flags = MXC_EHCI_POWER_PINS_ENABLED, +}; +#endif + static const struct fsl_usb2_platform_data usbotg_pdata __initconst = { .operating_mode = FSL_USB2_DR_DEVICE, .phy_mode = FSL_USB2_PHY_ULPI, }; +static int otg_mode_host; + +static int __init mx31_3ds_otg_mode(char *options) +{ + if (!strcmp(options, "host")) + otg_mode_host = 1; + else if (!strcmp(options, "device")) + otg_mode_host = 0; + else + pr_info("otg_mode neither \"host\" nor \"device\". " + "Defaulting to device\n"); + return 0; +} +__setup("otg_mode=", mx31_3ds_otg_mode); + static const struct imxuart_platform_data uart_pdata __initconst = { .flags = IMXUART_HAVE_RTSCTS, }; @@ -247,7 +272,16 @@ static void __init mxc_board_init(void) imx31_add_imx_keypad(&mx31_3ds_keymap_data); mx31_3ds_usbotg_init(); - imx31_add_fsl_usb2_udc(&usbotg_pdata); +#if defined(CONFIG_USB_ULPI) + if (otg_mode_host) { + otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, + ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); + + imx31_add_mxc_ehci_otg(&otg_pdata); + } +#endif + if (!otg_mode_host) + imx31_add_fsl_usb2_udc(&usbotg_pdata); if (mxc_expio_init(MX31_CS5_BASE_ADDR, EXPIO_PARENT_INT)) printk(KERN_WARNING "Init of the debug board failed, all "