diff options
author | Valentin Longchamp <valentin.longchamp@epfl.ch> | 2009-08-10 12:33:12 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-08-14 06:40:50 -0400 |
commit | 88b05647171460b1d479371690876f8ac5957d42 (patch) | |
tree | 9b66b699730a9eebafa0ec0984f5f5fc80e6abf0 /arch | |
parent | b23f1534bb0e0dc97e46fc52bf9bde0c2226763c (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')
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard-devboard.c | 45 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard-marxbot.c | 45 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard.c | 45 |
3 files changed, 45 insertions, 90 deletions
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c index 2f2f142f075e..b3e8f251ac79 100644 --- a/arch/arm/mach-mx3/mx31moboard-devboard.c +++ b/arch/arm/mach-mx3/mx31moboard-devboard.c | |||
@@ -16,7 +16,6 @@ | |||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/fsl_devices.h> | ||
20 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
21 | #include <linux/init.h> | 20 | #include <linux/init.h> |
22 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
@@ -40,18 +39,6 @@ static unsigned int devboard_pins[] = { | |||
40 | MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0, | 39 | MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0, |
41 | MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD, | 40 | MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD, |
42 | MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29, | 41 | MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29, |
43 | /* USB OTG */ | ||
44 | MX31_PIN_USBOTG_DATA0__USBOTG_DATA0, | ||
45 | MX31_PIN_USBOTG_DATA1__USBOTG_DATA1, | ||
46 | MX31_PIN_USBOTG_DATA2__USBOTG_DATA2, | ||
47 | MX31_PIN_USBOTG_DATA3__USBOTG_DATA3, | ||
48 | MX31_PIN_USBOTG_DATA4__USBOTG_DATA4, | ||
49 | MX31_PIN_USBOTG_DATA5__USBOTG_DATA5, | ||
50 | MX31_PIN_USBOTG_DATA6__USBOTG_DATA6, | ||
51 | MX31_PIN_USBOTG_DATA7__USBOTG_DATA7, | ||
52 | MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR, | ||
53 | MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP, | ||
54 | MX31_PIN_USB_OC__GPIO1_30, | ||
55 | }; | 42 | }; |
56 | 43 | ||
57 | static struct imxuart_platform_data uart_pdata = { | 44 | static struct imxuart_platform_data uart_pdata = { |
@@ -111,35 +98,6 @@ static struct imxmmc_platform_data sdhc2_pdata = { | |||
111 | .exit = devboard_sdhc2_exit, | 98 | .exit = devboard_sdhc2_exit, |
112 | }; | 99 | }; |
113 | 100 | ||
114 | static struct fsl_usb2_platform_data usb_pdata = { | ||
115 | .operating_mode = FSL_USB2_DR_DEVICE, | ||
116 | .phy_mode = FSL_USB2_PHY_ULPI, | ||
117 | }; | ||
118 | |||
119 | #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ | ||
120 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) | ||
121 | |||
122 | #define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC) | ||
123 | |||
124 | static void devboard_usbotg_init(void) | ||
125 | { | ||
126 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG); | ||
127 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG); | ||
128 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG); | ||
129 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, USB_PAD_CFG); | ||
130 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, USB_PAD_CFG); | ||
131 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, USB_PAD_CFG); | ||
132 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, USB_PAD_CFG); | ||
133 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, USB_PAD_CFG); | ||
134 | mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, USB_PAD_CFG); | ||
135 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, USB_PAD_CFG); | ||
136 | mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG); | ||
137 | mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG); | ||
138 | |||
139 | gpio_request(OTG_EN_B, "usb-udc-en"); | ||
140 | gpio_direction_output(OTG_EN_B, 0); | ||
141 | } | ||
142 | |||
143 | /* | 101 | /* |
144 | * system init for baseboard usage. Will be called by mx31moboard init. | 102 | * system init for baseboard usage. Will be called by mx31moboard init. |
145 | */ | 103 | */ |
@@ -153,7 +111,4 @@ void __init mx31moboard_devboard_init(void) | |||
153 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | 111 | mxc_register_device(&mxc_uart_device1, &uart_pdata); |
154 | 112 | ||
155 | mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); | 113 | mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); |
156 | |||
157 | devboard_usbotg_init(); | ||
158 | mxc_register_device(&mxc_otg_udc_device, &usb_pdata); | ||
159 | } | 114 | } |
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c index b817a4a5bcba..53ce7ff0637c 100644 --- a/arch/arm/mach-mx3/mx31moboard-marxbot.c +++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c | |||
@@ -16,7 +16,6 @@ | |||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/fsl_devices.h> | ||
20 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
21 | #include <linux/init.h> | 20 | #include <linux/init.h> |
22 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
@@ -48,18 +47,6 @@ static unsigned int marxbot_pins[] = { | |||
48 | MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC, | 47 | MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC, |
49 | MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1, | 48 | MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1, |
50 | MX31_PIN_TXD2__GPIO1_28, | 49 | MX31_PIN_TXD2__GPIO1_28, |
51 | /* USB OTG */ | ||
52 | MX31_PIN_USBOTG_DATA0__USBOTG_DATA0, | ||
53 | MX31_PIN_USBOTG_DATA1__USBOTG_DATA1, | ||
54 | MX31_PIN_USBOTG_DATA2__USBOTG_DATA2, | ||
55 | MX31_PIN_USBOTG_DATA3__USBOTG_DATA3, | ||
56 | MX31_PIN_USBOTG_DATA4__USBOTG_DATA4, | ||
57 | MX31_PIN_USBOTG_DATA5__USBOTG_DATA5, | ||
58 | MX31_PIN_USBOTG_DATA6__USBOTG_DATA6, | ||
59 | MX31_PIN_USBOTG_DATA7__USBOTG_DATA7, | ||
60 | MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR, | ||
61 | MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP, | ||
62 | MX31_PIN_USB_OC__GPIO1_30, | ||
63 | }; | 50 | }; |
64 | 51 | ||
65 | #define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR) | 52 | #define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR) |
@@ -115,35 +102,6 @@ static struct imxmmc_platform_data sdhc2_pdata = { | |||
115 | .exit = marxbot_sdhc2_exit, | 102 | .exit = marxbot_sdhc2_exit, |
116 | }; | 103 | }; |
117 | 104 | ||
118 | static struct fsl_usb2_platform_data usb_pdata = { | ||
119 | .operating_mode = FSL_USB2_DR_DEVICE, | ||
120 | .phy_mode = FSL_USB2_PHY_ULPI, | ||
121 | }; | ||
122 | |||
123 | #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ | ||
124 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) | ||
125 | |||
126 | #define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC) | ||
127 | |||
128 | static void marxbot_usbotg_init(void) | ||
129 | { | ||
130 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG); | ||
131 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG); | ||
132 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG); | ||
133 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, USB_PAD_CFG); | ||
134 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, USB_PAD_CFG); | ||
135 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, USB_PAD_CFG); | ||
136 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, USB_PAD_CFG); | ||
137 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, USB_PAD_CFG); | ||
138 | mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, USB_PAD_CFG); | ||
139 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, USB_PAD_CFG); | ||
140 | mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG); | ||
141 | mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG); | ||
142 | |||
143 | gpio_request(OTG_EN_B, "usb-udc-en"); | ||
144 | gpio_direction_output(OTG_EN_B, 0); | ||
145 | } | ||
146 | |||
147 | /* | 105 | /* |
148 | * system init for baseboard usage. Will be called by mx31moboard init. | 106 | * system init for baseboard usage. Will be called by mx31moboard init. |
149 | */ | 107 | */ |
@@ -155,7 +113,4 @@ void __init mx31moboard_marxbot_init(void) | |||
155 | "marxbot"); | 113 | "marxbot"); |
156 | 114 | ||
157 | mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); | 115 | mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); |
158 | |||
159 | marxbot_usbotg_init(); | ||
160 | mxc_register_device(&mxc_otg_udc_device, &usb_pdata); | ||
161 | } | 116 | } |
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 | ||
64 | static struct physmap_flash_data mx31moboard_flash_data = { | 77 | static 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 | |||
180 | static 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 | |||
199 | static struct fsl_usb2_platform_data usb_pdata = { | ||
200 | .operating_mode = FSL_USB2_DR_DEVICE, | ||
201 | .phy_mode = FSL_USB2_PHY_ULPI, | ||
202 | }; | ||
203 | |||
162 | static struct platform_device *devices[] __initdata = { | 204 | static 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; |