aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2010-12-22 09:25:30 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2011-01-03 04:17:11 -0500
commit130a0ddad9e8f48250dd0e4a5f35aa8afa9d1c5f (patch)
tree4a2bd952f67444bf1a56241556c49bde6a6fe899
parent1fef891761ddcbd7e57ec3961a0fb748003222ac (diff)
ARM: mx3/mx35_3ds: Add USB OTG Host mode
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-mx3/mach-mx35_3ds.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/arch/arm/mach-mx3/mach-mx35_3ds.c b/arch/arm/mach-mx3/mach-mx35_3ds.c
index 8bd8992ffaa5..b1963f257c20 100644
--- a/arch/arm/mach-mx3/mach-mx35_3ds.c
+++ b/arch/arm/mach-mx3/mach-mx35_3ds.c
@@ -26,6 +26,7 @@
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/memory.h> 27#include <linux/memory.h>
28#include <linux/gpio.h> 28#include <linux/gpio.h>
29#include <linux/usb/otg.h>
29 30
30#include <linux/mtd/physmap.h> 31#include <linux/mtd/physmap.h>
31 32
@@ -125,6 +126,11 @@ static const struct fsl_usb2_platform_data usb_otg_pdata __initconst = {
125 .phy_mode = FSL_USB2_PHY_UTMI_WIDE, 126 .phy_mode = FSL_USB2_PHY_UTMI_WIDE,
126}; 127};
127 128
129static struct mxc_usbh_platform_data otg_pdata __initdata = {
130 .portsc = MXC_EHCI_MODE_UTMI,
131 .flags = MXC_EHCI_INTERNAL_PHY,
132};
133
128/* USB HOST config */ 134/* USB HOST config */
129static const struct mxc_usbh_platform_data usb_host_pdata __initconst = { 135static const struct mxc_usbh_platform_data usb_host_pdata __initconst = {
130 .portsc = MXC_EHCI_MODE_SERIAL, 136 .portsc = MXC_EHCI_MODE_SERIAL,
@@ -132,6 +138,21 @@ static const struct mxc_usbh_platform_data usb_host_pdata __initconst = {
132 MXC_EHCI_INTERNAL_PHY, 138 MXC_EHCI_INTERNAL_PHY,
133}; 139};
134 140
141static int otg_mode_host;
142
143static int __init mx35_3ds_otg_mode(char *options)
144{
145 if (!strcmp(options, "host"))
146 otg_mode_host = 1;
147 else if (!strcmp(options, "device"))
148 otg_mode_host = 0;
149 else
150 pr_info("otg_mode neither \"host\" nor \"device\". "
151 "Defaulting to device\n");
152 return 0;
153}
154__setup("otg_mode=", mx35_3ds_otg_mode);
155
135/* 156/*
136 * Board specific initialization. 157 * Board specific initialization.
137 */ 158 */
@@ -145,10 +166,14 @@ static void __init mxc_board_init(void)
145 166
146 imx35_add_imx_uart0(&uart_pdata); 167 imx35_add_imx_uart0(&uart_pdata);
147 168
148 imx35_add_fsl_usb2_udc(&usb_otg_pdata); 169 if (otg_mode_host)
170 imx35_add_mxc_ehci_otg(&otg_pdata);
149 171
150 imx35_add_mxc_ehci_hs(&usb_host_pdata); 172 imx35_add_mxc_ehci_hs(&usb_host_pdata);
151 173
174 if (!otg_mode_host)
175 imx35_add_fsl_usb2_udc(&usb_otg_pdata);
176
152 imx35_add_mxc_nand(&mx35pdk_nand_board_info); 177 imx35_add_mxc_nand(&mx35pdk_nand_board_info);
153 imx35_add_sdhci_esdhc_imx(0, NULL); 178 imx35_add_sdhci_esdhc_imx(0, NULL);
154 179