linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/14] omap2/3/4: Fix mbox init for multi-omap
Date: Tue, 26 Jan 2010 12:12:53 -0800	[thread overview]
Message-ID: <20100126201253.15382.2247.stgit@baageli.muru.com> (raw)
In-Reply-To: <20100126200646.15382.52167.stgit@baageli.muru.com>

Fix mbox init for multi-omap

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/devices.c |   30 ++++++++++++++++++++++++------
 1 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 18ad931..935e36c 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)
 #define MBOX_REG_SIZE   0x120
 
 #ifdef CONFIG_ARCH_OMAP2
-static struct resource omap_mbox_resources[] = {
+static struct resource omap2_mbox_resources[] = {
 	{
 		.start		= OMAP24XX_MAILBOX_BASE,
 		.end		= OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
@@ -156,10 +156,14 @@ static struct resource omap_mbox_resources[] = {
 		.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
 
 #ifdef CONFIG_ARCH_OMAP3
-static struct resource omap_mbox_resources[] = {
+static struct resource omap3_mbox_resources[] = {
 	{
 		.start		= OMAP34XX_MAILBOX_BASE,
 		.end		= OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
@@ -170,12 +174,16 @@ static struct resource omap_mbox_resources[] = {
 		.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
 
 #ifdef CONFIG_ARCH_OMAP4
 
 #define OMAP4_MBOX_REG_SIZE	0x130
-static struct resource omap_mbox_resources[] = {
+static struct resource omap4_mbox_resources[] = {
 	{
 		.start          = OMAP44XX_MAILBOX_BASE,
 		.end            = OMAP44XX_MAILBOX_BASE +
@@ -187,6 +195,10 @@ static struct resource omap_mbox_resources[] = {
 		.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
 
 static struct platform_device mbox_device = {
@@ -196,9 +208,15 @@ static struct platform_device mbox_device = {
 
 static inline void omap_init_mbox(void)
 {
-	if (cpu_is_omap2420() || cpu_is_omap3430() || cpu_is_omap44xx()) {
-		mbox_device.num_resources = ARRAY_SIZE(omap_mbox_resources);
-		mbox_device.resource = omap_mbox_resources;
+	if (cpu_is_omap24xx()) {
+		mbox_device.resource = omap2_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 {
 		pr_err("%s: platform not supported\n", __func__);
 		return;

  parent reply	other threads:[~2010-01-26 20:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-26 20:12 [PATCH 00/14] omap DEBUG_LL and multiboot changes for 2.6.34 Tony Lindgren
2010-01-26 20:12 ` [PATCH 01/14] omap: Clean the serial port defines Tony Lindgren
2010-01-26 20:12 ` [PATCH 02/14] omap: Make uncompress code and DEBUG_LL code generic Tony Lindgren
2010-04-29 14:44   ` Kevin Hilman
2010-04-30 15:07   ` Kevin Hilman
2010-04-30 16:20     ` Cyril Chemparathy
2010-04-30 16:49       ` Tony Lindgren
2010-04-30 17:18       ` Russell King - ARM Linux
2010-04-30 18:47         ` Tony Lindgren
2010-04-30 21:16           ` Kevin Hilman
2010-01-26 20:12 ` [PATCH 03/14] omap: Remove old DEBUG_LL serial port options Tony Lindgren
2010-01-26 20:12 ` [PATCH 04/14] omap2/3: Make get_irqnr_and_base common for mach-omap2 multiboot Tony Lindgren
2010-01-26 20:12 ` [PATCH 05/14] omap2/3: Multiboot compile fixes to compile in omap2 and omap3 Tony Lindgren
2010-01-26 20:12 ` [PATCH 06/14] omap: Fix dmtimer.c for multi-omap boot Tony Lindgren
2010-01-26 20:12 ` [PATCH 07/14] omap2/3/4: Fix omap2_map_common_io for multi-omap Tony Lindgren
2010-01-26 20:12 ` Tony Lindgren [this message]
2010-01-26 20:12 ` [PATCH 09/14] omap2: Convert ARCH_OMAP24XX to ARCH_OMAP2 Tony Lindgren
2010-01-26 20:12 ` [PATCH 10/14] omap3: Replace ARCH_OMAP34XX with ARCH_OMAP3 Tony Lindgren
2010-01-26 20:13 ` [PATCH 11/14] omap2/3/4: Replace orred CONFIG_ARCH_OMAP2/3/4 with CONFIG_ARCH_OMAP2PLUS Tony Lindgren
2010-01-26 20:13 ` [PATCH 12/14] omap2/3: Fix initcalls for multi-omap Tony Lindgren
     [not found]   ` <20100819090313.GC3003@shisha.kicks-ass.net>
2010-08-19  9:35     ` Tony Lindgren
2010-01-26 20:13 ` [PATCH 13/14] omap2/3: Fix powerdomain init for multiomap Tony Lindgren
2010-01-27  2:26   ` Paul Walmsley
2010-01-27  2:29     ` Tony Lindgren
2010-01-26 20:13 ` [PATCH 14/14] omap2/3: Update omap3_defconfig to build in all the 2420 based boards Tony Lindgren
2010-03-24 11:43 ` [PATCH 00/14] omap DEBUG_LL and multiboot changes for 2.6.34 Gadiyar, Anand
2010-04-01 12:13   ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100126201253.15382.2247.stgit@baageli.muru.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).