aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx2
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-02-25 08:01:49 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-02-25 08:01:49 -0500
commit9b1489e989695c4d502865f8bec616c0f17e99ab (patch)
tree9f90bcc7491bec06db0463d5f24f1ac19b8becc4 /arch/arm/mach-mx2
parentbac3fcfad565c9bbceeed8b607f140c29df97355 (diff)
parent08268b78d6f0c659dc1d86453c57b336f6f4f9ae (diff)
Merge branch 'mxc-master' of git://git.pengutronix.de/git/imx/linux-2.6 into imx/master
Removed selection of COMMON_CLKDEV by CONFIG_ARCH_MX5. This is handled in 03e09cd8902717b66f940357257d8ad76114d9f2. arch/arm/plat-mxc/iomux-mx1-mx2.c was moved to arch/arm/plat-mxc/iomux-v1.c in 5e2e95f520538e095d10456acd28d9107317aa32 and got bug fixed in 5c17ef878fa25e04b1e8f1d8f5fa8b267753472c. The bug in arch/arm/plat-mxc/iomux-v1.c isn't present any more since bac3fcfad565c9bbceeed8b607f140c29df97355, so arch/arm/plat-mxc/iomux-mx1-mx2.c is simply deleted. Conflicts: arch/arm/plat-mxc/Kconfig arch/arm/plat-mxc/Makefile arch/arm/plat-mxc/iomux-mx1-mx2.c Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx2')
-rw-r--r--arch/arm/mach-mx2/Kconfig2
-rw-r--r--arch/arm/mach-mx2/mach-pca100.c151
-rw-r--r--arch/arm/mach-mx2/mach-pcm038.c22
3 files changed, 175 insertions, 0 deletions
diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig
index 7bc797c1c3a2..742fd4e6dcb9 100644
--- a/arch/arm/mach-mx2/Kconfig
+++ b/arch/arm/mach-mx2/Kconfig
@@ -37,6 +37,7 @@ config MACH_MX27ADS
37config MACH_PCM038 37config MACH_PCM038
38 bool "Phytec phyCORE-i.MX27 CPU module (pcm038)" 38 bool "Phytec phyCORE-i.MX27 CPU module (pcm038)"
39 depends on MACH_MX27 39 depends on MACH_MX27
40 select MXC_ULPI if USB_ULPI
40 help 41 help
41 Include support for phyCORE-i.MX27 (aka pcm038) platform. This 42 Include support for phyCORE-i.MX27 (aka pcm038) platform. This
42 includes specific configurations for the module and its peripherals. 43 includes specific configurations for the module and its peripherals.
@@ -100,6 +101,7 @@ config MACH_IMX27LITE
100config MACH_PCA100 101config MACH_PCA100
101 bool "Phytec phyCARD-s (pca100)" 102 bool "Phytec phyCARD-s (pca100)"
102 depends on MACH_MX27 103 depends on MACH_MX27
104 select MXC_ULPI if USB_ULPI
103 help 105 help
104 Include support for phyCARD-s (aka pca100) platform. This 106 Include support for phyCARD-s (aka pca100) platform. This
105 includes specific configurations for the module and its peripherals. 107 includes specific configurations for the module and its peripherals.
diff --git a/arch/arm/mach-mx2/mach-pca100.c b/arch/arm/mach-mx2/mach-pca100.c
index cc1762daff3a..778fff230918 100644
--- a/arch/arm/mach-mx2/mach-pca100.c
+++ b/arch/arm/mach-mx2/mach-pca100.c
@@ -25,7 +25,11 @@
25#include <linux/spi/spi.h> 25#include <linux/spi/spi.h>
26#include <linux/spi/eeprom.h> 26#include <linux/spi/eeprom.h>
27#include <linux/irq.h> 27#include <linux/irq.h>
28#include <linux/delay.h>
28#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/usb/otg.h>
31#include <linux/usb/ulpi.h>
32#include <linux/fsl_devices.h>
29 33
30#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
31#include <asm/mach-types.h> 35#include <asm/mach-types.h>
@@ -38,12 +42,19 @@
38#include <mach/spi.h> 42#include <mach/spi.h>
39#endif 43#endif
40#include <mach/imx-uart.h> 44#include <mach/imx-uart.h>
45#include <mach/audmux.h>
46#include <mach/ssi.h>
41#include <mach/mxc_nand.h> 47#include <mach/mxc_nand.h>
42#include <mach/irqs.h> 48#include <mach/irqs.h>
43#include <mach/mmc.h> 49#include <mach/mmc.h>
50#include <mach/mxc_ehci.h>
51#include <mach/ulpi.h>
44 52
45#include "devices.h" 53#include "devices.h"
46 54
55#define OTG_PHY_CS_GPIO (GPIO_PORTB + 23)
56#define USBH2_PHY_CS_GPIO (GPIO_PORTB + 24)
57
47static int pca100_pins[] = { 58static int pca100_pins[] = {
48 /* UART1 */ 59 /* UART1 */
49 PE12_PF_UART1_TXD, 60 PE12_PF_UART1_TXD,
@@ -92,6 +103,34 @@ static int pca100_pins[] = {
92 PD29_PF_CSPI1_SCLK, 103 PD29_PF_CSPI1_SCLK,
93 PD30_PF_CSPI1_MISO, 104 PD30_PF_CSPI1_MISO,
94 PD31_PF_CSPI1_MOSI, 105 PD31_PF_CSPI1_MOSI,
106 /* OTG */
107 OTG_PHY_CS_GPIO | GPIO_GPIO | GPIO_OUT,
108 PC7_PF_USBOTG_DATA5,
109 PC8_PF_USBOTG_DATA6,
110 PC9_PF_USBOTG_DATA0,
111 PC10_PF_USBOTG_DATA2,
112 PC11_PF_USBOTG_DATA1,
113 PC12_PF_USBOTG_DATA4,
114 PC13_PF_USBOTG_DATA3,
115 PE0_PF_USBOTG_NXT,
116 PE1_PF_USBOTG_STP,
117 PE2_PF_USBOTG_DIR,
118 PE24_PF_USBOTG_CLK,
119 PE25_PF_USBOTG_DATA7,
120 /* USBH2 */
121 USBH2_PHY_CS_GPIO | GPIO_GPIO | GPIO_OUT,
122 PA0_PF_USBH2_CLK,
123 PA1_PF_USBH2_DIR,
124 PA2_PF_USBH2_DATA7,
125 PA3_PF_USBH2_NXT,
126 PA4_PF_USBH2_STP,
127 PD19_AF_USBH2_DATA4,
128 PD20_AF_USBH2_DATA3,
129 PD21_AF_USBH2_DATA6,
130 PD22_AF_USBH2_DATA0,
131 PD23_AF_USBH2_DATA2,
132 PD24_AF_USBH2_DATA1,
133 PD26_AF_USBH2_DATA5,
95}; 134};
96 135
97static struct imxuart_platform_data uart_pdata = { 136static struct imxuart_platform_data uart_pdata = {
@@ -157,6 +196,37 @@ static struct spi_imx_master pca100_spi_0_data = {
157}; 196};
158#endif 197#endif
159 198
199static void pca100_ac97_warm_reset(struct snd_ac97 *ac97)
200{
201 mxc_gpio_mode(GPIO_PORTC | 20 | GPIO_GPIO | GPIO_OUT);
202 gpio_set_value(GPIO_PORTC + 20, 1);
203 udelay(2);
204 gpio_set_value(GPIO_PORTC + 20, 0);
205 mxc_gpio_mode(PC20_PF_SSI1_FS);
206 msleep(2);
207}
208
209static void pca100_ac97_cold_reset(struct snd_ac97 *ac97)
210{
211 mxc_gpio_mode(GPIO_PORTC | 20 | GPIO_GPIO | GPIO_OUT); /* FS */
212 gpio_set_value(GPIO_PORTC + 20, 0);
213 mxc_gpio_mode(GPIO_PORTC | 22 | GPIO_GPIO | GPIO_OUT); /* TX */
214 gpio_set_value(GPIO_PORTC + 22, 0);
215 mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_OUT); /* reset */
216 gpio_set_value(GPIO_PORTC + 28, 0);
217 udelay(10);
218 gpio_set_value(GPIO_PORTC + 28, 1);
219 mxc_gpio_mode(PC20_PF_SSI1_FS);
220 mxc_gpio_mode(PC22_PF_SSI1_TXD);
221 msleep(2);
222}
223
224static struct imx_ssi_platform_data pca100_ssi_pdata = {
225 .ac97_reset = pca100_ac97_cold_reset,
226 .ac97_warm_reset = pca100_ac97_warm_reset,
227 .flags = IMX_SSI_USE_AC97,
228};
229
160static int pca100_sdhc2_init(struct device *dev, irq_handler_t detect_irq, 230static int pca100_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
161 void *data) 231 void *data)
162{ 232{
@@ -182,15 +252,73 @@ static struct imxmmc_platform_data sdhc_pdata = {
182 .exit = pca100_sdhc2_exit, 252 .exit = pca100_sdhc2_exit,
183}; 253};
184 254
255static int otg_phy_init(struct platform_device *pdev)
256{
257 gpio_set_value(OTG_PHY_CS_GPIO, 0);
258 return 0;
259}
260
261static struct mxc_usbh_platform_data otg_pdata = {
262 .init = otg_phy_init,
263 .portsc = MXC_EHCI_MODE_ULPI,
264 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
265};
266
267static int usbh2_phy_init(struct platform_device *pdev)
268{
269 gpio_set_value(USBH2_PHY_CS_GPIO, 0);
270 return 0;
271}
272
273static struct mxc_usbh_platform_data usbh2_pdata = {
274 .init = usbh2_phy_init,
275 .portsc = MXC_EHCI_MODE_ULPI,
276 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
277};
278
279static struct fsl_usb2_platform_data otg_device_pdata = {
280 .operating_mode = FSL_USB2_DR_DEVICE,
281 .phy_mode = FSL_USB2_PHY_ULPI,
282};
283
284static int otg_mode_host;
285
286static int __init pca100_otg_mode(char *options)
287{
288 if (!strcmp(options, "host"))
289 otg_mode_host = 1;
290 else if (!strcmp(options, "device"))
291 otg_mode_host = 0;
292 else
293 pr_info("otg_mode neither \"host\" nor \"device\". "
294 "Defaulting to device\n");
295 return 0;
296}
297__setup("otg_mode=", pca100_otg_mode);
298
185static void __init pca100_init(void) 299static void __init pca100_init(void)
186{ 300{
187 int ret; 301 int ret;
188 302
303 /* SSI unit */
304 mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
305 MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */
306 MXC_AUDMUX_V1_PCR_TFCSEL(3) |
307 MXC_AUDMUX_V1_PCR_TCLKDIR | /* clock is output */
308 MXC_AUDMUX_V1_PCR_RXDSEL(3));
309 mxc_audmux_v1_configure_port(3,
310 MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */
311 MXC_AUDMUX_V1_PCR_TFCSEL(0) |
312 MXC_AUDMUX_V1_PCR_TFSDIR |
313 MXC_AUDMUX_V1_PCR_RXDSEL(0));
314
189 ret = mxc_gpio_setup_multiple_pins(pca100_pins, 315 ret = mxc_gpio_setup_multiple_pins(pca100_pins,
190 ARRAY_SIZE(pca100_pins), "PCA100"); 316 ARRAY_SIZE(pca100_pins), "PCA100");
191 if (ret) 317 if (ret)
192 printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret); 318 printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret);
193 319
320 mxc_register_device(&imx_ssi_device0, &pca100_ssi_pdata);
321
194 mxc_register_device(&mxc_uart_device0, &uart_pdata); 322 mxc_register_device(&mxc_uart_device0, &uart_pdata);
195 323
196 mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN); 324 mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN);
@@ -220,6 +348,29 @@ static void __init pca100_init(void)
220 mxc_register_device(&mxc_spi_device0, &pca100_spi_0_data); 348 mxc_register_device(&mxc_spi_device0, &pca100_spi_0_data);
221#endif 349#endif
222 350
351 gpio_request(OTG_PHY_CS_GPIO, "usb-otg-cs");
352 gpio_direction_output(OTG_PHY_CS_GPIO, 1);
353 gpio_request(USBH2_PHY_CS_GPIO, "usb-host2-cs");
354 gpio_direction_output(USBH2_PHY_CS_GPIO, 1);
355
356#if defined(CONFIG_USB_ULPI)
357 if (otg_mode_host) {
358 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
359 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
360
361 mxc_register_device(&mxc_otg_host, &otg_pdata);
362 }
363
364 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
365 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
366
367 mxc_register_device(&mxc_usbh2, &usbh2_pdata);
368#endif
369 if (!otg_mode_host) {
370 gpio_set_value(OTG_PHY_CS_GPIO, 0);
371 mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata);
372 }
373
223 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 374 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
224} 375}
225 376
diff --git a/arch/arm/mach-mx2/mach-pcm038.c b/arch/arm/mach-mx2/mach-pcm038.c
index 809392b62ded..035fbe046ec0 100644
--- a/arch/arm/mach-mx2/mach-pcm038.c
+++ b/arch/arm/mach-mx2/mach-pcm038.c
@@ -40,6 +40,8 @@
40#include <mach/imx-uart.h> 40#include <mach/imx-uart.h>
41#include <mach/mxc_nand.h> 41#include <mach/mxc_nand.h>
42#include <mach/spi.h> 42#include <mach/spi.h>
43#include <mach/mxc_ehci.h>
44#include <mach/ulpi.h>
43 45
44#include "devices.h" 46#include "devices.h"
45 47
@@ -96,6 +98,19 @@ static int pcm038_pins[] = {
96 PC17_PF_SSI4_RXD, 98 PC17_PF_SSI4_RXD,
97 PC18_PF_SSI4_TXD, 99 PC18_PF_SSI4_TXD,
98 PC19_PF_SSI4_CLK, 100 PC19_PF_SSI4_CLK,
101 /* USB host */
102 PA0_PF_USBH2_CLK,
103 PA1_PF_USBH2_DIR,
104 PA2_PF_USBH2_DATA7,
105 PA3_PF_USBH2_NXT,
106 PA4_PF_USBH2_STP,
107 PD19_AF_USBH2_DATA4,
108 PD20_AF_USBH2_DATA3,
109 PD21_AF_USBH2_DATA6,
110 PD22_AF_USBH2_DATA0,
111 PD23_AF_USBH2_DATA2,
112 PD24_AF_USBH2_DATA1,
113 PD26_AF_USBH2_DATA5,
99}; 114};
100 115
101/* 116/*
@@ -277,6 +292,11 @@ static struct spi_board_info pcm038_spi_board_info[] __initdata = {
277 } 292 }
278}; 293};
279 294
295static struct mxc_usbh_platform_data usbh2_pdata = {
296 .portsc = MXC_EHCI_MODE_ULPI,
297 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI,
298};
299
280static void __init pcm038_init(void) 300static void __init pcm038_init(void)
281{ 301{
282 mxc_gpio_setup_multiple_pins(pcm038_pins, ARRAY_SIZE(pcm038_pins), 302 mxc_gpio_setup_multiple_pins(pcm038_pins, ARRAY_SIZE(pcm038_pins),
@@ -309,6 +329,8 @@ static void __init pcm038_init(void)
309 spi_register_board_info(pcm038_spi_board_info, 329 spi_register_board_info(pcm038_spi_board_info,
310 ARRAY_SIZE(pcm038_spi_board_info)); 330 ARRAY_SIZE(pcm038_spi_board_info));
311 331
332 mxc_register_device(&mxc_usbh2, &usbh2_pdata);
333
312 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 334 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
313 335
314#ifdef CONFIG_MACH_PCM970_BASEBOARD 336#ifdef CONFIG_MACH_PCM970_BASEBOARD