Commit d10f2b6e authored by Tony Lindgren's avatar Tony Lindgren

omap2/3/4: Fix mbox init for multi-omap

Fix mbox init for multi-omap
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 6fbd55d0
...@@ -141,7 +141,7 @@ static inline void omap_init_camera(void) ...@@ -141,7 +141,7 @@ static inline void omap_init_camera(void)
#define MBOX_REG_SIZE 0x120 #define MBOX_REG_SIZE 0x120
#ifdef CONFIG_ARCH_OMAP2 #ifdef CONFIG_ARCH_OMAP2
static struct resource omap_mbox_resources[] = { static struct resource omap2_mbox_resources[] = {
{ {
.start = OMAP24XX_MAILBOX_BASE, .start = OMAP24XX_MAILBOX_BASE,
.end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
...@@ -156,10 +156,14 @@ static struct resource omap_mbox_resources[] = { ...@@ -156,10 +156,14 @@ static struct resource omap_mbox_resources[] = {
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
}; };
static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources);
#else
#define omap2_mbox_resources NULL
#define omap2_mbox_resources_sz 0
#endif #endif
#ifdef CONFIG_ARCH_OMAP3 #ifdef CONFIG_ARCH_OMAP3
static struct resource omap_mbox_resources[] = { static struct resource omap3_mbox_resources[] = {
{ {
.start = OMAP34XX_MAILBOX_BASE, .start = OMAP34XX_MAILBOX_BASE,
.end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
...@@ -170,12 +174,16 @@ static struct resource omap_mbox_resources[] = { ...@@ -170,12 +174,16 @@ static struct resource omap_mbox_resources[] = {
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
}; };
static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources);
#else
#define omap3_mbox_resources NULL
#define omap3_mbox_resources_sz 0
#endif #endif
#ifdef CONFIG_ARCH_OMAP4 #ifdef CONFIG_ARCH_OMAP4
#define OMAP4_MBOX_REG_SIZE 0x130 #define OMAP4_MBOX_REG_SIZE 0x130
static struct resource omap_mbox_resources[] = { static struct resource omap4_mbox_resources[] = {
{ {
.start = OMAP44XX_MAILBOX_BASE, .start = OMAP44XX_MAILBOX_BASE,
.end = OMAP44XX_MAILBOX_BASE + .end = OMAP44XX_MAILBOX_BASE +
...@@ -187,6 +195,10 @@ static struct resource omap_mbox_resources[] = { ...@@ -187,6 +195,10 @@ static struct resource omap_mbox_resources[] = {
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
}; };
static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources);
#else
#define omap4_mbox_resources NULL
#define omap4_mbox_resources_sz 0
#endif #endif
static struct platform_device mbox_device = { static struct platform_device mbox_device = {
...@@ -196,9 +208,15 @@ static struct platform_device mbox_device = { ...@@ -196,9 +208,15 @@ static struct platform_device mbox_device = {
static inline void omap_init_mbox(void) static inline void omap_init_mbox(void)
{ {
if (cpu_is_omap2420() || cpu_is_omap3430() || cpu_is_omap44xx()) { if (cpu_is_omap24xx()) {
mbox_device.num_resources = ARRAY_SIZE(omap_mbox_resources); mbox_device.resource = omap2_mbox_resources;
mbox_device.resource = omap_mbox_resources; mbox_device.num_resources = omap2_mbox_resources_sz;
} else if (cpu_is_omap34xx()) {
mbox_device.resource = omap3_mbox_resources;
mbox_device.num_resources = omap3_mbox_resources_sz;
} else if (cpu_is_omap44xx()) {
mbox_device.resource = omap4_mbox_resources;
mbox_device.num_resources = omap4_mbox_resources_sz;
} else { } else {
pr_err("%s: platform not supported\n", __func__); pr_err("%s: platform not supported\n", __func__);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment