aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-02-04 08:32:53 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2010-02-04 15:28:12 -0500
commitcb2dc111b156eb41f61ed4e5b3a3a5df90526d9d (patch)
tree40d6cb10ddc1b8c039ea8eca085bb03836cb6d3f /arch/arm
parentee14373cdc91fbc9ad8db0bf38e28d58f577b181 (diff)
i.MX27 pca100: Add USB support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mx3/Kconfig1
-rw-r--r--arch/arm/mach-mx3/mach-pcm043.c53
2 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 2232b7b04b6d..3872af1cf2c3 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -87,6 +87,7 @@ config MACH_QONG
87config MACH_PCM043 87config MACH_PCM043
88 bool "Support Phytec pcm043 (i.MX35) platforms" 88 bool "Support Phytec pcm043 (i.MX35) platforms"
89 select ARCH_MX35 89 select ARCH_MX35
90 select MXC_ULPI if USB_ULPI
90 help 91 help
91 Include support for Phytec pcm043 platform. This includes 92 Include support for Phytec pcm043 platform. This includes
92 specific configurations for the board and its peripherals. 93 specific configurations for the board and its peripherals.
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c
index 25942b8e8bed..a9741c2b379f 100644
--- a/arch/arm/mach-mx3/mach-pcm043.c
+++ b/arch/arm/mach-mx3/mach-pcm043.c
@@ -28,6 +28,9 @@
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/i2c.h> 29#include <linux/i2c.h>
30#include <linux/i2c/at24.h> 30#include <linux/i2c/at24.h>
31#include <linux/usb/otg.h>
32#include <linux/usb/ulpi.h>
33#include <linux/fsl_devices.h>
31 34
32#include <asm/mach-types.h> 35#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
@@ -44,6 +47,8 @@
44#include <mach/ipu.h> 47#include <mach/ipu.h>
45#include <mach/mx3fb.h> 48#include <mach/mx3fb.h>
46#include <mach/mxc_nand.h> 49#include <mach/mxc_nand.h>
50#include <mach/mxc_ehci.h>
51#include <mach/ulpi.h>
47 52
48#include "devices.h" 53#include "devices.h"
49 54
@@ -205,6 +210,9 @@ static struct pad_desc pcm043_pads[] = {
205 MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS, 210 MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS,
206 /* gpio */ 211 /* gpio */
207 MX35_PAD_ATA_CS0__GPIO2_6, 212 MX35_PAD_ATA_CS0__GPIO2_6,
213 /* USB host */
214 MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR,
215 MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC,
208}; 216};
209 217
210static struct mxc_nand_platform_data pcm037_nand_board_info = { 218static struct mxc_nand_platform_data pcm037_nand_board_info = {
@@ -212,6 +220,37 @@ static struct mxc_nand_platform_data pcm037_nand_board_info = {
212 .hw_ecc = 1, 220 .hw_ecc = 1,
213}; 221};
214 222
223static struct mxc_usbh_platform_data otg_pdata = {
224 .portsc = MXC_EHCI_MODE_UTMI,
225 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
226};
227
228static struct mxc_usbh_platform_data usbh1_pdata = {
229 .portsc = MXC_EHCI_MODE_SERIAL,
230 .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY |
231 MXC_EHCI_IPPUE_DOWN,
232};
233
234static struct fsl_usb2_platform_data otg_device_pdata = {
235 .operating_mode = FSL_USB2_DR_DEVICE,
236 .phy_mode = FSL_USB2_PHY_UTMI,
237};
238
239static int otg_mode_host;
240
241static int __init pcm043_otg_mode(char *options)
242{
243 if (!strcmp(options, "host"))
244 otg_mode_host = 1;
245 else if (!strcmp(options, "device"))
246 otg_mode_host = 0;
247 else
248 pr_info("otg_mode neither \"host\" nor \"device\". "
249 "Defaulting to device\n");
250 return 0;
251}
252__setup("otg_mode=", pcm043_otg_mode);
253
215/* 254/*
216 * Board specific initialization. 255 * Board specific initialization.
217 */ 256 */
@@ -235,6 +274,20 @@ static void __init mxc_board_init(void)
235 274
236 mxc_register_device(&mx3_ipu, &mx3_ipu_data); 275 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
237 mxc_register_device(&mx3_fb, &mx3fb_pdata); 276 mxc_register_device(&mx3_fb, &mx3fb_pdata);
277
278#if defined(CONFIG_USB_ULPI)
279 if (otg_mode_host) {
280 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
281 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
282
283 mxc_register_device(&mxc_otg_host, &otg_pdata);
284 }
285
286 mxc_register_device(&mxc_usbh1, &usbh1_pdata);
287#endif
288 if (!otg_mode_host)
289 mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata);
290
238} 291}
239 292
240static void __init pcm043_timer_init(void) 293static void __init pcm043_timer_init(void)