aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/Kconfig2
-rw-r--r--arch/arm/mach-imx/devices-imx27.h4
-rw-r--r--arch/arm/mach-imx/devices.c28
-rw-r--r--arch/arm/mach-imx/devices.h1
-rw-r--r--arch/arm/mach-imx/mach-cpuimx27.c5
-rw-r--r--arch/arm/mach-imx/mach-pca100.c5
-rw-r--r--arch/arm/plat-mxc/devices/Kconfig3
-rw-r--r--arch/arm/plat-mxc/devices/Makefile1
-rw-r--r--arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c41
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h9
10 files changed, 64 insertions, 35 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 025e96925561..e50a164d08f7 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -128,6 +128,7 @@ endchoice
128 128
129config MACH_CPUIMX27 129config MACH_CPUIMX27
130 bool "Eukrea CPUIMX27 module" 130 bool "Eukrea CPUIMX27 module"
131 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
131 select IMX_HAVE_PLATFORM_IMX2_WDT 132 select IMX_HAVE_PLATFORM_IMX2_WDT
132 select IMX_HAVE_PLATFORM_IMX_I2C 133 select IMX_HAVE_PLATFORM_IMX_I2C
133 select IMX_HAVE_PLATFORM_IMX_UART 134 select IMX_HAVE_PLATFORM_IMX_UART
@@ -200,6 +201,7 @@ config MACH_IMX27LITE
200 201
201config MACH_PCA100 202config MACH_PCA100
202 bool "Phytec phyCARD-s (pca100)" 203 bool "Phytec phyCARD-s (pca100)"
204 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
203 select IMX_HAVE_PLATFORM_IMX2_WDT 205 select IMX_HAVE_PLATFORM_IMX2_WDT
204 select IMX_HAVE_PLATFORM_IMX_FB 206 select IMX_HAVE_PLATFORM_IMX_FB
205 select IMX_HAVE_PLATFORM_IMX_I2C 207 select IMX_HAVE_PLATFORM_IMX_I2C
diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h
index 51b91553c590..51bb42d8536e 100644
--- a/arch/arm/mach-imx/devices-imx27.h
+++ b/arch/arm/mach-imx/devices-imx27.h
@@ -13,6 +13,10 @@ extern const struct imx_fec_data imx27_fec_data __initconst;
13#define imx27_add_fec(pdata) \ 13#define imx27_add_fec(pdata) \
14 imx_add_fec(&imx27_fec_data, pdata) 14 imx_add_fec(&imx27_fec_data, pdata)
15 15
16extern const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst;
17#define imx27_add_fsl_usb2_udc(pdata) \
18 imx_add_fsl_usb2_udc(&imx27_fsl_usb2_udc_data, pdata)
19
16extern const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst; 20extern const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst;
17#define imx27_add_imx2_wdt(pdata) \ 21#define imx27_add_imx2_wdt(pdata) \
18 imx_add_imx2_wdt(&imx27_imx2_wdt_data) 22 imx_add_imx2_wdt(&imx27_imx2_wdt_data)
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c
index 2a6d70720e99..d026cfbe6130 100644
--- a/arch/arm/mach-imx/devices.c
+++ b/arch/arm/mach-imx/devices.c
@@ -76,34 +76,6 @@ int __init imx1_register_gpios(void)
76} 76}
77#endif 77#endif
78 78
79#ifdef CONFIG_MACH_MX27
80static struct resource otg_resources[] = {
81 {
82 .start = MX27_USB_OTG_BASE_ADDR,
83 .end = MX27_USB_OTG_BASE_ADDR + 0x1ff,
84 .flags = IORESOURCE_MEM,
85 }, {
86 .start = MX27_INT_USB_OTG,
87 .end = MX27_INT_USB_OTG,
88 .flags = IORESOURCE_IRQ,
89 },
90};
91
92static u64 otg_dmamask = DMA_BIT_MASK(32);
93
94/* OTG gadget device */
95struct platform_device mxc_otg_udc_device = {
96 .name = "fsl-usb2-udc",
97 .id = -1,
98 .dev = {
99 .dma_mask = &otg_dmamask,
100 .coherent_dma_mask = DMA_BIT_MASK(32),
101 },
102 .resource = otg_resources,
103 .num_resources = ARRAY_SIZE(otg_resources),
104};
105#endif
106
107#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27) 79#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27)
108/* GPIO port description */ 80/* GPIO port description */
109#define DEFINE_MXC_GPIO_PORT_IRQ(SOC, n, _irq) \ 81#define DEFINE_MXC_GPIO_PORT_IRQ(SOC, n, _irq) \
diff --git a/arch/arm/mach-imx/devices.h b/arch/arm/mach-imx/devices.h
index 7a00bba3688e..a788566c1938 100644
--- a/arch/arm/mach-imx/devices.h
+++ b/arch/arm/mach-imx/devices.h
@@ -1,5 +1,4 @@
1#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27) 1#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27)
2extern struct platform_device mxc_otg_udc_device;
3extern struct platform_device mx21_usbhc_device; 2extern struct platform_device mx21_usbhc_device;
4extern struct platform_device imx_kpp_device; 3extern struct platform_device imx_kpp_device;
5#endif 4#endif
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index c70b0382363e..9ae5bed90ed8 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -28,7 +28,6 @@
28#include <linux/serial_8250.h> 28#include <linux/serial_8250.h>
29#include <linux/usb/otg.h> 29#include <linux/usb/otg.h>
30#include <linux/usb/ulpi.h> 30#include <linux/usb/ulpi.h>
31#include <linux/fsl_devices.h>
32 31
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
@@ -223,7 +222,7 @@ static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
223}; 222};
224#endif 223#endif
225 224
226static struct fsl_usb2_platform_data otg_device_pdata = { 225static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
227 .operating_mode = FSL_USB2_DR_DEVICE, 226 .operating_mode = FSL_USB2_DR_DEVICE,
228 .phy_mode = FSL_USB2_PHY_ULPI, 227 .phy_mode = FSL_USB2_PHY_ULPI,
229}; 228};
@@ -289,7 +288,7 @@ static void __init eukrea_cpuimx27_init(void)
289 imx27_add_mxc_ehci_hs(2, &usbh2_pdata); 288 imx27_add_mxc_ehci_hs(2, &usbh2_pdata);
290#endif 289#endif
291 if (!otg_mode_host) 290 if (!otg_mode_host)
292 mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); 291 imx27_add_fsl_usb2_udc(&otg_device_pdata);
293 292
294#ifdef CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD 293#ifdef CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD
295 eukrea_mbimx27_baseboard_init(); 294 eukrea_mbimx27_baseboard_init();
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index 683374d94024..d9e2dda437c0 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -29,7 +29,6 @@
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/usb/otg.h> 30#include <linux/usb/otg.h>
31#include <linux/usb/ulpi.h> 31#include <linux/usb/ulpi.h>
32#include <linux/fsl_devices.h>
33 32
34#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
35#include <asm/mach-types.h> 34#include <asm/mach-types.h>
@@ -297,7 +296,7 @@ static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
297}; 296};
298#endif 297#endif
299 298
300static struct fsl_usb2_platform_data otg_device_pdata = { 299static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
301 .operating_mode = FSL_USB2_DR_DEVICE, 300 .operating_mode = FSL_USB2_DR_DEVICE,
302 .phy_mode = FSL_USB2_PHY_ULPI, 301 .phy_mode = FSL_USB2_PHY_ULPI,
303}; 302};
@@ -419,7 +418,7 @@ static void __init pca100_init(void)
419#endif 418#endif
420 if (!otg_mode_host) { 419 if (!otg_mode_host) {
421 gpio_set_value(OTG_PHY_CS_GPIO, 0); 420 gpio_set_value(OTG_PHY_CS_GPIO, 0);
422 mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); 421 imx27_add_fsl_usb2_udc(&otg_device_pdata);
423 } 422 }
424 423
425 imx27_add_imx_fb(&pca100_fb_data); 424 imx27_add_imx_fb(&pca100_fb_data);
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
index d2d096c44c4a..26196d9c04e9 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -9,6 +9,9 @@ config IMX_HAVE_PLATFORM_FLEXCAN
9 select HAVE_CAN_FLEXCAN if CAN 9 select HAVE_CAN_FLEXCAN if CAN
10 bool 10 bool
11 11
12config IMX_HAVE_PLATFORM_FSL_USB2_UDC
13 bool
14
12config IMX_HAVE_PLATFORM_GPIO_KEYS 15config IMX_HAVE_PLATFORM_GPIO_KEYS
13 bool 16 bool
14 default y if ARCH_MX51 17 default y if ARCH_MX51
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
index c8734bd23cc4..e40897ee445f 100644
--- a/arch/arm/plat-mxc/devices/Makefile
+++ b/arch/arm/plat-mxc/devices/Makefile
@@ -1,6 +1,7 @@
1obj-$(CONFIG_IMX_HAVE_PLATFORM_ESDHC) += platform-esdhc.o 1obj-$(CONFIG_IMX_HAVE_PLATFORM_ESDHC) += platform-esdhc.o
2obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o 2obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o
3obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o 3obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
4obj-$(CONFIG_IMX_HAVE_PLATFORM_FSL_USB2_UDC) += platform-fsl-usb2-udc.o
4obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o 5obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o
5obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o 6obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o
6obj-y += platform-imx-dma.o 7obj-y += platform-imx-dma.o
diff --git a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
new file mode 100644
index 000000000000..3116f9ad263f
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
@@ -0,0 +1,41 @@
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <mach/hardware.h>
10#include <mach/devices-common.h>
11
12#define imx_fsl_usb2_udc_data_entry_single(soc) \
13 { \
14 .iobase = soc ## _USB_OTG_BASE_ADDR, \
15 .irq = soc ## _INT_USB_OTG, \
16 }
17
18#ifdef CONFIG_SOC_IMX27
19const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst =
20 imx_fsl_usb2_udc_data_entry_single(MX27);
21#endif /* ifdef CONFIG_SOC_IMX27 */
22
23struct platform_device *__init imx_add_fsl_usb2_udc(
24 const struct imx_fsl_usb2_udc_data *data,
25 const struct fsl_usb2_platform_data *pdata)
26{
27 struct resource res[] = {
28 {
29 .start = data->iobase,
30 .end = data->iobase + SZ_512 - 1,
31 .flags = IORESOURCE_MEM,
32 }, {
33 .start = data->irq,
34 .end = data->irq,
35 .flags = IORESOURCE_IRQ,
36 },
37 };
38 return imx_add_platform_device_dmamask("fsl-usb2-udc", -1,
39 res, ARRAY_SIZE(res),
40 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
41}
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index 7df7a9f8c5ed..f01fd28dd4f6 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -44,6 +44,15 @@ struct platform_device *__init imx_add_flexcan(
44 const struct imx_flexcan_data *data, 44 const struct imx_flexcan_data *data,
45 const struct flexcan_platform_data *pdata); 45 const struct flexcan_platform_data *pdata);
46 46
47#include <linux/fsl_devices.h>
48struct imx_fsl_usb2_udc_data {
49 resource_size_t iobase;
50 resource_size_t irq;
51};
52struct platform_device *__init imx_add_fsl_usb2_udc(
53 const struct imx_fsl_usb2_udc_data *data,
54 const struct fsl_usb2_platform_data *pdata);
55
47#include <linux/gpio_keys.h> 56#include <linux/gpio_keys.h>
48struct platform_device *__init imx_add_gpio_keys( 57struct platform_device *__init imx_add_gpio_keys(
49 const struct gpio_keys_platform_data *pdata); 58 const struct gpio_keys_platform_data *pdata);