aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Bénard <eric@eukrea.com>2010-10-12 07:12:32 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2010-10-19 12:45:00 -0400
commitc074512905c0a08be2a91670bdd69cd1de4e2823 (patch)
tree49b5f93768a22e4867d69999c0d136b9a248f063
parent6a001b886c8c4ff7477a3692a2d87a9dbdd860ee (diff)
imx-esdhc: update devices registration
Tested on i.MX25 and i.MX35 and i.MX51 Signed-off-by: Eric Bénard <eric@eukrea.com>
-rw-r--r--arch/arm/mach-mx25/devices-imx25.h7
-rw-r--r--arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c2
-rw-r--r--arch/arm/mach-mx3/devices-imx35.h9
-rw-r--r--arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c2
-rw-r--r--arch/arm/mach-mx3/mach-pcm043.c2
-rw-r--r--arch/arm/mach-mx5/devices-imx51.h11
-rw-r--r--arch/arm/plat-mxc/devices/platform-esdhc.c56
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h10
-rw-r--r--arch/arm/plat-mxc/include/mach/mx25.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/mx35.h6
-rw-r--r--arch/arm/plat-mxc/include/mach/mx51.h16
11 files changed, 80 insertions, 45 deletions
diff --git a/arch/arm/mach-mx25/devices-imx25.h b/arch/arm/mach-mx25/devices-imx25.h
index 733aaee5bae8..93afa10b13cf 100644
--- a/arch/arm/mach-mx25/devices-imx25.h
+++ b/arch/arm/mach-mx25/devices-imx25.h
@@ -49,7 +49,6 @@ extern const struct imx_spi_imx_data imx25_spi_imx_data[] __initconst;
49#define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata) 49#define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata)
50#define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata) 50#define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata)
51 51
52#define imx25_add_esdhc0(pdata) \ 52extern const struct imx_esdhc_imx_data imx25_esdhc_data[] __initconst;
53 imx_add_esdhc(0, MX25_ESDHC1_BASE_ADDR, SZ_16K, MX25_INT_MMC_SDHC1, pdata) 53#define imx25_add_esdhc(id, pdata) \
54#define imx25_add_esdhc1(pdata) \ 54 imx_add_esdhc(&imx25_esdhc_data[id], pdata)
55 imx_add_esdhc(1, MX25_ESDHC2_BASE_ADDR, SZ_16K, MX25_INT_MMC_SDHC2, pdata)
diff --git a/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c
index 7859ae4df55c..e765ac5d9a08 100644
--- a/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c
+++ b/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c
@@ -277,7 +277,7 @@ void __init eukrea_mbimxsd25_baseboard_init(void)
277 imx25_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata); 277 imx25_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata);
278 278
279 imx25_add_flexcan1(NULL); 279 imx25_add_flexcan1(NULL);
280 imx25_add_esdhc0(NULL); 280 imx25_add_esdhc(0, NULL);
281 281
282 gpio_request(GPIO_LED1, "LED1"); 282 gpio_request(GPIO_LED1, "LED1");
283 gpio_direction_output(GPIO_LED1, 1); 283 gpio_direction_output(GPIO_LED1, 1);
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h
index 509b346b7fef..5eb917b638d0 100644
--- a/arch/arm/mach-mx3/devices-imx35.h
+++ b/arch/arm/mach-mx3/devices-imx35.h
@@ -46,9 +46,6 @@ extern const struct imx_spi_imx_data imx35_cspi_data[] __initconst;
46#define imx35_add_spi_imx0(pdata) imx35_add_cspi(0, pdata) 46#define imx35_add_spi_imx0(pdata) imx35_add_cspi(0, pdata)
47#define imx35_add_spi_imx1(pdata) imx35_add_cspi(1, pdata) 47#define imx35_add_spi_imx1(pdata) imx35_add_cspi(1, pdata)
48 48
49#define imx35_add_esdhc0(pdata) \ 49extern const struct imx_esdhc_imx_data imx35_esdhc_data[] __initconst;
50 imx_add_esdhc(0, MX35_ESDHC1_BASE_ADDR, SZ_16K, MX35_INT_MMC_SDHC1, pdata) 50#define imx35_add_esdhc(id, pdata) \
51#define imx35_add_esdhc1(pdata) \ 51 imx_add_esdhc(&imx35_esdhc_data[id], pdata)
52 imx_add_esdhc(1, MX35_ESDHC2_BASE_ADDR, SZ_16K, MX35_INT_MMC_SDHC2, pdata)
53#define imx35_add_esdhc2(pdata) \
54 imx_add_esdhc(2, MX35_ESDHC3_BASE_ADDR, SZ_16K, MX35_INT_MMC_SDHC3, pdata)
diff --git a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c
index 1c004c82d84c..82b6c8659c8a 100644
--- a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c
+++ b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c
@@ -289,7 +289,7 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
289 imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata); 289 imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata);
290 290
291 imx35_add_flexcan1(NULL); 291 imx35_add_flexcan1(NULL);
292 imx35_add_esdhc0(NULL); 292 imx35_add_esdhc(0, NULL);
293 293
294 gpio_request(GPIO_LED1, "LED1"); 294 gpio_request(GPIO_LED1, "LED1");
295 gpio_direction_output(GPIO_LED1, 1); 295 gpio_direction_output(GPIO_LED1, 1);
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c
index e790a00cf99f..a9397a4151e3 100644
--- a/arch/arm/mach-mx3/mach-pcm043.c
+++ b/arch/arm/mach-mx3/mach-pcm043.c
@@ -395,7 +395,7 @@ static void __init mxc_board_init(void)
395 mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); 395 mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata);
396 396
397 imx35_add_flexcan1(NULL); 397 imx35_add_flexcan1(NULL);
398 imx35_add_esdhc0(NULL); 398 imx35_add_esdhc(0, NULL);
399} 399}
400 400
401static void __init pcm043_timer_init(void) 401static void __init pcm043_timer_init(void)
diff --git a/arch/arm/mach-mx5/devices-imx51.h b/arch/arm/mach-mx5/devices-imx51.h
index 547432d8420f..5cc910e60538 100644
--- a/arch/arm/mach-mx5/devices-imx51.h
+++ b/arch/arm/mach-mx5/devices-imx51.h
@@ -37,11 +37,6 @@ extern const struct imx_spi_imx_data imx51_ecspi_data[] __initconst;
37#define imx51_add_ecspi(id, pdata) \ 37#define imx51_add_ecspi(id, pdata) \
38 imx_add_spi_imx(&imx51_ecspi_data[id], pdata) 38 imx_add_spi_imx(&imx51_ecspi_data[id], pdata)
39 39
40#define imx51_add_esdhc0(pdata) \ 40extern const struct imx_esdhc_imx_data imx51_esdhc_data[] __initconst;
41 imx_add_esdhc(0, MX51_MMC_SDHC1_BASE_ADDR, SZ_16K, MX51_MXC_INT_MMC_SDHC1, pdata) 41#define imx51_add_esdhc(id, pdata) \
42#define imx51_add_esdhc1(pdata) \ 42 imx_add_esdhc(&imx51_esdhc_data[id], pdata)
43 imx_add_esdhc(1, MX51_MMC_SDHC2_BASE_ADDR, SZ_16K, MX51_MXC_INT_MMC_SDHC2, pdata)
44#define imx51_add_esdhc2(pdata) \
45 imx_add_esdhc(2, MX51_MMC_SDHC3_BASE_ADDR, SZ_16K, MX51_MXC_INT_MMC_SDHC3, pdata)
46#define imx51_add_esdhc3(pdata) \
47 imx_add_esdhc(3, MX51_MMC_SDHC4_BASE_ADDR, SZ_16K, MX51_MXC_INT_MMC_SDHC4, pdata)
diff --git a/arch/arm/plat-mxc/devices/platform-esdhc.c b/arch/arm/plat-mxc/devices/platform-esdhc.c
index 68db2a22d2cd..2605bfa0dfb0 100644
--- a/arch/arm/plat-mxc/devices/platform-esdhc.c
+++ b/arch/arm/plat-mxc/devices/platform-esdhc.c
@@ -6,26 +6,66 @@
6 * Free Software Foundation. 6 * Free Software Foundation.
7 */ 7 */
8 8
9#include <mach/hardware.h>
9#include <mach/devices-common.h> 10#include <mach/devices-common.h>
10#include <mach/esdhc.h> 11#include <mach/esdhc.h>
11 12
12struct platform_device *__init imx_add_esdhc(int id, 13#define imx_esdhc_imx_data_entry_single(soc, _id, hwid) \
13 resource_size_t iobase, resource_size_t iosize, 14 { \
14 resource_size_t irq, 15 .id = _id, \
16 .iobase = soc ## _ESDHC ## hwid ## _BASE_ADDR, \
17 .irq = soc ## _INT_ESDHC ## hwid, \
18 }
19
20#define imx_esdhc_imx_data_entry(soc, id, hwid) \
21 [id] = imx_esdhc_imx_data_entry_single(soc, id, hwid)
22
23#ifdef CONFIG_ARCH_MX25
24const struct imx_esdhc_imx_data imx25_esdhc_data[] __initconst = {
25#define imx25_esdhc_data_entry(_id, _hwid) \
26 imx_esdhc_imx_data_entry(MX25, _id, _hwid)
27 imx25_esdhc_data_entry(0, 1),
28 imx25_esdhc_data_entry(1, 2),
29};
30#endif /* ifdef CONFIG_ARCH_MX25 */
31
32#ifdef CONFIG_ARCH_MX35
33const struct imx_esdhc_imx_data imx35_esdhc_data[] __initconst = {
34#define imx35_esdhc_data_entry(_id, _hwid) \
35 imx_esdhc_imx_data_entry(MX35, _id, _hwid)
36 imx35_esdhc_data_entry(0, 1),
37 imx35_esdhc_data_entry(1, 2),
38 imx35_esdhc_data_entry(2, 3),
39};
40#endif /* ifdef CONFIG_ARCH_MX35 */
41
42#ifdef CONFIG_ARCH_MX51
43const struct imx_esdhc_imx_data imx51_esdhc_data[] __initconst = {
44#define imx51_esdhc_data_entry(_id, _hwid) \
45 imx_esdhc_imx_data_entry(MX51, _id, _hwid)
46 imx51_esdhc_data_entry(0, 1),
47 imx51_esdhc_data_entry(1, 2),
48 imx51_esdhc_data_entry(2, 3),
49 imx51_esdhc_data_entry(3, 4),
50};
51#endif /* ifdef CONFIG_ARCH_MX51 */
52
53struct platform_device *__init imx_add_esdhc(
54 const struct imx_esdhc_imx_data *data,
15 const struct esdhc_platform_data *pdata) 55 const struct esdhc_platform_data *pdata)
16{ 56{
17 struct resource res[] = { 57 struct resource res[] = {
18 { 58 {
19 .start = iobase, 59 .start = data->iobase,
20 .end = iobase + iosize - 1, 60 .end = data->iobase + SZ_16K - 1,
21 .flags = IORESOURCE_MEM, 61 .flags = IORESOURCE_MEM,
22 }, { 62 }, {
23 .start = irq, 63 .start = data->irq,
24 .end = irq, 64 .end = data->irq,
25 .flags = IORESOURCE_IRQ, 65 .flags = IORESOURCE_IRQ,
26 }, 66 },
27 }; 67 };
28 68
29 return imx_add_platform_device("sdhci-esdhc-imx", id, res, 69 return imx_add_platform_device("sdhci-esdhc-imx", data->id, res,
30 ARRAY_SIZE(res), pdata, sizeof(*pdata)); 70 ARRAY_SIZE(res), pdata, sizeof(*pdata));
31} 71}
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index 049897880403..86d7575a564d 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -108,7 +108,11 @@ struct platform_device *__init imx_add_spi_imx(
108 const struct spi_imx_master *pdata); 108 const struct spi_imx_master *pdata);
109 109
110#include <mach/esdhc.h> 110#include <mach/esdhc.h>
111struct platform_device *__init imx_add_esdhc(int id, 111struct imx_esdhc_imx_data {
112 resource_size_t iobase, resource_size_t iosize, 112 int id;
113 resource_size_t irq, 113 resource_size_t iobase;
114 resource_size_t irq;
115};
116struct platform_device *__init imx_add_esdhc(
117 const struct imx_esdhc_imx_data *data,
114 const struct esdhc_platform_data *pdata); 118 const struct esdhc_platform_data *pdata);
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h
index 4d31f6806ff4..cf46a45b0d4e 100644
--- a/arch/arm/plat-mxc/include/mach/mx25.h
+++ b/arch/arm/plat-mxc/include/mach/mx25.h
@@ -62,8 +62,8 @@
62#define MX25_INT_I2C1 3 62#define MX25_INT_I2C1 3
63#define MX25_INT_I2C2 4 63#define MX25_INT_I2C2 4
64#define MX25_INT_UART4 5 64#define MX25_INT_UART4 5
65#define MX25_INT_MMC_SDHC2 8 65#define MX25_INT_ESDHC2 8
66#define MX25_INT_MMC_SDHC1 9 66#define MX25_INT_ESDHC1 9
67#define MX25_INT_I2C3 10 67#define MX25_INT_I2C3 10
68#define MX25_INT_SSI2 11 68#define MX25_INT_SSI2 11
69#define MX25_INT_SSI1 12 69#define MX25_INT_SSI1 12
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/plat-mxc/include/mach/mx35.h
index cb071b7b17e5..ff905cb32458 100644
--- a/arch/arm/plat-mxc/include/mach/mx35.h
+++ b/arch/arm/plat-mxc/include/mach/mx35.h
@@ -128,9 +128,9 @@
128#define MX35_INT_I2C3 3 128#define MX35_INT_I2C3 3
129#define MX35_INT_I2C2 4 129#define MX35_INT_I2C2 4
130#define MX35_INT_RTIC 6 130#define MX35_INT_RTIC 6
131#define MX35_INT_MMC_SDHC1 7 131#define MX35_INT_ESDHC1 7
132#define MX35_INT_MMC_SDHC2 8 132#define MX35_INT_ESDHC2 8
133#define MX35_INT_MMC_SDHC3 9 133#define MX35_INT_ESDHC3 9
134#define MX35_INT_I2C1 10 134#define MX35_INT_I2C1 10
135#define MX35_INT_SSI1 11 135#define MX35_INT_SSI1 11
136#define MX35_INT_SSI2 12 136#define MX35_INT_SSI2 12
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h
index c54b5c32d82e..2af7a1056fc1 100644
--- a/arch/arm/plat-mxc/include/mach/mx51.h
+++ b/arch/arm/plat-mxc/include/mach/mx51.h
@@ -64,13 +64,13 @@
64#define MX51_SPBA0_BASE_ADDR_VIRT 0xfb100000 64#define MX51_SPBA0_BASE_ADDR_VIRT 0xfb100000
65#define MX51_SPBA0_SIZE SZ_1M 65#define MX51_SPBA0_SIZE SZ_1M
66 66
67#define MX51_MMC_SDHC1_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x04000) 67#define MX51_ESDHC1_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x04000)
68#define MX51_MMC_SDHC2_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x08000) 68#define MX51_ESDHC2_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x08000)
69#define MX51_UART3_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x0c000) 69#define MX51_UART3_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x0c000)
70#define MX51_ECSPI1_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x10000) 70#define MX51_ECSPI1_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x10000)
71#define MX51_SSI2_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x14000) 71#define MX51_SSI2_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x14000)
72#define MX51_MMC_SDHC3_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x20000) 72#define MX51_ESDHC3_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x20000)
73#define MX51_MMC_SDHC4_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x24000) 73#define MX51_ESDHC4_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x24000)
74#define MX51_SPDIF_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x28000) 74#define MX51_SPDIF_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x28000)
75#define MX51_ATA_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x30000) 75#define MX51_ATA_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x30000)
76#define MX51_SLIM_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x34000) 76#define MX51_SLIM_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x34000)
@@ -280,10 +280,10 @@
280 */ 280 */
281#define MX51_MXC_INT_BASE 0 281#define MX51_MXC_INT_BASE 0
282#define MX51_MXC_INT_RESV0 0 282#define MX51_MXC_INT_RESV0 0
283#define MX51_MXC_INT_MMC_SDHC1 1 283#define MX51_INT_ESDHC1 1
284#define MX51_MXC_INT_MMC_SDHC2 2 284#define MX51_INT_ESDHC2 2
285#define MX51_MXC_INT_MMC_SDHC3 3 285#define MX51_INT_ESDHC3 3
286#define MX51_MXC_INT_MMC_SDHC4 4 286#define MX51_INT_ESDHC4 4
287#define MX51_MXC_INT_RESV5 5 287#define MX51_MXC_INT_RESV5 5
288#define MX51_INT_SDMA 6 288#define MX51_INT_SDMA 6
289#define MX51_MXC_INT_IOMUX 7 289#define MX51_MXC_INT_IOMUX 7