aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/devices
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
commitfcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch)
treea57612d1888735a2ec7972891b68c1ac5ec8faea /arch/arm/plat-mxc/devices
parent8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff)
Added missing tegra files.HEADmaster
Diffstat (limited to 'arch/arm/plat-mxc/devices')
-rw-r--r--arch/arm/plat-mxc/devices/Kconfig78
-rw-r--r--arch/arm/plat-mxc/devices/Makefile27
-rw-r--r--arch/arm/plat-mxc/devices/platform-fec.c74
-rw-r--r--arch/arm/plat-mxc/devices/platform-flexcan.c58
-rw-r--r--arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c57
-rw-r--r--arch/arm/plat-mxc/devices/platform-gpio-mxc.c32
-rw-r--r--arch/arm/plat-mxc/devices/platform-gpio_keys.c27
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-dma.c34
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-fb.c58
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-i2c.c120
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-keypad.c72
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-ssi.c118
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-uart.c178
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx2-wdt.c77
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx21-hcd.c41
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx_udc.c75
-rw-r--r--arch/arm/plat-mxc/devices/platform-imxdi_rtc.c41
-rw-r--r--arch/arm/plat-mxc/devices/platform-ipu-core.c130
-rw-r--r--arch/arm/plat-mxc/devices/platform-mx1-camera.c42
-rw-r--r--arch/arm/plat-mxc/devices/platform-mx2-camera.c64
-rw-r--r--arch/arm/plat-mxc/devices/platform-mxc-ehci.c70
-rw-r--r--arch/arm/plat-mxc/devices/platform-mxc-mmc.c73
-rw-r--r--arch/arm/plat-mxc/devices/platform-mxc_nand.c83
-rw-r--r--arch/arm/plat-mxc/devices/platform-mxc_pwm.c69
-rw-r--r--arch/arm/plat-mxc/devices/platform-mxc_rnga.c56
-rw-r--r--arch/arm/plat-mxc/devices/platform-mxc_rtc.c40
-rw-r--r--arch/arm/plat-mxc/devices/platform-mxc_w1.c50
-rw-r--r--arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c99
-rw-r--r--arch/arm/plat-mxc/devices/platform-spi_imx.c127
29 files changed, 2070 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
new file mode 100644
index 00000000000..bd294add932
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -0,0 +1,78 @@
1config IMX_HAVE_PLATFORM_FEC
2 bool
3 default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX51 || SOC_IMX53
4
5config IMX_HAVE_PLATFORM_FLEXCAN
6 select HAVE_CAN_FLEXCAN if CAN
7 bool
8
9config IMX_HAVE_PLATFORM_FSL_USB2_UDC
10 bool
11
12config IMX_HAVE_PLATFORM_GPIO_KEYS
13 bool
14 default y if SOC_IMX51
15
16config IMX_HAVE_PLATFORM_IMX21_HCD
17 bool
18
19config IMX_HAVE_PLATFORM_IMX2_WDT
20 bool
21
22config IMX_HAVE_PLATFORM_IMXDI_RTC
23 bool
24
25config IMX_HAVE_PLATFORM_IMX_FB
26 bool
27
28config IMX_HAVE_PLATFORM_IMX_I2C
29 bool
30
31config IMX_HAVE_PLATFORM_IMX_KEYPAD
32 bool
33
34config IMX_HAVE_PLATFORM_IMX_SSI
35 bool
36
37config IMX_HAVE_PLATFORM_IMX_UART
38 bool
39
40config IMX_HAVE_PLATFORM_IMX_UDC
41 bool
42
43config IMX_HAVE_PLATFORM_IPU_CORE
44 bool
45
46config IMX_HAVE_PLATFORM_MX1_CAMERA
47 bool
48
49config IMX_HAVE_PLATFORM_MX2_CAMERA
50 bool
51
52config IMX_HAVE_PLATFORM_MXC_EHCI
53 bool
54
55config IMX_HAVE_PLATFORM_MXC_MMC
56 bool
57
58config IMX_HAVE_PLATFORM_MXC_NAND
59 bool
60
61config IMX_HAVE_PLATFORM_MXC_PWM
62 bool
63
64config IMX_HAVE_PLATFORM_MXC_RNGA
65 bool
66 select ARCH_HAS_RNGA
67
68config IMX_HAVE_PLATFORM_MXC_RTC
69 bool
70
71config IMX_HAVE_PLATFORM_MXC_W1
72 bool
73
74config IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
75 bool
76
77config IMX_HAVE_PLATFORM_SPI_IMX
78 bool
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
new file mode 100644
index 00000000000..b41bf972b54
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/Makefile
@@ -0,0 +1,27 @@
1obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o
2obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
3obj-$(CONFIG_IMX_HAVE_PLATFORM_FSL_USB2_UDC) += platform-fsl-usb2-udc.o
4obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o
5obj-y += platform-gpio-mxc.o
6obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX21_HCD) += platform-imx21-hcd.o
7obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o
8obj-$(CONFIG_IMX_HAVE_PLATFORM_IMXDI_RTC) += platform-imxdi_rtc.o
9obj-y += platform-imx-dma.o
10obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_FB) += platform-imx-fb.o
11obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o
12obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_KEYPAD) += platform-imx-keypad.o
13obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
14obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o
15obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o
16obj-$(CONFIG_IMX_HAVE_PLATFORM_IPU_CORE) += platform-ipu-core.o
17obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o
18obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o
19obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o
20obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o
21obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o
22obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o
23obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o
24obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o
25obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o
26obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o
27obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o
diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/plat-mxc/devices/platform-fec.c
new file mode 100644
index 00000000000..0bae44e890d
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-fec.c
@@ -0,0 +1,74 @@
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 <linux/dma-mapping.h>
10#include <asm/sizes.h>
11#include <mach/hardware.h>
12#include <mach/devices-common.h>
13
14#define imx_fec_data_entry_single(soc, _devid) \
15 { \
16 .devid = _devid, \
17 .iobase = soc ## _FEC_BASE_ADDR, \
18 .irq = soc ## _INT_FEC, \
19 }
20
21#ifdef CONFIG_SOC_IMX25
22const struct imx_fec_data imx25_fec_data __initconst =
23 imx_fec_data_entry_single(MX25, "imx25-fec");
24#endif /* ifdef CONFIG_SOC_IMX25 */
25
26#ifdef CONFIG_SOC_IMX27
27const struct imx_fec_data imx27_fec_data __initconst =
28 imx_fec_data_entry_single(MX27, "imx27-fec");
29#endif /* ifdef CONFIG_SOC_IMX27 */
30
31#ifdef CONFIG_SOC_IMX35
32/* i.mx35 has the i.mx27 type fec */
33const struct imx_fec_data imx35_fec_data __initconst =
34 imx_fec_data_entry_single(MX35, "imx27-fec");
35#endif
36
37#ifdef CONFIG_SOC_IMX50
38/* i.mx50 has the i.mx25 type fec */
39const struct imx_fec_data imx50_fec_data __initconst =
40 imx_fec_data_entry_single(MX50, "imx25-fec");
41#endif
42
43#ifdef CONFIG_SOC_IMX51
44/* i.mx51 has the i.mx27 type fec */
45const struct imx_fec_data imx51_fec_data __initconst =
46 imx_fec_data_entry_single(MX51, "imx27-fec");
47#endif
48
49#ifdef CONFIG_SOC_IMX53
50/* i.mx53 has the i.mx25 type fec */
51const struct imx_fec_data imx53_fec_data __initconst =
52 imx_fec_data_entry_single(MX53, "imx25-fec");
53#endif
54
55struct platform_device *__init imx_add_fec(
56 const struct imx_fec_data *data,
57 const struct fec_platform_data *pdata)
58{
59 struct resource res[] = {
60 {
61 .start = data->iobase,
62 .end = data->iobase + SZ_4K - 1,
63 .flags = IORESOURCE_MEM,
64 }, {
65 .start = data->irq,
66 .end = data->irq,
67 .flags = IORESOURCE_IRQ,
68 },
69 };
70
71 return imx_add_platform_device_dmamask(data->devid, 0,
72 res, ARRAY_SIZE(res),
73 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
74}
diff --git a/arch/arm/plat-mxc/devices/platform-flexcan.c b/arch/arm/plat-mxc/devices/platform-flexcan.c
new file mode 100644
index 00000000000..4e8497af2eb
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-flexcan.c
@@ -0,0 +1,58 @@
1/*
2 * Copyright (C) 2010 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8#include <mach/hardware.h>
9#include <mach/devices-common.h>
10
11#define imx_flexcan_data_entry_single(soc, _id, _hwid, _size) \
12 { \
13 .id = _id, \
14 .iobase = soc ## _CAN ## _hwid ## _BASE_ADDR, \
15 .iosize = _size, \
16 .irq = soc ## _INT_CAN ## _hwid, \
17 }
18
19#define imx_flexcan_data_entry(soc, _id, _hwid, _size) \
20 [_id] = imx_flexcan_data_entry_single(soc, _id, _hwid, _size)
21
22#ifdef CONFIG_SOC_IMX25
23const struct imx_flexcan_data imx25_flexcan_data[] __initconst = {
24#define imx25_flexcan_data_entry(_id, _hwid) \
25 imx_flexcan_data_entry(MX25, _id, _hwid, SZ_16K)
26 imx25_flexcan_data_entry(0, 1),
27 imx25_flexcan_data_entry(1, 2),
28};
29#endif /* ifdef CONFIG_SOC_IMX25 */
30
31#ifdef CONFIG_SOC_IMX35
32const struct imx_flexcan_data imx35_flexcan_data[] __initconst = {
33#define imx35_flexcan_data_entry(_id, _hwid) \
34 imx_flexcan_data_entry(MX35, _id, _hwid, SZ_16K)
35 imx35_flexcan_data_entry(0, 1),
36 imx35_flexcan_data_entry(1, 2),
37};
38#endif /* ifdef CONFIG_SOC_IMX35 */
39
40struct platform_device *__init imx_add_flexcan(
41 const struct imx_flexcan_data *data,
42 const struct flexcan_platform_data *pdata)
43{
44 struct resource res[] = {
45 {
46 .start = data->iobase,
47 .end = data->iobase + data->iosize - 1,
48 .flags = IORESOURCE_MEM,
49 }, {
50 .start = data->irq,
51 .end = data->irq,
52 .flags = IORESOURCE_IRQ,
53 },
54 };
55
56 return imx_add_platform_device("flexcan", data->id,
57 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
58}
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 00000000000..23ce08e6ffd
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
@@ -0,0 +1,57 @@
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 <linux/dma-mapping.h>
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12
13#define imx_fsl_usb2_udc_data_entry_single(soc) \
14 { \
15 .iobase = soc ## _USB_OTG_BASE_ADDR, \
16 .irq = soc ## _INT_USB_OTG, \
17 }
18
19#ifdef CONFIG_SOC_IMX25
20const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst =
21 imx_fsl_usb2_udc_data_entry_single(MX25);
22#endif /* ifdef CONFIG_SOC_IMX25 */
23
24#ifdef CONFIG_SOC_IMX27
25const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst =
26 imx_fsl_usb2_udc_data_entry_single(MX27);
27#endif /* ifdef CONFIG_SOC_IMX27 */
28
29#ifdef CONFIG_SOC_IMX31
30const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data __initconst =
31 imx_fsl_usb2_udc_data_entry_single(MX31);
32#endif /* ifdef CONFIG_SOC_IMX31 */
33
34#ifdef CONFIG_SOC_IMX35
35const struct imx_fsl_usb2_udc_data imx35_fsl_usb2_udc_data __initconst =
36 imx_fsl_usb2_udc_data_entry_single(MX35);
37#endif /* ifdef CONFIG_SOC_IMX35 */
38
39struct platform_device *__init imx_add_fsl_usb2_udc(
40 const struct imx_fsl_usb2_udc_data *data,
41 const struct fsl_usb2_platform_data *pdata)
42{
43 struct resource res[] = {
44 {
45 .start = data->iobase,
46 .end = data->iobase + SZ_512 - 1,
47 .flags = IORESOURCE_MEM,
48 }, {
49 .start = data->irq,
50 .end = data->irq,
51 .flags = IORESOURCE_IRQ,
52 },
53 };
54 return imx_add_platform_device_dmamask("fsl-usb2-udc", -1,
55 res, ARRAY_SIZE(res),
56 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
57}
diff --git a/arch/arm/plat-mxc/devices/platform-gpio-mxc.c b/arch/arm/plat-mxc/devices/platform-gpio-mxc.c
new file mode 100644
index 00000000000..a7919a24103
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-gpio-mxc.c
@@ -0,0 +1,32 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2011 Linaro Limited
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/devices-common.h>
10
11struct platform_device *__init mxc_register_gpio(char *name, int id,
12 resource_size_t iobase, resource_size_t iosize, int irq, int irq_high)
13{
14 struct resource res[] = {
15 {
16 .start = iobase,
17 .end = iobase + iosize - 1,
18 .flags = IORESOURCE_MEM,
19 }, {
20 .start = irq,
21 .end = irq,
22 .flags = IORESOURCE_IRQ,
23 }, {
24 .start = irq_high,
25 .end = irq_high,
26 .flags = IORESOURCE_IRQ,
27 },
28 };
29
30 return platform_device_register_resndata(&mxc_aips_bus,
31 name, id, res, ARRAY_SIZE(res), NULL, 0);
32}
diff --git a/arch/arm/plat-mxc/devices/platform-gpio_keys.c b/arch/arm/plat-mxc/devices/platform-gpio_keys.c
new file mode 100644
index 00000000000..1c53a532ea0
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-gpio_keys.c
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18#include <asm/sizes.h>
19#include <mach/hardware.h>
20#include <mach/devices-common.h>
21
22struct platform_device *__init imx_add_gpio_keys(
23 const struct gpio_keys_platform_data *pdata)
24{
25 return imx_add_platform_device("gpio-keys", -1, NULL,
26 0, pdata, sizeof(*pdata));
27}
diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/plat-mxc/devices/platform-imx-dma.c
new file mode 100644
index 00000000000..7fa7e9c9246
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imx-dma.c
@@ -0,0 +1,34 @@
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/devices-common.h>
10
11struct platform_device __init __maybe_unused *imx_add_imx_dma(void)
12{
13 return platform_device_register_resndata(&mxc_ahb_bus,
14 "imx-dma", -1, NULL, 0, NULL, 0);
15}
16
17struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name,
18 resource_size_t iobase, int irq, struct sdma_platform_data *pdata)
19{
20 struct resource res[] = {
21 {
22 .start = iobase,
23 .end = iobase + SZ_16K - 1,
24 .flags = IORESOURCE_MEM,
25 }, {
26 .start = irq,
27 .end = irq,
28 .flags = IORESOURCE_IRQ,
29 },
30 };
31
32 return platform_device_register_resndata(&mxc_ahb_bus, name,
33 -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
34}
diff --git a/arch/arm/plat-mxc/devices/platform-imx-fb.c b/arch/arm/plat-mxc/devices/platform-imx-fb.c
new file mode 100644
index 00000000000..2b0b5e0aa99
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imx-fb.c
@@ -0,0 +1,58 @@
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 <linux/dma-mapping.h>
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12
13#define imx_imx_fb_data_entry_single(soc, _size) \
14 { \
15 .iobase = soc ## _LCDC_BASE_ADDR, \
16 .iosize = _size, \
17 .irq = soc ## _INT_LCDC, \
18 }
19
20#ifdef CONFIG_SOC_IMX1
21const struct imx_imx_fb_data imx1_imx_fb_data __initconst =
22 imx_imx_fb_data_entry_single(MX1, SZ_4K);
23#endif /* ifdef CONFIG_SOC_IMX1 */
24
25#ifdef CONFIG_SOC_IMX21
26const struct imx_imx_fb_data imx21_imx_fb_data __initconst =
27 imx_imx_fb_data_entry_single(MX21, SZ_4K);
28#endif /* ifdef CONFIG_SOC_IMX21 */
29
30#ifdef CONFIG_SOC_IMX25
31const struct imx_imx_fb_data imx25_imx_fb_data __initconst =
32 imx_imx_fb_data_entry_single(MX25, SZ_16K);
33#endif /* ifdef CONFIG_SOC_IMX25 */
34
35#ifdef CONFIG_SOC_IMX27
36const struct imx_imx_fb_data imx27_imx_fb_data __initconst =
37 imx_imx_fb_data_entry_single(MX27, SZ_4K);
38#endif /* ifdef CONFIG_SOC_IMX27 */
39
40struct platform_device *__init imx_add_imx_fb(
41 const struct imx_imx_fb_data *data,
42 const struct imx_fb_platform_data *pdata)
43{
44 struct resource res[] = {
45 {
46 .start = data->iobase,
47 .end = data->iobase + data->iosize - 1,
48 .flags = IORESOURCE_MEM,
49 }, {
50 .start = data->irq,
51 .end = data->irq,
52 .flags = IORESOURCE_IRQ,
53 },
54 };
55 return imx_add_platform_device_dmamask("imx-fb", 0,
56 res, ARRAY_SIZE(res),
57 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
58}
diff --git a/arch/arm/plat-mxc/devices/platform-imx-i2c.c b/arch/arm/plat-mxc/devices/platform-imx-i2c.c
new file mode 100644
index 00000000000..afe60f7244a
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imx-i2c.c
@@ -0,0 +1,120 @@
1/*
2 * Copyright (C) 2009-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_imx_i2c_data_entry_single(soc, _id, _hwid, _size) \
13 { \
14 .id = _id, \
15 .iobase = soc ## _I2C ## _hwid ## _BASE_ADDR, \
16 .iosize = _size, \
17 .irq = soc ## _INT_I2C ## _hwid, \
18 }
19
20#define imx_imx_i2c_data_entry(soc, _id, _hwid, _size) \
21 [_id] = imx_imx_i2c_data_entry_single(soc, _id, _hwid, _size)
22
23#ifdef CONFIG_SOC_IMX1
24const struct imx_imx_i2c_data imx1_imx_i2c_data __initconst =
25 imx_imx_i2c_data_entry_single(MX1, 0, , SZ_4K);
26#endif /* ifdef CONFIG_SOC_IMX1 */
27
28#ifdef CONFIG_SOC_IMX21
29const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst =
30 imx_imx_i2c_data_entry_single(MX21, 0, , SZ_4K);
31#endif /* ifdef CONFIG_SOC_IMX21 */
32
33#ifdef CONFIG_SOC_IMX25
34const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst = {
35#define imx25_imx_i2c_data_entry(_id, _hwid) \
36 imx_imx_i2c_data_entry(MX25, _id, _hwid, SZ_16K)
37 imx25_imx_i2c_data_entry(0, 1),
38 imx25_imx_i2c_data_entry(1, 2),
39 imx25_imx_i2c_data_entry(2, 3),
40};
41#endif /* ifdef CONFIG_SOC_IMX25 */
42
43#ifdef CONFIG_SOC_IMX27
44const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst = {
45#define imx27_imx_i2c_data_entry(_id, _hwid) \
46 imx_imx_i2c_data_entry(MX27, _id, _hwid, SZ_4K)
47 imx27_imx_i2c_data_entry(0, 1),
48 imx27_imx_i2c_data_entry(1, 2),
49};
50#endif /* ifdef CONFIG_SOC_IMX27 */
51
52#ifdef CONFIG_SOC_IMX31
53const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst = {
54#define imx31_imx_i2c_data_entry(_id, _hwid) \
55 imx_imx_i2c_data_entry(MX31, _id, _hwid, SZ_4K)
56 imx31_imx_i2c_data_entry(0, 1),
57 imx31_imx_i2c_data_entry(1, 2),
58 imx31_imx_i2c_data_entry(2, 3),
59};
60#endif /* ifdef CONFIG_SOC_IMX31 */
61
62#ifdef CONFIG_SOC_IMX35
63const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = {
64#define imx35_imx_i2c_data_entry(_id, _hwid) \
65 imx_imx_i2c_data_entry(MX35, _id, _hwid, SZ_4K)
66 imx35_imx_i2c_data_entry(0, 1),
67 imx35_imx_i2c_data_entry(1, 2),
68 imx35_imx_i2c_data_entry(2, 3),
69};
70#endif /* ifdef CONFIG_SOC_IMX35 */
71
72#ifdef CONFIG_SOC_IMX50
73const struct imx_imx_i2c_data imx50_imx_i2c_data[] __initconst = {
74#define imx50_imx_i2c_data_entry(_id, _hwid) \
75 imx_imx_i2c_data_entry(MX50, _id, _hwid, SZ_4K)
76 imx50_imx_i2c_data_entry(0, 1),
77 imx50_imx_i2c_data_entry(1, 2),
78 imx50_imx_i2c_data_entry(2, 3),
79};
80#endif /* ifdef CONFIG_SOC_IMX51 */
81
82#ifdef CONFIG_SOC_IMX51
83const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = {
84#define imx51_imx_i2c_data_entry(_id, _hwid) \
85 imx_imx_i2c_data_entry(MX51, _id, _hwid, SZ_4K)
86 imx51_imx_i2c_data_entry(0, 1),
87 imx51_imx_i2c_data_entry(1, 2),
88};
89#endif /* ifdef CONFIG_SOC_IMX51 */
90
91#ifdef CONFIG_SOC_IMX53
92const struct imx_imx_i2c_data imx53_imx_i2c_data[] __initconst = {
93#define imx53_imx_i2c_data_entry(_id, _hwid) \
94 imx_imx_i2c_data_entry(MX53, _id, _hwid, SZ_4K)
95 imx53_imx_i2c_data_entry(0, 1),
96 imx53_imx_i2c_data_entry(1, 2),
97 imx53_imx_i2c_data_entry(2, 3),
98};
99#endif /* ifdef CONFIG_SOC_IMX53 */
100
101struct platform_device *__init imx_add_imx_i2c(
102 const struct imx_imx_i2c_data *data,
103 const struct imxi2c_platform_data *pdata)
104{
105 struct resource res[] = {
106 {
107 .start = data->iobase,
108 .end = data->iobase + data->iosize - 1,
109 .flags = IORESOURCE_MEM,
110 }, {
111 .start = data->irq,
112 .end = data->irq,
113 .flags = IORESOURCE_IRQ,
114 },
115 };
116
117 return imx_add_platform_device("imx-i2c", data->id,
118 res, ARRAY_SIZE(res),
119 pdata, sizeof(*pdata));
120}
diff --git a/arch/arm/plat-mxc/devices/platform-imx-keypad.c b/arch/arm/plat-mxc/devices/platform-imx-keypad.c
new file mode 100644
index 00000000000..479c3e9f771
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imx-keypad.c
@@ -0,0 +1,72 @@
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_imx_keypad_data_entry_single(soc, _size) \
13 { \
14 .iobase = soc ## _KPP_BASE_ADDR, \
15 .iosize = _size, \
16 .irq = soc ## _INT_KPP, \
17 }
18
19#ifdef CONFIG_SOC_IMX21
20const struct imx_imx_keypad_data imx21_imx_keypad_data __initconst =
21 imx_imx_keypad_data_entry_single(MX21, SZ_16);
22#endif /* ifdef CONFIG_SOC_IMX21 */
23
24#ifdef CONFIG_SOC_IMX25
25const struct imx_imx_keypad_data imx25_imx_keypad_data __initconst =
26 imx_imx_keypad_data_entry_single(MX25, SZ_16K);
27#endif /* ifdef CONFIG_SOC_IMX25 */
28
29#ifdef CONFIG_SOC_IMX27
30const struct imx_imx_keypad_data imx27_imx_keypad_data __initconst =
31 imx_imx_keypad_data_entry_single(MX27, SZ_16);
32#endif /* ifdef CONFIG_SOC_IMX27 */
33
34#ifdef CONFIG_SOC_IMX31
35const struct imx_imx_keypad_data imx31_imx_keypad_data __initconst =
36 imx_imx_keypad_data_entry_single(MX31, SZ_16);
37#endif /* ifdef CONFIG_SOC_IMX31 */
38
39#ifdef CONFIG_SOC_IMX35
40const struct imx_imx_keypad_data imx35_imx_keypad_data __initconst =
41 imx_imx_keypad_data_entry_single(MX35, SZ_16);
42#endif /* ifdef CONFIG_SOC_IMX35 */
43
44#ifdef CONFIG_SOC_IMX51
45const struct imx_imx_keypad_data imx51_imx_keypad_data __initconst =
46 imx_imx_keypad_data_entry_single(MX51, SZ_16);
47#endif /* ifdef CONFIG_SOC_IMX51 */
48
49#ifdef CONFIG_SOC_IMX53
50const struct imx_imx_keypad_data imx53_imx_keypad_data __initconst =
51 imx_imx_keypad_data_entry_single(MX53, SZ_16);
52#endif /* ifdef CONFIG_SOC_IMX53 */
53
54struct platform_device *__init imx_add_imx_keypad(
55 const struct imx_imx_keypad_data *data,
56 const struct matrix_keymap_data *pdata)
57{
58 struct resource res[] = {
59 {
60 .start = data->iobase,
61 .end = data->iobase + data->iosize - 1,
62 .flags = IORESOURCE_MEM,
63 }, {
64 .start = data->irq,
65 .end = data->irq,
66 .flags = IORESOURCE_IRQ,
67 },
68 };
69
70 return imx_add_platform_device("imx-keypad", -1,
71 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
72}
diff --git a/arch/arm/plat-mxc/devices/platform-imx-ssi.c b/arch/arm/plat-mxc/devices/platform-imx-ssi.c
new file mode 100644
index 00000000000..21c6f30e101
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imx-ssi.c
@@ -0,0 +1,118 @@
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_imx_ssi_data_entry(soc, _id, _hwid, _size) \
13 [_id] = { \
14 .id = _id, \
15 .iobase = soc ## _SSI ## _hwid ## _BASE_ADDR, \
16 .iosize = _size, \
17 .irq = soc ## _INT_SSI ## _hwid, \
18 .dmatx0 = soc ## _DMA_REQ_SSI ## _hwid ## _TX0, \
19 .dmarx0 = soc ## _DMA_REQ_SSI ## _hwid ## _RX0, \
20 .dmatx1 = soc ## _DMA_REQ_SSI ## _hwid ## _TX1, \
21 .dmarx1 = soc ## _DMA_REQ_SSI ## _hwid ## _RX1, \
22 }
23
24#ifdef CONFIG_SOC_IMX21
25const struct imx_imx_ssi_data imx21_imx_ssi_data[] __initconst = {
26#define imx21_imx_ssi_data_entry(_id, _hwid) \
27 imx_imx_ssi_data_entry(MX21, _id, _hwid, SZ_4K)
28 imx21_imx_ssi_data_entry(0, 1),
29 imx21_imx_ssi_data_entry(1, 2),
30};
31#endif /* ifdef CONFIG_SOC_IMX21 */
32
33#ifdef CONFIG_SOC_IMX25
34const struct imx_imx_ssi_data imx25_imx_ssi_data[] __initconst = {
35#define imx25_imx_ssi_data_entry(_id, _hwid) \
36 imx_imx_ssi_data_entry(MX25, _id, _hwid, SZ_4K)
37 imx25_imx_ssi_data_entry(0, 1),
38 imx25_imx_ssi_data_entry(1, 2),
39};
40#endif /* ifdef CONFIG_SOC_IMX25 */
41
42#ifdef CONFIG_SOC_IMX27
43const struct imx_imx_ssi_data imx27_imx_ssi_data[] __initconst = {
44#define imx27_imx_ssi_data_entry(_id, _hwid) \
45 imx_imx_ssi_data_entry(MX27, _id, _hwid, SZ_4K)
46 imx27_imx_ssi_data_entry(0, 1),
47 imx27_imx_ssi_data_entry(1, 2),
48};
49#endif /* ifdef CONFIG_SOC_IMX27 */
50
51#ifdef CONFIG_SOC_IMX31
52const struct imx_imx_ssi_data imx31_imx_ssi_data[] __initconst = {
53#define imx31_imx_ssi_data_entry(_id, _hwid) \
54 imx_imx_ssi_data_entry(MX31, _id, _hwid, SZ_4K)
55 imx31_imx_ssi_data_entry(0, 1),
56 imx31_imx_ssi_data_entry(1, 2),
57};
58#endif /* ifdef CONFIG_SOC_IMX31 */
59
60#ifdef CONFIG_SOC_IMX35
61const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst = {
62#define imx35_imx_ssi_data_entry(_id, _hwid) \
63 imx_imx_ssi_data_entry(MX35, _id, _hwid, SZ_4K)
64 imx35_imx_ssi_data_entry(0, 1),
65 imx35_imx_ssi_data_entry(1, 2),
66};
67#endif /* ifdef CONFIG_SOC_IMX35 */
68
69#ifdef CONFIG_SOC_IMX51
70const struct imx_imx_ssi_data imx51_imx_ssi_data[] __initconst = {
71#define imx51_imx_ssi_data_entry(_id, _hwid) \
72 imx_imx_ssi_data_entry(MX51, _id, _hwid, SZ_16K)
73 imx51_imx_ssi_data_entry(0, 1),
74 imx51_imx_ssi_data_entry(1, 2),
75 imx51_imx_ssi_data_entry(2, 3),
76};
77#endif /* ifdef CONFIG_SOC_IMX51 */
78
79#ifdef CONFIG_SOC_IMX53
80const struct imx_imx_ssi_data imx53_imx_ssi_data[] __initconst = {
81#define imx53_imx_ssi_data_entry(_id, _hwid) \
82 imx_imx_ssi_data_entry(MX53, _id, _hwid, SZ_16K)
83 imx53_imx_ssi_data_entry(0, 1),
84 imx53_imx_ssi_data_entry(1, 2),
85 imx53_imx_ssi_data_entry(2, 3),
86};
87#endif /* ifdef CONFIG_SOC_IMX53 */
88
89struct platform_device *__init imx_add_imx_ssi(
90 const struct imx_imx_ssi_data *data,
91 const struct imx_ssi_platform_data *pdata)
92{
93 struct resource res[] = {
94 {
95 .start = data->iobase,
96 .end = data->iobase + data->iosize - 1,
97 .flags = IORESOURCE_MEM,
98 }, {
99 .start = data->irq,
100 .end = data->irq,
101 .flags = IORESOURCE_IRQ,
102 },
103#define DMARES(_name) { \
104 .name = #_name, \
105 .start = data->dma ## _name, \
106 .end = data->dma ## _name, \
107 .flags = IORESOURCE_DMA, \
108}
109 DMARES(tx0),
110 DMARES(rx0),
111 DMARES(tx1),
112 DMARES(rx1),
113 };
114
115 return imx_add_platform_device("imx-ssi", data->id,
116 res, ARRAY_SIZE(res),
117 pdata, sizeof(*pdata));
118}
diff --git a/arch/arm/plat-mxc/devices/platform-imx-uart.c b/arch/arm/plat-mxc/devices/platform-imx-uart.c
new file mode 100644
index 00000000000..2020d84956c
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imx-uart.c
@@ -0,0 +1,178 @@
1/*
2 * Copyright (C) 2009-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_imx_uart_3irq_data_entry(soc, _id, _hwid, _size) \
13 [_id] = { \
14 .id = _id, \
15 .iobase = soc ## _UART ## _hwid ## _BASE_ADDR, \
16 .iosize = _size, \
17 .irqrx = soc ## _INT_UART ## _hwid ## RX, \
18 .irqtx = soc ## _INT_UART ## _hwid ## TX, \
19 .irqrts = soc ## _INT_UART ## _hwid ## RTS, \
20 }
21
22#define imx_imx_uart_1irq_data_entry(soc, _id, _hwid, _size) \
23 [_id] = { \
24 .id = _id, \
25 .iobase = soc ## _UART ## _hwid ## _BASE_ADDR, \
26 .iosize = _size, \
27 .irq = soc ## _INT_UART ## _hwid, \
28 }
29
30#ifdef CONFIG_SOC_IMX1
31const struct imx_imx_uart_3irq_data imx1_imx_uart_data[] __initconst = {
32#define imx1_imx_uart_data_entry(_id, _hwid) \
33 imx_imx_uart_3irq_data_entry(MX1, _id, _hwid, 0xd0)
34 imx1_imx_uart_data_entry(0, 1),
35 imx1_imx_uart_data_entry(1, 2),
36};
37#endif /* ifdef CONFIG_SOC_IMX1 */
38
39#ifdef CONFIG_SOC_IMX21
40const struct imx_imx_uart_1irq_data imx21_imx_uart_data[] __initconst = {
41#define imx21_imx_uart_data_entry(_id, _hwid) \
42 imx_imx_uart_1irq_data_entry(MX21, _id, _hwid, SZ_4K)
43 imx21_imx_uart_data_entry(0, 1),
44 imx21_imx_uart_data_entry(1, 2),
45 imx21_imx_uart_data_entry(2, 3),
46 imx21_imx_uart_data_entry(3, 4),
47};
48#endif
49
50#ifdef CONFIG_SOC_IMX25
51const struct imx_imx_uart_1irq_data imx25_imx_uart_data[] __initconst = {
52#define imx25_imx_uart_data_entry(_id, _hwid) \
53 imx_imx_uart_1irq_data_entry(MX25, _id, _hwid, SZ_16K)
54 imx25_imx_uart_data_entry(0, 1),
55 imx25_imx_uart_data_entry(1, 2),
56 imx25_imx_uart_data_entry(2, 3),
57 imx25_imx_uart_data_entry(3, 4),
58 imx25_imx_uart_data_entry(4, 5),
59};
60#endif /* ifdef CONFIG_SOC_IMX25 */
61
62#ifdef CONFIG_SOC_IMX27
63const struct imx_imx_uart_1irq_data imx27_imx_uart_data[] __initconst = {
64#define imx27_imx_uart_data_entry(_id, _hwid) \
65 imx_imx_uart_1irq_data_entry(MX27, _id, _hwid, SZ_4K)
66 imx27_imx_uart_data_entry(0, 1),
67 imx27_imx_uart_data_entry(1, 2),
68 imx27_imx_uart_data_entry(2, 3),
69 imx27_imx_uart_data_entry(3, 4),
70 imx27_imx_uart_data_entry(4, 5),
71 imx27_imx_uart_data_entry(5, 6),
72};
73#endif /* ifdef CONFIG_SOC_IMX27 */
74
75#ifdef CONFIG_SOC_IMX31
76const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst = {
77#define imx31_imx_uart_data_entry(_id, _hwid) \
78 imx_imx_uart_1irq_data_entry(MX31, _id, _hwid, SZ_4K)
79 imx31_imx_uart_data_entry(0, 1),
80 imx31_imx_uart_data_entry(1, 2),
81 imx31_imx_uart_data_entry(2, 3),
82 imx31_imx_uart_data_entry(3, 4),
83 imx31_imx_uart_data_entry(4, 5),
84};
85#endif /* ifdef CONFIG_SOC_IMX31 */
86
87#ifdef CONFIG_SOC_IMX35
88const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst = {
89#define imx35_imx_uart_data_entry(_id, _hwid) \
90 imx_imx_uart_1irq_data_entry(MX31, _id, _hwid, SZ_16K)
91 imx35_imx_uart_data_entry(0, 1),
92 imx35_imx_uart_data_entry(1, 2),
93 imx35_imx_uart_data_entry(2, 3),
94};
95#endif /* ifdef CONFIG_SOC_IMX35 */
96
97#ifdef CONFIG_SOC_IMX50
98const struct imx_imx_uart_1irq_data imx50_imx_uart_data[] __initconst = {
99#define imx50_imx_uart_data_entry(_id, _hwid) \
100 imx_imx_uart_1irq_data_entry(MX50, _id, _hwid, SZ_4K)
101 imx50_imx_uart_data_entry(0, 1),
102 imx50_imx_uart_data_entry(1, 2),
103 imx50_imx_uart_data_entry(2, 3),
104 imx50_imx_uart_data_entry(3, 4),
105 imx50_imx_uart_data_entry(4, 5),
106};
107#endif /* ifdef CONFIG_SOC_IMX50 */
108
109#ifdef CONFIG_SOC_IMX51
110const struct imx_imx_uart_1irq_data imx51_imx_uart_data[] __initconst = {
111#define imx51_imx_uart_data_entry(_id, _hwid) \
112 imx_imx_uart_1irq_data_entry(MX51, _id, _hwid, SZ_4K)
113 imx51_imx_uart_data_entry(0, 1),
114 imx51_imx_uart_data_entry(1, 2),
115 imx51_imx_uart_data_entry(2, 3),
116};
117#endif /* ifdef CONFIG_SOC_IMX51 */
118
119#ifdef CONFIG_SOC_IMX53
120const struct imx_imx_uart_1irq_data imx53_imx_uart_data[] __initconst = {
121#define imx53_imx_uart_data_entry(_id, _hwid) \
122 imx_imx_uart_1irq_data_entry(MX53, _id, _hwid, SZ_4K)
123 imx53_imx_uart_data_entry(0, 1),
124 imx53_imx_uart_data_entry(1, 2),
125 imx53_imx_uart_data_entry(2, 3),
126 imx53_imx_uart_data_entry(3, 4),
127 imx53_imx_uart_data_entry(4, 5),
128};
129#endif /* ifdef CONFIG_SOC_IMX53 */
130
131struct platform_device *__init imx_add_imx_uart_3irq(
132 const struct imx_imx_uart_3irq_data *data,
133 const struct imxuart_platform_data *pdata)
134{
135 struct resource res[] = {
136 {
137 .start = data->iobase,
138 .end = data->iobase + data->iosize - 1,
139 .flags = IORESOURCE_MEM,
140 }, {
141 .start = data->irqrx,
142 .end = data->irqrx,
143 .flags = IORESOURCE_IRQ,
144 }, {
145 .start = data->irqtx,
146 .end = data->irqtx,
147 .flags = IORESOURCE_IRQ,
148 }, {
149 .start = data->irqrts,
150 .end = data->irqrx,
151 .flags = IORESOURCE_IRQ,
152 },
153 };
154
155 return imx_add_platform_device("imx1-uart", data->id, res,
156 ARRAY_SIZE(res), pdata, sizeof(*pdata));
157}
158
159struct platform_device *__init imx_add_imx_uart_1irq(
160 const struct imx_imx_uart_1irq_data *data,
161 const struct imxuart_platform_data *pdata)
162{
163 struct resource res[] = {
164 {
165 .start = data->iobase,
166 .end = data->iobase + data->iosize - 1,
167 .flags = IORESOURCE_MEM,
168 }, {
169 .start = data->irq,
170 .end = data->irq,
171 .flags = IORESOURCE_IRQ,
172 },
173 };
174
175 /* i.mx21 type uart runs on all i.mx except i.mx1 */
176 return imx_add_platform_device("imx21-uart", data->id,
177 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
178}
diff --git a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
new file mode 100644
index 00000000000..5e07ef2bf1c
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
@@ -0,0 +1,77 @@
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 <asm/sizes.h>
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12
13#define imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size) \
14 { \
15 .id = _id, \
16 .iobase = soc ## _WDOG ## _hwid ## _BASE_ADDR, \
17 .iosize = _size, \
18 }
19#define imx_imx2_wdt_data_entry(soc, _id, _hwid, _size) \
20 [_id] = imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size)
21
22#ifdef CONFIG_SOC_IMX21
23const struct imx_imx2_wdt_data imx21_imx2_wdt_data __initconst =
24 imx_imx2_wdt_data_entry_single(MX21, 0, , SZ_4K);
25#endif /* ifdef CONFIG_SOC_IMX21 */
26
27#ifdef CONFIG_SOC_IMX25
28const struct imx_imx2_wdt_data imx25_imx2_wdt_data __initconst =
29 imx_imx2_wdt_data_entry_single(MX25, 0, , SZ_16K);
30#endif /* ifdef CONFIG_SOC_IMX25 */
31
32#ifdef CONFIG_SOC_IMX27
33const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst =
34 imx_imx2_wdt_data_entry_single(MX27, 0, , SZ_4K);
35#endif /* ifdef CONFIG_SOC_IMX27 */
36
37#ifdef CONFIG_SOC_IMX31
38const struct imx_imx2_wdt_data imx31_imx2_wdt_data __initconst =
39 imx_imx2_wdt_data_entry_single(MX31, 0, , SZ_16K);
40#endif /* ifdef CONFIG_SOC_IMX31 */
41
42#ifdef CONFIG_SOC_IMX35
43const struct imx_imx2_wdt_data imx35_imx2_wdt_data __initconst =
44 imx_imx2_wdt_data_entry_single(MX35, 0, , SZ_16K);
45#endif /* ifdef CONFIG_SOC_IMX35 */
46
47#ifdef CONFIG_SOC_IMX51
48const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst = {
49#define imx51_imx2_wdt_data_entry(_id, _hwid) \
50 imx_imx2_wdt_data_entry(MX51, _id, _hwid, SZ_16K)
51 imx51_imx2_wdt_data_entry(0, 1),
52 imx51_imx2_wdt_data_entry(1, 2),
53};
54#endif /* ifdef CONFIG_SOC_IMX51 */
55
56#ifdef CONFIG_SOC_IMX53
57const struct imx_imx2_wdt_data imx53_imx2_wdt_data[] __initconst = {
58#define imx53_imx2_wdt_data_entry(_id, _hwid) \
59 imx_imx2_wdt_data_entry(MX53, _id, _hwid, SZ_16K)
60 imx53_imx2_wdt_data_entry(0, 1),
61 imx53_imx2_wdt_data_entry(1, 2),
62};
63#endif /* ifdef CONFIG_SOC_IMX53 */
64
65struct platform_device *__init imx_add_imx2_wdt(
66 const struct imx_imx2_wdt_data *data)
67{
68 struct resource res[] = {
69 {
70 .start = data->iobase,
71 .end = data->iobase + data->iosize - 1,
72 .flags = IORESOURCE_MEM,
73 },
74 };
75 return imx_add_platform_device("imx2-wdt", data->id,
76 res, ARRAY_SIZE(res), NULL, 0);
77}
diff --git a/arch/arm/plat-mxc/devices/platform-imx21-hcd.c b/arch/arm/plat-mxc/devices/platform-imx21-hcd.c
new file mode 100644
index 00000000000..5770a42f33b
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imx21-hcd.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_imx21_hcd_data_entry_single(soc) \
13 { \
14 .iobase = soc ## _USBOTG_BASE_ADDR, \
15 .irq = soc ## _INT_USBHOST, \
16 }
17
18#ifdef CONFIG_SOC_IMX21
19const struct imx_imx21_hcd_data imx21_imx21_hcd_data __initconst =
20 imx_imx21_hcd_data_entry_single(MX21);
21#endif /* ifdef CONFIG_SOC_IMX21 */
22
23struct platform_device *__init imx_add_imx21_hcd(
24 const struct imx_imx21_hcd_data *data,
25 const struct mx21_usbh_platform_data *pdata)
26{
27 struct resource res[] = {
28 {
29 .start = data->iobase,
30 .end = data->iobase + SZ_8K - 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("imx21-hcd", 0,
39 res, ARRAY_SIZE(res),
40 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
41}
diff --git a/arch/arm/plat-mxc/devices/platform-imx_udc.c b/arch/arm/plat-mxc/devices/platform-imx_udc.c
new file mode 100644
index 00000000000..6fd675dfce1
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imx_udc.c
@@ -0,0 +1,75 @@
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_imx_udc_data_entry_single(soc, _size) \
13 { \
14 .iobase = soc ## _USBD_BASE_ADDR, \
15 .iosize = _size, \
16 .irq0 = soc ## _INT_USBD0, \
17 .irq1 = soc ## _INT_USBD1, \
18 .irq2 = soc ## _INT_USBD2, \
19 .irq3 = soc ## _INT_USBD3, \
20 .irq4 = soc ## _INT_USBD4, \
21 .irq5 = soc ## _INT_USBD5, \
22 .irq6 = soc ## _INT_USBD6, \
23 }
24
25#define imx_imx_udc_data_entry(soc, _size) \
26 [_id] = imx_imx_udc_data_entry_single(soc, _size)
27
28#ifdef CONFIG_SOC_IMX1
29const struct imx_imx_udc_data imx1_imx_udc_data __initconst =
30 imx_imx_udc_data_entry_single(MX1, SZ_4K);
31#endif /* ifdef CONFIG_SOC_IMX1 */
32
33struct platform_device *__init imx_add_imx_udc(
34 const struct imx_imx_udc_data *data,
35 const struct imxusb_platform_data *pdata)
36{
37 struct resource res[] = {
38 {
39 .start = data->iobase,
40 .end = data->iobase + data->iosize - 1,
41 .flags = IORESOURCE_MEM,
42 }, {
43 .start = data->irq0,
44 .end = data->irq0,
45 .flags = IORESOURCE_IRQ,
46 }, {
47 .start = data->irq1,
48 .end = data->irq1,
49 .flags = IORESOURCE_IRQ,
50 }, {
51 .start = data->irq2,
52 .end = data->irq2,
53 .flags = IORESOURCE_IRQ,
54 }, {
55 .start = data->irq3,
56 .end = data->irq3,
57 .flags = IORESOURCE_IRQ,
58 }, {
59 .start = data->irq4,
60 .end = data->irq4,
61 .flags = IORESOURCE_IRQ,
62 }, {
63 .start = data->irq5,
64 .end = data->irq5,
65 .flags = IORESOURCE_IRQ,
66 }, {
67 .start = data->irq6,
68 .end = data->irq6,
69 .flags = IORESOURCE_IRQ,
70 },
71 };
72
73 return imx_add_platform_device("imx_udc", 0,
74 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
75}
diff --git a/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c b/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c
new file mode 100644
index 00000000000..805336fdc25
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imxdi_rtc.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 <asm/sizes.h>
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12
13#define imx_imxdi_rtc_data_entry_single(soc) \
14 { \
15 .iobase = soc ## _DRYICE_BASE_ADDR, \
16 .irq = soc ## _INT_DRYICE, \
17 }
18
19#ifdef CONFIG_SOC_IMX25
20const struct imx_imxdi_rtc_data imx25_imxdi_rtc_data __initconst =
21 imx_imxdi_rtc_data_entry_single(MX25);
22#endif /* ifdef CONFIG_SOC_IMX25 */
23
24struct platform_device *__init imx_add_imxdi_rtc(
25 const struct imx_imxdi_rtc_data *data)
26{
27 struct resource res[] = {
28 {
29 .start = data->iobase,
30 .end = data->iobase + SZ_16K - 1,
31 .flags = IORESOURCE_MEM,
32 }, {
33 .start = data->irq,
34 .end = data->irq,
35 .flags = IORESOURCE_IRQ,
36 },
37 };
38
39 return imx_add_platform_device("imxdi_rtc", 0,
40 res, ARRAY_SIZE(res), NULL, 0);
41}
diff --git a/arch/arm/plat-mxc/devices/platform-ipu-core.c b/arch/arm/plat-mxc/devices/platform-ipu-core.c
new file mode 100644
index 00000000000..79d340ae0af
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-ipu-core.c
@@ -0,0 +1,130 @@
1/*
2 * Copyright (C) 2011 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 <linux/dma-mapping.h>
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12
13#define imx_ipu_core_entry_single(soc) \
14{ \
15 .iobase = soc ## _IPU_CTRL_BASE_ADDR, \
16 .synirq = soc ## _INT_IPU_SYN, \
17 .errirq = soc ## _INT_IPU_ERR, \
18}
19
20#ifdef CONFIG_SOC_IMX31
21const struct imx_ipu_core_data imx31_ipu_core_data __initconst =
22 imx_ipu_core_entry_single(MX31);
23#endif
24
25#ifdef CONFIG_SOC_IMX35
26const struct imx_ipu_core_data imx35_ipu_core_data __initconst =
27 imx_ipu_core_entry_single(MX35);
28#endif
29
30static struct platform_device *imx_ipu_coredev __initdata;
31
32struct platform_device *__init imx_add_ipu_core(
33 const struct imx_ipu_core_data *data,
34 const struct ipu_platform_data *pdata)
35{
36 /* The resource order is important! */
37 struct resource res[] = {
38 {
39 .start = data->iobase,
40 .end = data->iobase + 0x5f,
41 .flags = IORESOURCE_MEM,
42 }, {
43 .start = data->iobase + 0x88,
44 .end = data->iobase + 0xb3,
45 .flags = IORESOURCE_MEM,
46 }, {
47 .start = data->synirq,
48 .end = data->synirq,
49 .flags = IORESOURCE_IRQ,
50 }, {
51 .start = data->errirq,
52 .end = data->errirq,
53 .flags = IORESOURCE_IRQ,
54 },
55 };
56
57 return imx_ipu_coredev = imx_add_platform_device("ipu-core", -1,
58 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
59}
60
61struct platform_device *__init imx_alloc_mx3_camera(
62 const struct imx_ipu_core_data *data,
63 const struct mx3_camera_pdata *pdata)
64{
65 struct resource res[] = {
66 {
67 .start = data->iobase + 0x60,
68 .end = data->iobase + 0x87,
69 .flags = IORESOURCE_MEM,
70 },
71 };
72 int ret = -ENOMEM;
73 struct platform_device *pdev;
74
75 if (IS_ERR_OR_NULL(imx_ipu_coredev))
76 return ERR_PTR(-ENODEV);
77
78 pdev = platform_device_alloc("mx3-camera", 0);
79 if (!pdev)
80 goto err;
81
82 pdev->dev.dma_mask = kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
83 if (!pdev->dev.dma_mask)
84 goto err;
85
86 *pdev->dev.dma_mask = DMA_BIT_MASK(32);
87 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
88
89 ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
90 if (ret)
91 goto err;
92
93 if (pdata) {
94 struct mx3_camera_pdata *copied_pdata;
95
96 ret = platform_device_add_data(pdev, pdata, sizeof(*pdata));
97 if (ret) {
98err:
99 kfree(pdev->dev.dma_mask);
100 platform_device_put(pdev);
101 return ERR_PTR(-ENODEV);
102 }
103 copied_pdata = dev_get_platdata(&pdev->dev);
104 copied_pdata->dma_dev = &imx_ipu_coredev->dev;
105 }
106
107 return pdev;
108}
109
110struct platform_device *__init imx_add_mx3_sdc_fb(
111 const struct imx_ipu_core_data *data,
112 struct mx3fb_platform_data *pdata)
113{
114 struct resource res[] = {
115 {
116 .start = data->iobase + 0xb4,
117 .end = data->iobase + 0x1bf,
118 .flags = IORESOURCE_MEM,
119 },
120 };
121
122 if (IS_ERR_OR_NULL(imx_ipu_coredev))
123 return ERR_PTR(-ENODEV);
124
125 pdata->dma_dev = &imx_ipu_coredev->dev;
126
127 return imx_add_platform_device_dmamask("mx3_sdc_fb", -1,
128 res, ARRAY_SIZE(res), pdata, sizeof(*pdata),
129 DMA_BIT_MASK(32));
130}
diff --git a/arch/arm/plat-mxc/devices/platform-mx1-camera.c b/arch/arm/plat-mxc/devices/platform-mx1-camera.c
new file mode 100644
index 00000000000..edcc581a30a
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-mx1-camera.c
@@ -0,0 +1,42 @@
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_mx1_camera_data_entry_single(soc, _size) \
13 { \
14 .iobase = soc ## _CSI ## _BASE_ADDR, \
15 .iosize = _size, \
16 .irq = soc ## _INT_CSI, \
17 }
18
19#ifdef CONFIG_SOC_IMX1
20const struct imx_mx1_camera_data imx1_mx1_camera_data __initconst =
21 imx_mx1_camera_data_entry_single(MX1, 10);
22#endif /* ifdef CONFIG_SOC_IMX1 */
23
24struct platform_device *__init imx_add_mx1_camera(
25 const struct imx_mx1_camera_data *data,
26 const struct mx1_camera_pdata *pdata)
27{
28 struct resource res[] = {
29 {
30 .start = data->iobase,
31 .end = data->iobase + data->iosize - 1,
32 .flags = IORESOURCE_MEM,
33 }, {
34 .start = data->irq,
35 .end = data->irq,
36 .flags = IORESOURCE_IRQ,
37 },
38 };
39 return imx_add_platform_device_dmamask("mx1-camera", 0,
40 res, ARRAY_SIZE(res),
41 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
42}
diff --git a/arch/arm/plat-mxc/devices/platform-mx2-camera.c b/arch/arm/plat-mxc/devices/platform-mx2-camera.c
new file mode 100644
index 00000000000..b3f4828dc44
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-mx2-camera.c
@@ -0,0 +1,64 @@
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_mx2_camera_data_entry_single(soc) \
13 { \
14 .iobasecsi = soc ## _CSI_BASE_ADDR, \
15 .iosizecsi = SZ_4K, \
16 .irqcsi = soc ## _INT_CSI, \
17 }
18#define imx_mx2_camera_data_entry_single_emma(soc) \
19 { \
20 .iobasecsi = soc ## _CSI_BASE_ADDR, \
21 .iosizecsi = SZ_32, \
22 .irqcsi = soc ## _INT_CSI, \
23 .iobaseemmaprp = soc ## _EMMAPRP_BASE_ADDR, \
24 .iosizeemmaprp = SZ_32, \
25 .irqemmaprp = soc ## _INT_EMMAPRP, \
26 }
27
28#ifdef CONFIG_SOC_IMX25
29const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
30 imx_mx2_camera_data_entry_single(MX25);
31#endif /* ifdef CONFIG_SOC_IMX25 */
32
33#ifdef CONFIG_SOC_IMX27
34const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
35 imx_mx2_camera_data_entry_single_emma(MX27);
36#endif /* ifdef CONFIG_SOC_IMX27 */
37
38struct platform_device *__init imx_add_mx2_camera(
39 const struct imx_mx2_camera_data *data,
40 const struct mx2_camera_platform_data *pdata)
41{
42 struct resource res[] = {
43 {
44 .start = data->iobasecsi,
45 .end = data->iobasecsi + data->iosizecsi - 1,
46 .flags = IORESOURCE_MEM,
47 }, {
48 .start = data->irqcsi,
49 .end = data->irqcsi,
50 .flags = IORESOURCE_IRQ,
51 }, {
52 .start = data->iobaseemmaprp,
53 .end = data->iobaseemmaprp + data->iosizeemmaprp - 1,
54 .flags = IORESOURCE_MEM,
55 }, {
56 .start = data->irqemmaprp,
57 .end = data->irqemmaprp,
58 .flags = IORESOURCE_IRQ,
59 },
60 };
61 return imx_add_platform_device_dmamask("mx2-camera", 0,
62 res, data->iobaseemmaprp ? 4 : 2,
63 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
64}
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 00000000000..e1763e03e7c
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c
@@ -0,0 +1,70 @@
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 <linux/dma-mapping.h>
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12
13#define imx_mxc_ehci_data_entry_single(soc, _id, hs) \
14 { \
15 .id = _id, \
16 .iobase = soc ## _USB_ ## hs ## _BASE_ADDR, \
17 .irq = soc ## _INT_USB_ ## hs, \
18 }
19
20#ifdef CONFIG_SOC_IMX25
21const struct imx_mxc_ehci_data imx25_mxc_ehci_otg_data __initconst =
22 imx_mxc_ehci_data_entry_single(MX25, 0, OTG);
23const struct imx_mxc_ehci_data imx25_mxc_ehci_hs_data __initconst =
24 imx_mxc_ehci_data_entry_single(MX25, 1, HS);
25#endif /* ifdef CONFIG_SOC_IMX25 */
26
27#ifdef CONFIG_SOC_IMX27
28const struct imx_mxc_ehci_data imx27_mxc_ehci_otg_data __initconst =
29 imx_mxc_ehci_data_entry_single(MX27, 0, OTG);
30const struct imx_mxc_ehci_data imx27_mxc_ehci_hs_data[] __initconst = {
31 imx_mxc_ehci_data_entry_single(MX27, 1, HS1),
32 imx_mxc_ehci_data_entry_single(MX27, 2, HS2),
33};
34#endif /* ifdef CONFIG_SOC_IMX27 */
35
36#ifdef CONFIG_SOC_IMX31
37const struct imx_mxc_ehci_data imx31_mxc_ehci_otg_data __initconst =
38 imx_mxc_ehci_data_entry_single(MX31, 0, OTG);
39const struct imx_mxc_ehci_data imx31_mxc_ehci_hs_data[] __initconst = {
40 imx_mxc_ehci_data_entry_single(MX31, 1, HS1),
41 imx_mxc_ehci_data_entry_single(MX31, 2, HS2),
42};
43#endif /* ifdef CONFIG_SOC_IMX31 */
44
45#ifdef CONFIG_SOC_IMX35
46const struct imx_mxc_ehci_data imx35_mxc_ehci_otg_data __initconst =
47 imx_mxc_ehci_data_entry_single(MX35, 0, OTG);
48const struct imx_mxc_ehci_data imx35_mxc_ehci_hs_data __initconst =
49 imx_mxc_ehci_data_entry_single(MX35, 1, HS);
50#endif /* ifdef CONFIG_SOC_IMX35 */
51
52struct platform_device *__init imx_add_mxc_ehci(
53 const struct imx_mxc_ehci_data *data,
54 const struct mxc_usbh_platform_data *pdata)
55{
56 struct resource res[] = {
57 {
58 .start = data->iobase,
59 .end = data->iobase + SZ_512 - 1,
60 .flags = IORESOURCE_MEM,
61 }, {
62 .start = data->irq,
63 .end = data->irq,
64 .flags = IORESOURCE_IRQ,
65 },
66 };
67 return imx_add_platform_device_dmamask("mxc-ehci", data->id,
68 res, ARRAY_SIZE(res),
69 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
70}
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c b/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
new file mode 100644
index 00000000000..540d3a7d92d
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
@@ -0,0 +1,73 @@
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 <linux/dma-mapping.h>
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12
13#define imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size) \
14 { \
15 .id = _id, \
16 .iobase = soc ## _SDHC ## _hwid ## _BASE_ADDR, \
17 .iosize = _size, \
18 .irq = soc ## _INT_SDHC ## _hwid, \
19 .dmareq = soc ## _DMA_REQ_SDHC ## _hwid, \
20 }
21#define imx_mxc_mmc_data_entry(soc, _id, _hwid, _size) \
22 [_id] = imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size)
23
24#ifdef CONFIG_SOC_IMX21
25const struct imx_mxc_mmc_data imx21_mxc_mmc_data[] __initconst = {
26#define imx21_mxc_mmc_data_entry(_id, _hwid) \
27 imx_mxc_mmc_data_entry(MX21, _id, _hwid, SZ_4K)
28 imx21_mxc_mmc_data_entry(0, 1),
29 imx21_mxc_mmc_data_entry(1, 2),
30};
31#endif /* ifdef CONFIG_SOC_IMX21 */
32
33#ifdef CONFIG_SOC_IMX27
34const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst = {
35#define imx27_mxc_mmc_data_entry(_id, _hwid) \
36 imx_mxc_mmc_data_entry(MX27, _id, _hwid, SZ_4K)
37 imx27_mxc_mmc_data_entry(0, 1),
38 imx27_mxc_mmc_data_entry(1, 2),
39};
40#endif /* ifdef CONFIG_SOC_IMX27 */
41
42#ifdef CONFIG_SOC_IMX31
43const struct imx_mxc_mmc_data imx31_mxc_mmc_data[] __initconst = {
44#define imx31_mxc_mmc_data_entry(_id, _hwid) \
45 imx_mxc_mmc_data_entry(MX31, _id, _hwid, SZ_16K)
46 imx31_mxc_mmc_data_entry(0, 1),
47 imx31_mxc_mmc_data_entry(1, 2),
48};
49#endif /* ifdef CONFIG_SOC_IMX31 */
50
51struct platform_device *__init imx_add_mxc_mmc(
52 const struct imx_mxc_mmc_data *data,
53 const struct imxmmc_platform_data *pdata)
54{
55 struct resource res[] = {
56 {
57 .start = data->iobase,
58 .end = data->iobase + SZ_4K - 1,
59 .flags = IORESOURCE_MEM,
60 }, {
61 .start = data->irq,
62 .end = data->irq,
63 .flags = IORESOURCE_IRQ,
64 }, {
65 .start = data->dmareq,
66 .end = data->dmareq,
67 .flags = IORESOURCE_DMA,
68 },
69 };
70 return imx_add_platform_device_dmamask("mxc-mmc", data->id,
71 res, ARRAY_SIZE(res),
72 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
73}
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_nand.c b/arch/arm/plat-mxc/devices/platform-mxc_nand.c
new file mode 100644
index 00000000000..1568f39fba8
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-mxc_nand.c
@@ -0,0 +1,83 @@
1/*
2 * Copyright (C) 2009-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 <asm/sizes.h>
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12
13#define imx_mxc_nand_data_entry_single(soc, _size) \
14 { \
15 .iobase = soc ## _NFC_BASE_ADDR, \
16 .iosize = _size, \
17 .irq = soc ## _INT_NFC \
18 }
19
20#define imx_mxc_nandv3_data_entry_single(soc, _size) \
21 { \
22 .id = -1, \
23 .iobase = soc ## _NFC_BASE_ADDR, \
24 .iosize = _size, \
25 .axibase = soc ## _NFC_AXI_BASE_ADDR, \
26 .irq = soc ## _INT_NFC \
27 }
28
29#ifdef CONFIG_SOC_IMX21
30const struct imx_mxc_nand_data imx21_mxc_nand_data __initconst =
31 imx_mxc_nand_data_entry_single(MX21, SZ_4K);
32#endif /* ifdef CONFIG_SOC_IMX21 */
33
34#ifdef CONFIG_SOC_IMX25
35const struct imx_mxc_nand_data imx25_mxc_nand_data __initconst =
36 imx_mxc_nand_data_entry_single(MX25, SZ_8K);
37#endif /* ifdef CONFIG_SOC_IMX25 */
38
39#ifdef CONFIG_SOC_IMX27
40const struct imx_mxc_nand_data imx27_mxc_nand_data __initconst =
41 imx_mxc_nand_data_entry_single(MX27, SZ_4K);
42#endif /* ifdef CONFIG_SOC_IMX27 */
43
44#ifdef CONFIG_SOC_IMX31
45const struct imx_mxc_nand_data imx31_mxc_nand_data __initconst =
46 imx_mxc_nand_data_entry_single(MX31, SZ_4K);
47#endif
48
49#ifdef CONFIG_SOC_IMX35
50const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst =
51 imx_mxc_nand_data_entry_single(MX35, SZ_8K);
52#endif
53
54#ifdef CONFIG_SOC_IMX51
55const struct imx_mxc_nand_data imx51_mxc_nand_data __initconst =
56 imx_mxc_nandv3_data_entry_single(MX51, SZ_16K);
57#endif
58
59struct platform_device *__init imx_add_mxc_nand(
60 const struct imx_mxc_nand_data *data,
61 const struct mxc_nand_platform_data *pdata)
62{
63 /* AXI has to come first, that's how the mxc_nand driver expect it */
64 struct resource res[] = {
65 {
66 .start = data->axibase,
67 .end = data->axibase + SZ_16K - 1,
68 .flags = IORESOURCE_MEM,
69 }, {
70 .start = data->iobase,
71 .end = data->iobase + data->iosize - 1,
72 .flags = IORESOURCE_MEM,
73 }, {
74 .start = data->irq,
75 .end = data->irq,
76 .flags = IORESOURCE_IRQ,
77 },
78 };
79 return imx_add_platform_device("mxc_nand", data->id,
80 res + !data->axibase,
81 ARRAY_SIZE(res) - !data->axibase,
82 pdata, sizeof(*pdata));
83}
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c b/arch/arm/plat-mxc/devices/platform-mxc_pwm.c
new file mode 100644
index 00000000000..b0c4ae29811
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-mxc_pwm.c
@@ -0,0 +1,69 @@
1/*
2 * Copyright (C) 2009-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_pwm_data_entry_single(soc, _id, _hwid, _size) \
13 { \
14 .id = _id, \
15 .iobase = soc ## _PWM ## _hwid ## _BASE_ADDR, \
16 .iosize = _size, \
17 .irq = soc ## _INT_PWM ## _hwid, \
18 }
19#define imx_mxc_pwm_data_entry(soc, _id, _hwid, _size) \
20 [_id] = imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size)
21
22#ifdef CONFIG_SOC_IMX21
23const struct imx_mxc_pwm_data imx21_mxc_pwm_data __initconst =
24 imx_mxc_pwm_data_entry_single(MX21, 0, , SZ_4K);
25#endif /* ifdef CONFIG_SOC_IMX21 */
26
27#ifdef CONFIG_SOC_IMX25
28const struct imx_mxc_pwm_data imx25_mxc_pwm_data[] __initconst = {
29#define imx25_mxc_pwm_data_entry(_id, _hwid) \
30 imx_mxc_pwm_data_entry(MX25, _id, _hwid, SZ_16K)
31 imx25_mxc_pwm_data_entry(0, 1),
32 imx25_mxc_pwm_data_entry(1, 2),
33 imx25_mxc_pwm_data_entry(2, 3),
34 imx25_mxc_pwm_data_entry(3, 4),
35};
36#endif /* ifdef CONFIG_SOC_IMX25 */
37
38#ifdef CONFIG_SOC_IMX27
39const struct imx_mxc_pwm_data imx27_mxc_pwm_data __initconst =
40 imx_mxc_pwm_data_entry_single(MX27, 0, , SZ_4K);
41#endif /* ifdef CONFIG_SOC_IMX27 */
42
43#ifdef CONFIG_SOC_IMX51
44const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = {
45#define imx51_mxc_pwm_data_entry(_id, _hwid) \
46 imx_mxc_pwm_data_entry(MX51, _id, _hwid, SZ_16K)
47 imx51_mxc_pwm_data_entry(0, 1),
48 imx51_mxc_pwm_data_entry(1, 2),
49};
50#endif /* ifdef CONFIG_SOC_IMX51 */
51
52struct platform_device *__init imx_add_mxc_pwm(
53 const struct imx_mxc_pwm_data *data)
54{
55 struct resource res[] = {
56 {
57 .start = data->iobase,
58 .end = data->iobase + data->iosize - 1,
59 .flags = IORESOURCE_MEM,
60 }, {
61 .start = data->irq,
62 .end = data->irq,
63 .flags = IORESOURCE_IRQ,
64 },
65 };
66
67 return imx_add_platform_device("mxc_pwm", data->id,
68 res, ARRAY_SIZE(res), NULL, 0);
69}
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rnga.c b/arch/arm/plat-mxc/devices/platform-mxc_rnga.c
new file mode 100644
index 00000000000..b4b7612b6e1
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-mxc_rnga.c
@@ -0,0 +1,56 @@
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
12struct imx_mxc_rnga_data {
13 resource_size_t iobase;
14};
15
16#define imx_mxc_rnga_data_entry_single(soc) \
17 { \
18 .iobase = soc ## _RNGA_BASE_ADDR, \
19 }
20
21#ifdef CONFIG_SOC_IMX31
22static const struct imx_mxc_rnga_data imx31_mxc_rnga_data __initconst =
23 imx_mxc_rnga_data_entry_single(MX31);
24#endif /* ifdef CONFIG_SOC_IMX31 */
25
26static struct platform_device *__init imx_add_mxc_rnga(
27 const struct imx_mxc_rnga_data *data)
28{
29 struct resource res[] = {
30 {
31 .start = data->iobase,
32 .end = data->iobase + SZ_16K - 1,
33 .flags = IORESOURCE_MEM,
34 },
35 };
36 return imx_add_platform_device("mxc_rnga", -1,
37 res, ARRAY_SIZE(res), NULL, 0);
38}
39
40static int __init imxXX_add_mxc_rnga(void)
41{
42 struct platform_device *ret;
43
44#if defined(CONFIG_SOC_IMX31)
45 if (cpu_is_mx31())
46 ret = imx_add_mxc_rnga(&imx31_mxc_rnga_data);
47 else
48#endif /* if defined(CONFIG_SOC_IMX31) */
49 ret = ERR_PTR(-ENODEV);
50
51 if (IS_ERR(ret))
52 return PTR_ERR(ret);
53
54 return 0;
55}
56arch_initcall(imxXX_add_mxc_rnga);
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rtc.c b/arch/arm/plat-mxc/devices/platform-mxc_rtc.c
new file mode 100644
index 00000000000..16d0ec4df5f
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-mxc_rtc.c
@@ -0,0 +1,40 @@
1/*
2 * Copyright (C) 2010-2011 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_rtc_data_entry_single(soc) \
13 { \
14 .iobase = soc ## _RTC_BASE_ADDR, \
15 .irq = soc ## _INT_RTC, \
16 }
17
18#ifdef CONFIG_SOC_IMX31
19const struct imx_mxc_rtc_data imx31_mxc_rtc_data __initconst =
20 imx_mxc_rtc_data_entry_single(MX31);
21#endif /* ifdef CONFIG_SOC_IMX31 */
22
23struct platform_device *__init imx_add_mxc_rtc(
24 const struct imx_mxc_rtc_data *data)
25{
26 struct resource res[] = {
27 {
28 .start = data->iobase,
29 .end = data->iobase + SZ_16K - 1,
30 .flags = IORESOURCE_MEM,
31 }, {
32 .start = data->irq,
33 .end = data->irq,
34 .flags = IORESOURCE_IRQ,
35 },
36 };
37
38 return imx_add_platform_device("mxc_rtc", -1,
39 res, ARRAY_SIZE(res), NULL, 0);
40}
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_w1.c b/arch/arm/plat-mxc/devices/platform-mxc_w1.c
new file mode 100644
index 00000000000..96fa5ea91fe
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-mxc_w1.c
@@ -0,0 +1,50 @@
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_w1_data_entry_single(soc) \
13 { \
14 .iobase = soc ## _OWIRE_BASE_ADDR, \
15 }
16
17#ifdef CONFIG_SOC_IMX21
18const struct imx_mxc_w1_data imx21_mxc_w1_data __initconst =
19 imx_mxc_w1_data_entry_single(MX21);
20#endif /* ifdef CONFIG_SOC_IMX21 */
21
22#ifdef CONFIG_SOC_IMX27
23const struct imx_mxc_w1_data imx27_mxc_w1_data __initconst =
24 imx_mxc_w1_data_entry_single(MX27);
25#endif /* ifdef CONFIG_SOC_IMX27 */
26
27#ifdef CONFIG_SOC_IMX31
28const struct imx_mxc_w1_data imx31_mxc_w1_data __initconst =
29 imx_mxc_w1_data_entry_single(MX31);
30#endif /* ifdef CONFIG_SOC_IMX31 */
31
32#ifdef CONFIG_SOC_IMX35
33const struct imx_mxc_w1_data imx35_mxc_w1_data __initconst =
34 imx_mxc_w1_data_entry_single(MX35);
35#endif /* ifdef CONFIG_SOC_IMX35 */
36
37struct platform_device *__init imx_add_mxc_w1(
38 const struct imx_mxc_w1_data *data)
39{
40 struct resource res[] = {
41 {
42 .start = data->iobase,
43 .end = data->iobase + SZ_4K - 1,
44 .flags = IORESOURCE_MEM,
45 },
46 };
47
48 return imx_add_platform_device("mxc_w1", 0,
49 res, ARRAY_SIZE(res), NULL, 0);
50}
diff --git a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
new file mode 100644
index 00000000000..5955f5da82e
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
@@ -0,0 +1,99 @@
1/*
2 * Copyright (C) 2010 Pengutronix, Wolfram Sang <w.sang@pengutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8
9#include <mach/hardware.h>
10#include <mach/devices-common.h>
11#include <mach/esdhc.h>
12
13#define imx_sdhci_esdhc_imx_data_entry_single(soc, _devid, _id, hwid) \
14 { \
15 .devid = _devid, \
16 .id = _id, \
17 .iobase = soc ## _ESDHC ## hwid ## _BASE_ADDR, \
18 .irq = soc ## _INT_ESDHC ## hwid, \
19 }
20
21#define imx_sdhci_esdhc_imx_data_entry(soc, devid, id, hwid) \
22 [id] = imx_sdhci_esdhc_imx_data_entry_single(soc, devid, id, hwid)
23
24#ifdef CONFIG_SOC_IMX25
25const struct imx_sdhci_esdhc_imx_data
26imx25_sdhci_esdhc_imx_data[] __initconst = {
27#define imx25_sdhci_esdhc_imx_data_entry(_id, _hwid) \
28 imx_sdhci_esdhc_imx_data_entry(MX25, "sdhci-esdhc-imx25", _id, _hwid)
29 imx25_sdhci_esdhc_imx_data_entry(0, 1),
30 imx25_sdhci_esdhc_imx_data_entry(1, 2),
31};
32#endif /* ifdef CONFIG_SOC_IMX25 */
33
34#ifdef CONFIG_SOC_IMX35
35const struct imx_sdhci_esdhc_imx_data
36imx35_sdhci_esdhc_imx_data[] __initconst = {
37#define imx35_sdhci_esdhc_imx_data_entry(_id, _hwid) \
38 imx_sdhci_esdhc_imx_data_entry(MX35, "sdhci-esdhc-imx35", _id, _hwid)
39 imx35_sdhci_esdhc_imx_data_entry(0, 1),
40 imx35_sdhci_esdhc_imx_data_entry(1, 2),
41 imx35_sdhci_esdhc_imx_data_entry(2, 3),
42};
43#endif /* ifdef CONFIG_SOC_IMX35 */
44
45#ifdef CONFIG_SOC_IMX51
46const struct imx_sdhci_esdhc_imx_data
47imx51_sdhci_esdhc_imx_data[] __initconst = {
48#define imx51_sdhci_esdhc_imx_data_entry(_id, _hwid) \
49 imx_sdhci_esdhc_imx_data_entry(MX51, "sdhci-esdhc-imx51", _id, _hwid)
50 imx51_sdhci_esdhc_imx_data_entry(0, 1),
51 imx51_sdhci_esdhc_imx_data_entry(1, 2),
52 imx51_sdhci_esdhc_imx_data_entry(2, 3),
53 imx51_sdhci_esdhc_imx_data_entry(3, 4),
54};
55#endif /* ifdef CONFIG_SOC_IMX51 */
56
57#ifdef CONFIG_SOC_IMX53
58const struct imx_sdhci_esdhc_imx_data
59imx53_sdhci_esdhc_imx_data[] __initconst = {
60#define imx53_sdhci_esdhc_imx_data_entry(_id, _hwid) \
61 imx_sdhci_esdhc_imx_data_entry(MX53, "sdhci-esdhc-imx53", _id, _hwid)
62 imx53_sdhci_esdhc_imx_data_entry(0, 1),
63 imx53_sdhci_esdhc_imx_data_entry(1, 2),
64 imx53_sdhci_esdhc_imx_data_entry(2, 3),
65 imx53_sdhci_esdhc_imx_data_entry(3, 4),
66};
67#endif /* ifdef CONFIG_SOC_IMX53 */
68
69static const struct esdhc_platform_data default_esdhc_pdata __initconst = {
70 .wp_type = ESDHC_WP_NONE,
71 .cd_type = ESDHC_CD_NONE,
72};
73
74struct platform_device *__init imx_add_sdhci_esdhc_imx(
75 const struct imx_sdhci_esdhc_imx_data *data,
76 const struct esdhc_platform_data *pdata)
77{
78 struct resource res[] = {
79 {
80 .start = data->iobase,
81 .end = data->iobase + SZ_16K - 1,
82 .flags = IORESOURCE_MEM,
83 }, {
84 .start = data->irq,
85 .end = data->irq,
86 .flags = IORESOURCE_IRQ,
87 },
88 };
89
90 /*
91 * If machine does not provide pdata, use the default one
92 * which means no WP/CD support
93 */
94 if (!pdata)
95 pdata = &default_esdhc_pdata;
96
97 return imx_add_platform_device(data->devid, data->id, res,
98 ARRAY_SIZE(res), pdata, sizeof(*pdata));
99}
diff --git a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/plat-mxc/devices/platform-spi_imx.c
new file mode 100644
index 00000000000..9bfae8bd5b8
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-spi_imx.c
@@ -0,0 +1,127 @@
1/*
2 * Copyright (C) 2009-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_spi_imx_data_entry_single(soc, type, _devid, _id, hwid, _size) \
13 { \
14 .devid = _devid, \
15 .id = _id, \
16 .iobase = soc ## _ ## type ## hwid ## _BASE_ADDR, \
17 .iosize = _size, \
18 .irq = soc ## _INT_ ## type ## hwid, \
19 }
20
21#define imx_spi_imx_data_entry(soc, type, devid, id, hwid, size) \
22 [id] = imx_spi_imx_data_entry_single(soc, type, devid, id, hwid, size)
23
24#ifdef CONFIG_SOC_IMX1
25const struct imx_spi_imx_data imx1_cspi_data[] __initconst = {
26#define imx1_cspi_data_entry(_id, _hwid) \
27 imx_spi_imx_data_entry(MX1, CSPI, "imx1-cspi", _id, _hwid, SZ_4K)
28 imx1_cspi_data_entry(0, 1),
29 imx1_cspi_data_entry(1, 2),
30};
31#endif
32
33#ifdef CONFIG_SOC_IMX21
34const struct imx_spi_imx_data imx21_cspi_data[] __initconst = {
35#define imx21_cspi_data_entry(_id, _hwid) \
36 imx_spi_imx_data_entry(MX21, CSPI, "imx21-cspi", _id, _hwid, SZ_4K)
37 imx21_cspi_data_entry(0, 1),
38 imx21_cspi_data_entry(1, 2),
39};
40#endif
41
42#ifdef CONFIG_SOC_IMX25
43/* i.mx25 has the i.mx35 type cspi */
44const struct imx_spi_imx_data imx25_cspi_data[] __initconst = {
45#define imx25_cspi_data_entry(_id, _hwid) \
46 imx_spi_imx_data_entry(MX25, CSPI, "imx35-cspi", _id, _hwid, SZ_16K)
47 imx25_cspi_data_entry(0, 1),
48 imx25_cspi_data_entry(1, 2),
49 imx25_cspi_data_entry(2, 3),
50};
51#endif /* ifdef CONFIG_SOC_IMX25 */
52
53#ifdef CONFIG_SOC_IMX27
54const struct imx_spi_imx_data imx27_cspi_data[] __initconst = {
55#define imx27_cspi_data_entry(_id, _hwid) \
56 imx_spi_imx_data_entry(MX27, CSPI, "imx27-cspi", _id, _hwid, SZ_4K)
57 imx27_cspi_data_entry(0, 1),
58 imx27_cspi_data_entry(1, 2),
59 imx27_cspi_data_entry(2, 3),
60};
61#endif /* ifdef CONFIG_SOC_IMX27 */
62
63#ifdef CONFIG_SOC_IMX31
64const struct imx_spi_imx_data imx31_cspi_data[] __initconst = {
65#define imx31_cspi_data_entry(_id, _hwid) \
66 imx_spi_imx_data_entry(MX31, CSPI, "imx31-cspi", _id, _hwid, SZ_4K)
67 imx31_cspi_data_entry(0, 1),
68 imx31_cspi_data_entry(1, 2),
69 imx31_cspi_data_entry(2, 3),
70};
71#endif /* ifdef CONFIG_SOC_IMX31 */
72
73#ifdef CONFIG_SOC_IMX35
74const struct imx_spi_imx_data imx35_cspi_data[] __initconst = {
75#define imx35_cspi_data_entry(_id, _hwid) \
76 imx_spi_imx_data_entry(MX35, CSPI, "imx35-cspi", _id, _hwid, SZ_4K)
77 imx35_cspi_data_entry(0, 1),
78 imx35_cspi_data_entry(1, 2),
79};
80#endif /* ifdef CONFIG_SOC_IMX35 */
81
82#ifdef CONFIG_SOC_IMX51
83/* i.mx51 has the i.mx35 type cspi */
84const struct imx_spi_imx_data imx51_cspi_data __initconst =
85 imx_spi_imx_data_entry_single(MX51, CSPI, "imx35-cspi", 2, , SZ_4K);
86
87const struct imx_spi_imx_data imx51_ecspi_data[] __initconst = {
88#define imx51_ecspi_data_entry(_id, _hwid) \
89 imx_spi_imx_data_entry(MX51, ECSPI, "imx51-ecspi", _id, _hwid, SZ_4K)
90 imx51_ecspi_data_entry(0, 1),
91 imx51_ecspi_data_entry(1, 2),
92};
93#endif /* ifdef CONFIG_SOC_IMX51 */
94
95#ifdef CONFIG_SOC_IMX53
96/* i.mx53 has the i.mx35 type cspi */
97const struct imx_spi_imx_data imx53_cspi_data __initconst =
98 imx_spi_imx_data_entry_single(MX53, CSPI, "imx35-cspi", 0, , SZ_4K);
99
100/* i.mx53 has the i.mx51 type ecspi */
101const struct imx_spi_imx_data imx53_ecspi_data[] __initconst = {
102#define imx53_ecspi_data_entry(_id, _hwid) \
103 imx_spi_imx_data_entry(MX53, ECSPI, "imx51-ecspi", _id, _hwid, SZ_4K)
104 imx53_ecspi_data_entry(0, 1),
105 imx53_ecspi_data_entry(1, 2),
106};
107#endif /* ifdef CONFIG_SOC_IMX53 */
108
109struct platform_device *__init imx_add_spi_imx(
110 const struct imx_spi_imx_data *data,
111 const struct spi_imx_master *pdata)
112{
113 struct resource res[] = {
114 {
115 .start = data->iobase,
116 .end = data->iobase + data->iosize - 1,
117 .flags = IORESOURCE_MEM,
118 }, {
119 .start = data->irq,
120 .end = data->irq,
121 .flags = IORESOURCE_IRQ,
122 },
123 };
124
125 return imx_add_platform_device(data->devid, data->id,
126 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
127}