aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/devices.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2010-02-12 15:26:47 -0500
committerTony Lindgren <tony@atomide.com>2010-02-15 12:26:59 -0500
commitd10f2b6e745f1232ff6517b335faf3bfd7005bec (patch)
tree431c5d90dea5d447bd268f80c385b9ee57cd0334 /arch/arm/mach-omap2/devices.c
parent6fbd55d077cdf2aeb7a170ff9f5779d19506bf9e (diff)
omap2/3/4: Fix mbox init for multi-omap
Fix mbox init for multi-omap Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r--arch/arm/mach-omap2/devices.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 18ad93160abb..935e36c3a5e9 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 +
@@ -187,6 +195,10 @@ static struct resource omap_mbox_resources[] = {
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;