diff options
author | Hiroshi DOYU <Hiroshi.DOYU@nokia.com> | 2009-03-23 21:07:23 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-03-23 21:07:23 -0400 |
commit | 6c20a68372f158def0a29657ce11b3609ed24f9a (patch) | |
tree | 22be97db69357d2b5770a5e878220c8d529e9b16 /arch/arm/mach-omap2/devices.c | |
parent | 733ecc5c06bb2892f04ab1881721d665644cd261 (diff) |
omap mailbox: add initial omap3 support
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index ce03fa750775..d5f2a8118df3 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -28,13 +28,14 @@ | |||
28 | #include <mach/eac.h> | 28 | #include <mach/eac.h> |
29 | #include <mach/mmc.h> | 29 | #include <mach/mmc.h> |
30 | 30 | ||
31 | #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) | 31 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) |
32 | #define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE) | ||
33 | 32 | ||
34 | static struct resource mbox_resources[] = { | 33 | #define MBOX_REG_SIZE 0x120 |
34 | |||
35 | static struct resource omap2_mbox_resources[] = { | ||
35 | { | 36 | { |
36 | .start = OMAP2_MBOX_BASE, | 37 | .start = OMAP24XX_MAILBOX_BASE, |
37 | .end = OMAP2_MBOX_BASE + 0x11f, | 38 | .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, |
38 | .flags = IORESOURCE_MEM, | 39 | .flags = IORESOURCE_MEM, |
39 | }, | 40 | }, |
40 | { | 41 | { |
@@ -47,20 +48,40 @@ static struct resource mbox_resources[] = { | |||
47 | }, | 48 | }, |
48 | }; | 49 | }; |
49 | 50 | ||
51 | static struct resource omap3_mbox_resources[] = { | ||
52 | { | ||
53 | .start = OMAP34XX_MAILBOX_BASE, | ||
54 | .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, | ||
55 | .flags = IORESOURCE_MEM, | ||
56 | }, | ||
57 | { | ||
58 | .start = INT_24XX_MAIL_U0_MPU, | ||
59 | .flags = IORESOURCE_IRQ, | ||
60 | }, | ||
61 | }; | ||
62 | |||
50 | static struct platform_device mbox_device = { | 63 | static struct platform_device mbox_device = { |
51 | .name = "mailbox", | 64 | .name = "mailbox", |
52 | .id = -1, | 65 | .id = -1, |
53 | .num_resources = ARRAY_SIZE(mbox_resources), | ||
54 | .resource = mbox_resources, | ||
55 | }; | 66 | }; |
56 | 67 | ||
57 | static inline void omap_init_mbox(void) | 68 | static inline void omap_init_mbox(void) |
58 | { | 69 | { |
70 | if (cpu_is_omap2420()) { | ||
71 | mbox_device.num_resources = ARRAY_SIZE(omap2_mbox_resources); | ||
72 | mbox_device.resource = omap2_mbox_resources; | ||
73 | } else if (cpu_is_omap3430()) { | ||
74 | mbox_device.num_resources = ARRAY_SIZE(omap3_mbox_resources); | ||
75 | mbox_device.resource = omap3_mbox_resources; | ||
76 | } else { | ||
77 | pr_err("%s: platform not supported\n", __func__); | ||
78 | return; | ||
79 | } | ||
59 | platform_device_register(&mbox_device); | 80 | platform_device_register(&mbox_device); |
60 | } | 81 | } |
61 | #else | 82 | #else |
62 | static inline void omap_init_mbox(void) { } | 83 | static inline void omap_init_mbox(void) { } |
63 | #endif | 84 | #endif /* CONFIG_OMAP_MBOX_FWK */ |
64 | 85 | ||
65 | #if defined(CONFIG_OMAP_STI) | 86 | #if defined(CONFIG_OMAP_STI) |
66 | 87 | ||