X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=arch%2Farm%2Fmach-omap2%2Fdevices.c;fp=arch%2Farm%2Fmach-omap2%2Fdevices.c;h=937fb1840b7372126e76761e2a8d18ce820afed5;hb=76044b05598cd9350738c3e74018a29960e3ca24;hp=423647e14bfc300a6795dc8ed87c19f3a7e81fbd;hpb=4a374e24009388241649a43b89c97fc5dca15594;p=linux-2.6-omap-h63xx.git diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 423647e14bf..937fb1840b7 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -85,13 +85,14 @@ static inline void omap_init_camera(void) } #endif -#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) -#define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE) +#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) -static struct resource mbox_resources[] = { +#define MBOX_REG_SIZE 0x120 + +static struct resource omap2_mbox_resources[] = { { - .start = OMAP2_MBOX_BASE, - .end = OMAP2_MBOX_BASE + 0x11f, + .start = OMAP24XX_MAILBOX_BASE, + .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, .flags = IORESOURCE_MEM, }, { @@ -104,20 +105,39 @@ static struct resource mbox_resources[] = { }, }; +static struct resource omap3_mbox_resources[] = { + { + .start = OMAP34XX_MAILBOX_BASE, + .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + { + .start = INT_34XX_MAIL_U0_MPU, + .flags = IORESOURCE_IRQ, + }, +}; + static struct platform_device mbox_device = { - .name = "mailbox", + .name = "omap2-mailbox", .id = -1, - .num_resources = ARRAY_SIZE(mbox_resources), - .resource = mbox_resources, }; static inline void omap_init_mbox(void) { + if (cpu_is_omap2420()) { + mbox_device.num_resources = ARRAY_SIZE(omap2_mbox_resources); + mbox_device.resource = omap2_mbox_resources; + } else if (cpu_is_omap3430()) { + mbox_device.num_resources = ARRAY_SIZE(omap3_mbox_resources); + mbox_device.resource = omap3_mbox_resources; + } else { + return; + } platform_device_register(&mbox_device); } #else static inline void omap_init_mbox(void) { } -#endif +#endif /* CONFIG_OMAP_MBOX_FWK */ #if defined(CONFIG_OMAP_STI)