aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3/mx31moboard.c
diff options
context:
space:
mode:
authorValentin Longchamp <valentin.longchamp@epfl.ch>2009-08-10 12:33:12 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2009-08-14 06:40:50 -0400
commit88b05647171460b1d479371690876f8ac5957d42 (patch)
tree9b66b699730a9eebafa0ec0984f5f5fc80e6abf0 /arch/arm/mach-mx3/mx31moboard.c
parentb23f1534bb0e0dc97e46fc52bf9bde0c2226763c (diff)
mx31moboard: move usb otg support back to moboard common file
since all boards finally have this device 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.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c
index 53ce60bdc823..2852bd58edae 100644
--- a/arch/arm/mach-mx3/mx31moboard.c
+++ b/arch/arm/mach-mx3/mx31moboard.c
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/fsl_devices.h>
20#include <linux/gpio.h> 21#include <linux/gpio.h>
21#include <linux/init.h> 22#include <linux/init.h>
22#include <linux/interrupt.h> 23#include <linux/interrupt.h>
@@ -59,6 +60,18 @@ static unsigned int moboard_pins[] = {
59 MX31_PIN_ATA_CS0__GPIO3_26, MX31_PIN_ATA_CS1__GPIO3_27, 60 MX31_PIN_ATA_CS0__GPIO3_26, MX31_PIN_ATA_CS1__GPIO3_27,
60 /* USB reset */ 61 /* USB reset */
61 MX31_PIN_GPIO1_0__GPIO1_0, 62 MX31_PIN_GPIO1_0__GPIO1_0,
63 /* USB OTG */
64 MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
65 MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
66 MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
67 MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
68 MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
69 MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
70 MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
71 MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
72 MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR,
73 MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP,
74 MX31_PIN_USB_OC__GPIO1_30,
62}; 75};
63 76
64static struct physmap_flash_data mx31moboard_flash_data = { 77static struct physmap_flash_data mx31moboard_flash_data = {
@@ -159,6 +172,35 @@ static void usb_xcvr_reset(void)
159 gpio_set_value(USB_RESET_B, 1); 172 gpio_set_value(USB_RESET_B, 1);
160} 173}
161 174
175#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
176 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
177
178#define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC)
179
180static void moboard_usbotg_init(void)
181{
182 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG);
183 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG);
184 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG);
185 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, USB_PAD_CFG);
186 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, USB_PAD_CFG);
187 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, USB_PAD_CFG);
188 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, USB_PAD_CFG);
189 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, USB_PAD_CFG);
190 mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, USB_PAD_CFG);
191 mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, USB_PAD_CFG);
192 mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG);
193 mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG);
194
195 gpio_request(OTG_EN_B, "usb-udc-en");
196 gpio_direction_output(OTG_EN_B, 0);
197}
198
199static struct fsl_usb2_platform_data usb_pdata = {
200 .operating_mode = FSL_USB2_DR_DEVICE,
201 .phy_mode = FSL_USB2_PHY_ULPI,
202};
203
162static struct platform_device *devices[] __initdata = { 204static struct platform_device *devices[] __initdata = {
163 &mx31moboard_flash, 205 &mx31moboard_flash,
164}; 206};
@@ -186,6 +228,9 @@ static void __init mxc_board_init(void)
186 228
187 usb_xcvr_reset(); 229 usb_xcvr_reset();
188 230
231 moboard_usbotg_init();
232 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
233
189 switch (mx31moboard_baseboard) { 234 switch (mx31moboard_baseboard) {
190 case MX31NOBOARD: 235 case MX31NOBOARD:
191 break; 236 break;