aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/devices.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r--arch/arm/mach-omap2/devices.c45
1 files changed, 34 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 18ad93160abb..23e4d7733610 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -141,7 +141,7 @@ static inline void omap_init_camera(void)
141#define MBOX_REG_SIZE 0x120 141#define MBOX_REG_SIZE 0x120
142 142
143#ifdef CONFIG_ARCH_OMAP2 143#ifdef CONFIG_ARCH_OMAP2
144static struct resource omap_mbox_resources[] = { 144static struct resource omap2_mbox_resources[] = {
145 { 145 {
146 .start = OMAP24XX_MAILBOX_BASE, 146 .start = OMAP24XX_MAILBOX_BASE,
147 .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, 147 .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
@@ -156,10 +156,14 @@ static struct resource omap_mbox_resources[] = {
156 .flags = IORESOURCE_IRQ, 156 .flags = IORESOURCE_IRQ,
157 }, 157 },
158}; 158};
159static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources);
160#else
161#define omap2_mbox_resources NULL
162#define omap2_mbox_resources_sz 0
159#endif 163#endif
160 164
161#ifdef CONFIG_ARCH_OMAP3 165#ifdef CONFIG_ARCH_OMAP3
162static struct resource omap_mbox_resources[] = { 166static struct resource omap3_mbox_resources[] = {
163 { 167 {
164 .start = OMAP34XX_MAILBOX_BASE, 168 .start = OMAP34XX_MAILBOX_BASE,
165 .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, 169 .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
@@ -170,12 +174,16 @@ static struct resource omap_mbox_resources[] = {
170 .flags = IORESOURCE_IRQ, 174 .flags = IORESOURCE_IRQ,
171 }, 175 },
172}; 176};
177static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources);
178#else
179#define omap3_mbox_resources NULL
180#define omap3_mbox_resources_sz 0
173#endif 181#endif
174 182
175#ifdef CONFIG_ARCH_OMAP4 183#ifdef CONFIG_ARCH_OMAP4
176 184
177#define OMAP4_MBOX_REG_SIZE 0x130 185#define OMAP4_MBOX_REG_SIZE 0x130
178static struct resource omap_mbox_resources[] = { 186static struct resource omap4_mbox_resources[] = {
179 { 187 {
180 .start = OMAP44XX_MAILBOX_BASE, 188 .start = OMAP44XX_MAILBOX_BASE,
181 .end = OMAP44XX_MAILBOX_BASE + 189 .end = OMAP44XX_MAILBOX_BASE +
@@ -183,10 +191,14 @@ static struct resource omap_mbox_resources[] = {
183 .flags = IORESOURCE_MEM, 191 .flags = IORESOURCE_MEM,
184 }, 192 },
185 { 193 {
186 .start = INT_44XX_MAIL_U0_MPU, 194 .start = OMAP44XX_IRQ_MAIL_U0,
187 .flags = IORESOURCE_IRQ, 195 .flags = IORESOURCE_IRQ,
188 }, 196 },
189}; 197};
198static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources);
199#else
200#define omap4_mbox_resources NULL
201#define omap4_mbox_resources_sz 0
190#endif 202#endif
191 203
192static struct platform_device mbox_device = { 204static struct platform_device mbox_device = {
@@ -196,9 +208,15 @@ static struct platform_device mbox_device = {
196 208
197static inline void omap_init_mbox(void) 209static inline void omap_init_mbox(void)
198{ 210{
199 if (cpu_is_omap2420() || cpu_is_omap3430() || cpu_is_omap44xx()) { 211 if (cpu_is_omap24xx()) {
200 mbox_device.num_resources = ARRAY_SIZE(omap_mbox_resources); 212 mbox_device.resource = omap2_mbox_resources;
201 mbox_device.resource = omap_mbox_resources; 213 mbox_device.num_resources = omap2_mbox_resources_sz;
214 } else if (cpu_is_omap34xx()) {
215 mbox_device.resource = omap3_mbox_resources;
216 mbox_device.num_resources = omap3_mbox_resources_sz;
217 } else if (cpu_is_omap44xx()) {
218 mbox_device.resource = omap4_mbox_resources;
219 mbox_device.num_resources = omap4_mbox_resources_sz;
202 } else { 220 } else {
203 pr_err("%s: platform not supported\n", __func__); 221 pr_err("%s: platform not supported\n", __func__);
204 return; 222 return;
@@ -492,7 +510,12 @@ static struct platform_device dummy_pdev = {
492 **/ 510 **/
493static void __init omap_hsmmc_reset(void) 511static void __init omap_hsmmc_reset(void)
494{ 512{
495 u32 i, nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC : 513 u32 i, nr_controllers;
514
515 if (cpu_is_omap242x())
516 return;
517
518 nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC :
496 (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC); 519 (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC);
497 520
498 for (i = 0; i < nr_controllers; i++) { 521 for (i = 0; i < nr_controllers; i++) {
@@ -697,13 +720,13 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
697 if (!cpu_is_omap44xx()) 720 if (!cpu_is_omap44xx())
698 return; 721 return;
699 base = OMAP4_MMC4_BASE + OMAP4_MMC_REG_OFFSET; 722 base = OMAP4_MMC4_BASE + OMAP4_MMC_REG_OFFSET;
700 irq = INT_44XX_MMC4_IRQ; 723 irq = OMAP44XX_IRQ_MMC4;
701 break; 724 break;
702 case 4: 725 case 4:
703 if (!cpu_is_omap44xx()) 726 if (!cpu_is_omap44xx())
704 return; 727 return;
705 base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET; 728 base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET;
706 irq = INT_44XX_MMC5_IRQ; 729 irq = OMAP44XX_IRQ_MMC4;
707 break; 730 break;
708 default: 731 default:
709 continue; 732 continue;
@@ -715,7 +738,7 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
715 } else if (cpu_is_omap44xx()) { 738 } else if (cpu_is_omap44xx()) {
716 if (i < 3) { 739 if (i < 3) {
717 base += OMAP4_MMC_REG_OFFSET; 740 base += OMAP4_MMC_REG_OFFSET;
718 irq += IRQ_GIC_START; 741 irq += OMAP44XX_IRQ_GIC_START;
719 } 742 }
720 size = OMAP4_HSMMC_SIZE; 743 size = OMAP4_HSMMC_SIZE;
721 name = "mmci-omap-hs"; 744 name = "mmci-omap-hs";