diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-05 13:52:09 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-17 04:01:31 -0500 |
commit | 2eb42d5c287f5e883a4b3ebe668ba880caa351e5 (patch) | |
tree | 05bba579ebdc9d945658f76f0b6476a65b69b3c3 /arch/arm/plat-mxc | |
parent | 9d3d945a8d5be2c915f646e8dff8422486a77030 (diff) |
ARM: imx: dynamically allocate mxc-ehci devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r-- | arch/arm/plat-mxc/devices/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-mxc-ehci.c | 46 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/devices-common.h | 10 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx27.h | 12 |
5 files changed, 67 insertions, 5 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index 6560cf5180b6..d2d096c44c4a 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig | |||
@@ -37,6 +37,9 @@ config IMX_HAVE_PLATFORM_MX1_CAMERA | |||
37 | config IMX_HAVE_PLATFORM_MX2_CAMERA | 37 | config IMX_HAVE_PLATFORM_MX2_CAMERA |
38 | bool | 38 | bool |
39 | 39 | ||
40 | config IMX_HAVE_PLATFORM_MXC_EHCI | ||
41 | bool | ||
42 | |||
40 | config IMX_HAVE_PLATFORM_MXC_MMC | 43 | config IMX_HAVE_PLATFORM_MXC_MMC |
41 | bool | 44 | bool |
42 | 45 | ||
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index d2b7a9196ab4..c8734bd23cc4 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile | |||
@@ -11,6 +11,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o | |||
11 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o | 11 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o |
12 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o | 12 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o |
13 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o | 13 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o |
14 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o | ||
14 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o | 15 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o |
15 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o | 16 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o |
16 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o | 17 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o |
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c new file mode 100644 index 000000000000..0cb67bb6e5b1 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c | |||
@@ -0,0 +1,46 @@ | |||
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_mxc_ehci_data_entry_single(soc, _id, hs) \ | ||
13 | { \ | ||
14 | .id = _id, \ | ||
15 | .iobase = soc ## _USB_ ## hs ## _BASE_ADDR, \ | ||
16 | .irq = soc ## _INT_USB_ ## hs, \ | ||
17 | } | ||
18 | |||
19 | #ifdef CONFIG_SOC_IMX27 | ||
20 | const struct imx_mxc_ehci_data imx27_mxc_ehci_otg_data __initconst = | ||
21 | imx_mxc_ehci_data_entry_single(MX27, 0, OTG); | ||
22 | const struct imx_mxc_ehci_data imx27_mxc_ehci_hs_data[] __initconst = { | ||
23 | imx_mxc_ehci_data_entry_single(MX27, 1, HS1), | ||
24 | imx_mxc_ehci_data_entry_single(MX27, 2, HS2), | ||
25 | }; | ||
26 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
27 | |||
28 | struct platform_device *__init imx_add_mxc_ehci( | ||
29 | const struct imx_mxc_ehci_data *data, | ||
30 | const struct mxc_usbh_platform_data *pdata) | ||
31 | { | ||
32 | struct resource res[] = { | ||
33 | { | ||
34 | .start = data->iobase, | ||
35 | .end = data->iobase + SZ_512 - 1, | ||
36 | .flags = IORESOURCE_MEM, | ||
37 | }, { | ||
38 | .start = data->irq, | ||
39 | .end = data->irq, | ||
40 | .flags = IORESOURCE_IRQ, | ||
41 | }, | ||
42 | }; | ||
43 | return imx_add_platform_device_dmamask("mxc-ehci", data->id, | ||
44 | res, ARRAY_SIZE(res), | ||
45 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | ||
46 | } | ||
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index bb3b29c7fc35..7df7a9f8c5ed 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h | |||
@@ -151,6 +151,16 @@ struct platform_device *__init imx_add_mx2_camera( | |||
151 | const struct imx_mx2_camera_data *data, | 151 | const struct imx_mx2_camera_data *data, |
152 | const struct mx2_camera_platform_data *pdata); | 152 | const struct mx2_camera_platform_data *pdata); |
153 | 153 | ||
154 | #include <mach/mxc_ehci.h> | ||
155 | struct imx_mxc_ehci_data { | ||
156 | int id; | ||
157 | resource_size_t iobase; | ||
158 | resource_size_t irq; | ||
159 | }; | ||
160 | struct platform_device *__init imx_add_mxc_ehci( | ||
161 | const struct imx_mxc_ehci_data *data, | ||
162 | const struct mxc_usbh_platform_data *pdata); | ||
163 | |||
154 | #include <mach/mmc.h> | 164 | #include <mach/mmc.h> |
155 | struct imx_mxc_mmc_data { | 165 | struct imx_mxc_mmc_data { |
156 | int id; | 166 | int id; |
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h index 2734d24e8e1c..45419b3a2d1e 100644 --- a/arch/arm/plat-mxc/include/mach/mx27.h +++ b/arch/arm/plat-mxc/include/mach/mx27.h | |||
@@ -64,8 +64,10 @@ | |||
64 | #define MX27_LCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x21000) | 64 | #define MX27_LCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x21000) |
65 | #define MX27_SLCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x22000) | 65 | #define MX27_SLCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x22000) |
66 | #define MX27_VPU_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x23000) | 66 | #define MX27_VPU_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x23000) |
67 | #define MX27_USBOTG_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x24000) | 67 | #define MX27_USB_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x24000) |
68 | #define MX27_OTG_BASE_ADDR MX27_USBOTG_BASE_ADDR | 68 | #define MX27_USB_OTG_BASE_ADDR (MX27_USB_BASE_ADDR + 0x0000) |
69 | #define MX27_USB_HS1_BASE_ADDR (MX27_USB_BASE_ADDR + 0x0200) | ||
70 | #define MX27_USB_HS2_BASE_ADDR (MX27_USB_BASE_ADDR + 0x0400) | ||
69 | #define MX27_SAHARA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x25000) | 71 | #define MX27_SAHARA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x25000) |
70 | #define MX27_EMMAPP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26000) | 72 | #define MX27_EMMAPP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26000) |
71 | #define MX27_EMMAPRP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26400) | 73 | #define MX27_EMMAPRP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26400) |
@@ -187,9 +189,9 @@ static inline void mx27_setup_weimcs(size_t cs, | |||
187 | #define MX27_INT_EMMAPRP 51 | 189 | #define MX27_INT_EMMAPRP 51 |
188 | #define MX27_INT_EMMAPP 52 | 190 | #define MX27_INT_EMMAPP 52 |
189 | #define MX27_INT_VPU 53 | 191 | #define MX27_INT_VPU 53 |
190 | #define MX27_INT_USB1 54 | 192 | #define MX27_INT_USB_HS1 54 |
191 | #define MX27_INT_USB2 55 | 193 | #define MX27_INT_USB_HS2 55 |
192 | #define MX27_INT_USB3 56 | 194 | #define MX27_INT_USB_OTG 56 |
193 | #define MX27_INT_SCC_SMN 57 | 195 | #define MX27_INT_SCC_SMN 57 |
194 | #define MX27_INT_SCC_SCM 58 | 196 | #define MX27_INT_SCC_SCM 58 |
195 | #define MX27_INT_SAHARA 59 | 197 | #define MX27_INT_SAHARA 59 |