* [PATCH] OMAP3: mailbox initialization for all omap versions
@ 2010-03-26 19:30 Guzman Lugo, Fernando
2010-03-29 6:40 ` Hiroshi DOYU
0 siblings, 1 reply; 11+ messages in thread
From: Guzman Lugo, Fernando @ 2010-03-26 19:30 UTC (permalink / raw)
To: linux-omap@vger.kernel.org
Cc: Hiroshi DOYU, ameya.palande@nokia.com, felipe.contreras@nokia.com
>From 47783fc3e030d4e49d20ba412661cc1f38d8aec0 Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo <x0095840@ti.com>
Date: Fri, 26 Mar 2010 13:06:32 -0600
Subject: [PATCH] OMAP3: mailbox initialization for all omap versions
This removes the check for omap2420, omap3430, omap44xx
and initialize mailbox for all versions
Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
---
arch/arm/mach-omap2/devices.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 18ad931..d6f01be 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -196,13 +196,8 @@ 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;
- } else {
- pr_err("%s: platform not supported\n", __func__);
- return;
- }
+ mbox_device.num_resources = ARRAY_SIZE(omap_mbox_resources);
+ mbox_device.resource = omap_mbox_resources;
platform_device_register(&mbox_device);
}
#else
--
1.6.0.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] OMAP3: mailbox initialization for all omap versions
2010-03-26 19:30 [PATCH] OMAP3: mailbox initialization for all omap versions Guzman Lugo, Fernando
@ 2010-03-29 6:40 ` Hiroshi DOYU
2010-03-29 7:01 ` Felipe Balbi
0 siblings, 1 reply; 11+ messages in thread
From: Hiroshi DOYU @ 2010-03-29 6:40 UTC (permalink / raw)
To: x0095840; +Cc: linux-omap, ameya.palande, felipe.contreras
Hi Fernando,
From: "ext Guzman Lugo, Fernando" <x0095840@ti.com>
Subject: [PATCH] OMAP3: mailbox initialization for all omap versions
Date: Fri, 26 Mar 2010 20:30:34 +0100
> From 47783fc3e030d4e49d20ba412661cc1f38d8aec0 Mon Sep 17 00:00:00 2001
> From: Fernando Guzman Lugo <x0095840@ti.com>
> Date: Fri, 26 Mar 2010 13:06:32 -0600
> Subject: [PATCH] OMAP3: mailbox initialization for all omap versions
>
> This removes the check for omap2420, omap3430, omap44xx
> and initialize mailbox for all versions
>
> Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
It seems that I missed one point previously when I commented. I have
just now found that "multi omap arch support" for mailbox is broken at
the previous commit:454bf340c986b798cd4c2fd676caffa2c1e61482
Considering to fix the above to keep "multi omap arch support", "omap
cpu type check" is necessary here. Could this be fixed as something below?
#if defined(CONFIG_ARCH_OMAP2)
static struct resource omap2_mbox_resources[] = {
...
};
#endif
#if defined(CONFIG_ARCH_OMAP3)
static struct resource omap3_mbox_resources[] = {
...
};
#endif
#if defined(CONFIG_ARCH_OMAP4)
static struct resource omap4_mbox_resources[] = {
...
};
#endif
static struct platform_device mbox_device = {
.name = "omap2-mailbox",
.id = -1,
};
static inline void omap_init_mbox(void)
{
#if defined(CONFIG_ARCH_OMAP2)
if (cpu_is_omap2420()) {
mbox_device.num_resources = ARRAY_SIZE(omap2_mbox_resources);
mbox_device.resource = omap2_mbox_resources;
}
#endif
#if defined(CONFIG_ARCH_OMAP3)
if (cpu_is_omap3430()) {
mbox_device.num_resources = ARRAY_SIZE(omap3_mbox_resources);
mbox_device.resource = omap3_mbox_resources;
}
#endif
#if defined(CONFIG_ARCH_OMAP4)
if (cpu_is_omap44xx()) {
mbox_device.num_resources = ARRAY_SIZE(omap4_mbox_resources);
mbox_device.resource = omap4_mbox_resources;
}
#endif
if (!mbox_device.resource) {
pr_err("%s: platform not supported\n", __func__);
return;
}
platform_device_register(&mbox_device);
}
Then resource registration could be done at runtime. I'm not so sure
if the above cpu types are correct from h/w perspective, which should
be fixed appropriately.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] OMAP3: mailbox initialization for all omap versions
2010-03-29 6:40 ` Hiroshi DOYU
@ 2010-03-29 7:01 ` Felipe Balbi
2010-03-29 9:08 ` Hiroshi DOYU
0 siblings, 1 reply; 11+ messages in thread
From: Felipe Balbi @ 2010-03-29 7:01 UTC (permalink / raw)
To: Doyu Hiroshi (Nokia-D/Helsinki)
Cc: x0095840@ti.com, linux-omap@vger.kernel.org,
Palande Ameya (Nokia-D/Helsinki),
Contreras Felipe (Nokia-D/Helsinki)
hi,
On Mon, Mar 29, 2010 at 08:40:17AM +0200, Doyu Hiroshi (Nokia-D/Helsinki) wrote:
>> From 47783fc3e030d4e49d20ba412661cc1f38d8aec0 Mon Sep 17 00:00:00 2001
>> From: Fernando Guzman Lugo <x0095840@ti.com>
>> Date: Fri, 26 Mar 2010 13:06:32 -0600
>> Subject: [PATCH] OMAP3: mailbox initialization for all omap versions
>>
>> This removes the check for omap2420, omap3430, omap44xx
>> and initialize mailbox for all versions
>>
>> Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
>
>It seems that I missed one point previously when I commented. I have
>just now found that "multi omap arch support" for mailbox is broken at
>the previous commit:454bf340c986b798cd4c2fd676caffa2c1e61482
>
>Considering to fix the above to keep "multi omap arch support", "omap
>cpu type check" is necessary here. Could this be fixed as something below?
>
>#if defined(CONFIG_ARCH_OMAP2)
>static struct resource omap2_mbox_resources[] = {
> ...
>};
>#endif
>
>#if defined(CONFIG_ARCH_OMAP3)
>static struct resource omap3_mbox_resources[] = {
> ...
>};
>#endif
>
>#if defined(CONFIG_ARCH_OMAP4)
>static struct resource omap4_mbox_resources[] = {
> ...
>};
>#endif
>
>static struct platform_device mbox_device = {
> .name = "omap2-mailbox",
> .id = -1,
>};
>
>static inline void omap_init_mbox(void)
>{
>#if defined(CONFIG_ARCH_OMAP2)
> if (cpu_is_omap2420()) {
> mbox_device.num_resources = ARRAY_SIZE(omap2_mbox_resources);
> mbox_device.resource = omap2_mbox_resources;
> }
>#endif
>#if defined(CONFIG_ARCH_OMAP3)
> if (cpu_is_omap3430()) {
> mbox_device.num_resources = ARRAY_SIZE(omap3_mbox_resources);
> mbox_device.resource = omap3_mbox_resources;
> }
>#endif
>#if defined(CONFIG_ARCH_OMAP4)
> if (cpu_is_omap44xx()) {
> mbox_device.num_resources = ARRAY_SIZE(omap4_mbox_resources);
> mbox_device.resource = omap4_mbox_resources;
> }
>#endif
> if (!mbox_device.resource) {
> pr_err("%s: platform not supported\n", __func__);
> return;
> }
> platform_device_register(&mbox_device);
>}
in that case, wouldn't it be better to split that into
arch/arm/omap1/mbox.c arch/arm/omap2/mbox24xx.c
arch/arm/omap2/mbox34xx.c arch/arm/omap2/mbox44xx.c ??
that way we don't need ifdefs on the code and we will only compile what
we really need.
just my 2 cents.
--
balbi
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] OMAP3: mailbox initialization for all omap versions
2010-03-29 7:01 ` Felipe Balbi
@ 2010-03-29 9:08 ` Hiroshi DOYU
2010-04-01 9:52 ` Tony Lindgren
0 siblings, 1 reply; 11+ messages in thread
From: Hiroshi DOYU @ 2010-03-29 9:08 UTC (permalink / raw)
To: felipe.balbi, tony; +Cc: x0095840, linux-omap, ameya.palande, felipe.contreras
From: "Balbi Felipe (Nokia-D/Helsinki)" <felipe.balbi@nokia.com>
Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
Date: Mon, 29 Mar 2010 09:01:45 +0200
> hi,
>
> On Mon, Mar 29, 2010 at 08:40:17AM +0200, Doyu Hiroshi (Nokia-D/Helsinki) wrote:
>>> From 47783fc3e030d4e49d20ba412661cc1f38d8aec0 Mon Sep 17 00:00:00 2001
>>> From: Fernando Guzman Lugo <x0095840@ti.com>
>>> Date: Fri, 26 Mar 2010 13:06:32 -0600
>>> Subject: [PATCH] OMAP3: mailbox initialization for all omap versions
>>>
>>> This removes the check for omap2420, omap3430, omap44xx
>>> and initialize mailbox for all versions
>>>
>>> Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
>>
>>It seems that I missed one point previously when I commented. I have
>>just now found that "multi omap arch support" for mailbox is broken at
>>the previous commit:454bf340c986b798cd4c2fd676caffa2c1e61482
>>
>>Considering to fix the above to keep "multi omap arch support", "omap
>>cpu type check" is necessary here. Could this be fixed as something below?
>>
>>#if defined(CONFIG_ARCH_OMAP2)
>>static struct resource omap2_mbox_resources[] = {
>> ...
>>};
>>#endif
>>
>>#if defined(CONFIG_ARCH_OMAP3)
>>static struct resource omap3_mbox_resources[] = {
>> ...
>>};
>>#endif
>>
>>#if defined(CONFIG_ARCH_OMAP4)
>>static struct resource omap4_mbox_resources[] = {
>> ...
>>};
>>#endif
>>
>>static struct platform_device mbox_device = {
>> .name = "omap2-mailbox",
>> .id = -1,
>>};
>>
>>static inline void omap_init_mbox(void)
>>{
>>#if defined(CONFIG_ARCH_OMAP2)
>> if (cpu_is_omap2420()) {
>> mbox_device.num_resources = ARRAY_SIZE(omap2_mbox_resources);
>> mbox_device.resource = omap2_mbox_resources;
>> }
>>#endif
>>#if defined(CONFIG_ARCH_OMAP3)
>> if (cpu_is_omap3430()) {
>> mbox_device.num_resources = ARRAY_SIZE(omap3_mbox_resources);
>> mbox_device.resource = omap3_mbox_resources;
>> }
>>#endif
>>#if defined(CONFIG_ARCH_OMAP4)
>> if (cpu_is_omap44xx()) {
>> mbox_device.num_resources = ARRAY_SIZE(omap4_mbox_resources);
>> mbox_device.resource = omap4_mbox_resources;
>> }
>>#endif
>> if (!mbox_device.resource) {
>> pr_err("%s: platform not supported\n", __func__);
>> return;
>> }
>> platform_device_register(&mbox_device);
>>}
>
> in that case, wouldn't it be better to split that into
> arch/arm/omap1/mbox.c arch/arm/omap2/mbox24xx.c
> arch/arm/omap2/mbox34xx.c arch/arm/omap2/mbox44xx.c ??
>
> that way we don't need ifdefs on the code and we will only compile what
> we really need.
This is feasible.
But I'm not so sure whether adding 4 new files with around only 10
lines code is acceptable or not.
Tony, any comment on the above?
Basically there could be the case we need all resources if we want to
support omap1, 2, 3 and 4 at the same time, and the appropriate one
will be chosen at run time by CPUID. I'm not sure how mature "omap
multi arch" support is practically, but it's better to keep it as much
as possbile.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] OMAP3: mailbox initialization for all omap versions
2010-03-29 9:08 ` Hiroshi DOYU
@ 2010-04-01 9:52 ` Tony Lindgren
2010-04-01 10:23 ` Hiroshi DOYU
0 siblings, 1 reply; 11+ messages in thread
From: Tony Lindgren @ 2010-04-01 9:52 UTC (permalink / raw)
To: Hiroshi DOYU
Cc: felipe.balbi, x0095840, linux-omap, ameya.palande,
felipe.contreras
* Hiroshi DOYU <Hiroshi.DOYU@nokia.com> [100329 02:05]:
> From: "Balbi Felipe (Nokia-D/Helsinki)" <felipe.balbi@nokia.com>
> Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
> Date: Mon, 29 Mar 2010 09:01:45 +0200
> >
> > in that case, wouldn't it be better to split that into
> > arch/arm/omap1/mbox.c arch/arm/omap2/mbox24xx.c
> > arch/arm/omap2/mbox34xx.c arch/arm/omap2/mbox44xx.c ??
> >
> > that way we don't need ifdefs on the code and we will only compile what
> > we really need.
>
> This is feasible.
> But I'm not so sure whether adding 4 new files with around only 10
> lines code is acceptable or not.
>
> Tony, any comment on the above?
>
> Basically there could be the case we need all resources if we want to
> support omap1, 2, 3 and 4 at the same time, and the appropriate one
> will be chosen at run time by CPUID. I'm not sure how mature "omap
> multi arch" support is practically, but it's better to keep it as much
> as possbile.
I like Felipe's suggestion of adding devices2420.c, devices34xx.c,
devices44xx.c or similar. Then do the device init from those with
a arch_initcall that returns immediately if not running on the right
soc.
Tony
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] OMAP3: mailbox initialization for all omap versions
2010-04-01 9:52 ` Tony Lindgren
@ 2010-04-01 10:23 ` Hiroshi DOYU
2010-04-01 11:26 ` Hiroshi DOYU
0 siblings, 1 reply; 11+ messages in thread
From: Hiroshi DOYU @ 2010-04-01 10:23 UTC (permalink / raw)
To: tony; +Cc: felipe.balbi, x0095840, linux-omap, ameya.palande,
felipe.contreras
From: ext Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
Date: Thu, 1 Apr 2010 11:52:04 +0200
> * Hiroshi DOYU <Hiroshi.DOYU@nokia.com> [100329 02:05]:
>> From: "Balbi Felipe (Nokia-D/Helsinki)" <felipe.balbi@nokia.com>
>> Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
>> Date: Mon, 29 Mar 2010 09:01:45 +0200
>> >
>> > in that case, wouldn't it be better to split that into
>> > arch/arm/omap1/mbox.c arch/arm/omap2/mbox24xx.c
>> > arch/arm/omap2/mbox34xx.c arch/arm/omap2/mbox44xx.c ??
>> >
>> > that way we don't need ifdefs on the code and we will only compile what
>> > we really need.
>>
>> This is feasible.
>> But I'm not so sure whether adding 4 new files with around only 10
>> lines code is acceptable or not.
>>
>> Tony, any comment on the above?
>>
>> Basically there could be the case we need all resources if we want to
>> support omap1, 2, 3 and 4 at the same time, and the appropriate one
>> will be chosen at run time by CPUID. I'm not sure how mature "omap
>> multi arch" support is practically, but it's better to keep it as much
>> as possbile.
>
> I like Felipe's suggestion of adding devices2420.c, devices34xx.c,
> devices44xx.c or similar. Then do the device init from those with
> a arch_initcall that returns immediately if not running on the right
> soc.
Ok, let's procced with this. I'll post something later.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] OMAP3: mailbox initialization for all omap versions
2010-04-01 10:23 ` Hiroshi DOYU
@ 2010-04-01 11:26 ` Hiroshi DOYU
2010-04-01 11:36 ` Felipe Balbi
2010-04-01 12:33 ` Paul Walmsley
0 siblings, 2 replies; 11+ messages in thread
From: Hiroshi DOYU @ 2010-04-01 11:26 UTC (permalink / raw)
To: tony; +Cc: felipe.balbi, x0095840, linux-omap, ameya.palande,
felipe.contreras
From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
Date: Thu, 01 Apr 2010 13:23:36 +0300 (EEST)
> From: ext Tony Lindgren <tony@atomide.com>
> Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
> Date: Thu, 1 Apr 2010 11:52:04 +0200
>
>> * Hiroshi DOYU <Hiroshi.DOYU@nokia.com> [100329 02:05]:
>>> From: "Balbi Felipe (Nokia-D/Helsinki)" <felipe.balbi@nokia.com>
>>> Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
>>> Date: Mon, 29 Mar 2010 09:01:45 +0200
>>> >
>>> > in that case, wouldn't it be better to split that into
>>> > arch/arm/omap1/mbox.c arch/arm/omap2/mbox24xx.c
>>> > arch/arm/omap2/mbox34xx.c arch/arm/omap2/mbox44xx.c ??
>>> >
>>> > that way we don't need ifdefs on the code and we will only compile what
>>> > we really need.
>>>
>>> This is feasible.
>>> But I'm not so sure whether adding 4 new files with around only 10
>>> lines code is acceptable or not.
>>>
>>> Tony, any comment on the above?
>>>
>>> Basically there could be the case we need all resources if we want to
>>> support omap1, 2, 3 and 4 at the same time, and the appropriate one
>>> will be chosen at run time by CPUID. I'm not sure how mature "omap
>>> multi arch" support is practically, but it's better to keep it as much
>>> as possbile.
>>
>> I like Felipe's suggestion of adding devices2420.c, devices34xx.c,
>> devices44xx.c or similar. Then do the device init from those with
>> a arch_initcall that returns immediately if not running on the right
>> soc.
>
> Ok, let's procced with this. I'll post something later.
>
Something like the following?
>From cfd9eae083478da16d1f8b910ab7d04b6869ba9b Mon Sep 17 00:00:00 2001
From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Date: Thu, 1 Apr 2010 14:14:08 +0300
Subject: [PATCH 1/1] [RFC] omap: add arch specific device initialization files
TBA, Not tested.
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
---
arch/arm/mach-omap2/Makefile | 4 ++
arch/arm/mach-omap2/devices.c | 74 -------------------------------------
arch/arm/mach-omap2/devices24xx.c | 63 +++++++++++++++++++++++++++++++
arch/arm/mach-omap2/devices34xx.c | 59 +++++++++++++++++++++++++++++
arch/arm/mach-omap2/devices44xx.c | 60 ++++++++++++++++++++++++++++++
5 files changed, 186 insertions(+), 74 deletions(-)
create mode 100644 arch/arm/mach-omap2/devices24xx.c
create mode 100644 arch/arm/mach-omap2/devices34xx.c
create mode 100644 arch/arm/mach-omap2/devices44xx.c
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 048faa0..94fa938 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -17,6 +17,10 @@ obj-$(CONFIG_ARCH_OMAP4) += $(omap-3-4-common) prcm.o clock.o
obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
+obj-$(CONFIG_ARCH_OMAP24xx) += devices24xx.o
+obj-$(CONFIG_ARCH_OMAP34xx) += devices34xx.o
+obj-$(CONFIG_ARCH_OMAP44xx) += devices44xx.o
+
# SMP support ONLY available for OMAP4
obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o
obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index a622b6e..359f0ce 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -169,79 +169,6 @@ static inline void omap_init_camera(void)
}
#endif
-#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
-
-#define MBOX_REG_SIZE 0x120
-
-#ifdef CONFIG_ARCH_OMAP2
-static struct resource omap_mbox_resources[] = {
- {
- .start = OMAP24XX_MAILBOX_BASE,
- .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = INT_24XX_MAIL_U0_MPU,
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = INT_24XX_MAIL_U3_MPU,
- .flags = IORESOURCE_IRQ,
- },
-};
-#endif
-
-#ifdef CONFIG_ARCH_OMAP3
-static struct resource omap_mbox_resources[] = {
- {
- .start = OMAP34XX_MAILBOX_BASE,
- .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = INT_24XX_MAIL_U0_MPU,
- .flags = IORESOURCE_IRQ,
- },
-};
-#endif
-
-#ifdef CONFIG_ARCH_OMAP4
-
-#define OMAP4_MBOX_REG_SIZE 0x130
-static struct resource omap_mbox_resources[] = {
- {
- .start = OMAP44XX_MAILBOX_BASE,
- .end = OMAP44XX_MAILBOX_BASE +
- OMAP4_MBOX_REG_SIZE - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = INT_44XX_MAIL_U0_MPU,
- .flags = IORESOURCE_IRQ,
- },
-};
-#endif
-
-static struct platform_device mbox_device = {
- .name = "omap2-mailbox",
- .id = -1,
-};
-
-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;
- } else {
- pr_err("%s: platform not supported\n", __func__);
- return;
- }
- platform_device_register(&mbox_device);
-}
-#else
-static inline void omap_init_mbox(void) { }
-#endif /* CONFIG_OMAP_MBOX_FWK */
-
#if defined(CONFIG_OMAP_SDTI)
#if defined(CONFIG_ARCH_OMAP2)
@@ -865,7 +792,6 @@ static int __init omap2_init_devices(void)
*/
omap_hsmmc_reset();
omap_init_camera();
- omap_init_mbox();
omap_init_mcspi();
omap_hdq_init();
omap_init_sti();
diff --git a/arch/arm/mach-omap2/devices24xx.c b/arch/arm/mach-omap2/devices24xx.c
new file mode 100644
index 0000000..22baa8b
--- /dev/null
+++ b/arch/arm/mach-omap2/devices24xx.c
@@ -0,0 +1,63 @@
+/*
+ * omap24xx architecture specific deivce initialization
+ *
+ * Copyright (C) 2010 Nokia Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+
+#include <plat/irqs.h>
+
+#include <mach/hardware.h>
+
+#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
+
+#define MBOX_REG_SIZE 0x120
+
+static struct resource omap_mbox_resources[] = {
+ {
+ .start = OMAP24XX_MAILBOX_BASE,
+ .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = INT_24XX_MAIL_U0_MPU,
+ .flags = IORESOURCE_IRQ,
+ },
+ {
+ .start = INT_24XX_MAIL_U3_MPU,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device omap_mbox_device = {
+ .name = "omap2-mailbox",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(omap_mbox_resources),
+ .resource = omap_mbox_resources,
+};
+
+static inline void omap_mbox_init(void)
+{
+ platform_device_register(&omap_mbox_device);
+}
+#else
+static inline void omap_mbox_init(void) { }
+#endif /* CONFIG_OMAP_MBOX_FWK */
+
+static int __init omap24xx_init_devices(void)
+{
+ if (!cpu_is_omap24xx())
+ return;
+
+ omap_mbox_init();
+
+ return 0;
+}
+arch_initcall(omap24xx_init_devices);
diff --git a/arch/arm/mach-omap2/devices34xx.c b/arch/arm/mach-omap2/devices34xx.c
new file mode 100644
index 0000000..0de1208
--- /dev/null
+++ b/arch/arm/mach-omap2/devices34xx.c
@@ -0,0 +1,59 @@
+/*
+ * omap34xx architecture specific deivce initialization
+ *
+ * Copyright (C) 2010 Nokia Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+
+#include <plat/irqs.h>
+
+#include <mach/hardware.h>
+
+#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
+
+#define MBOX_REG_SIZE 0x120
+
+static struct resource omap_mbox_resources[] = {
+ {
+ .start = OMAP34XX_MAILBOX_BASE,
+ .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = INT_24XX_MAIL_U0_MPU,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device omap_mbox_device = {
+ .name = "omap2-mailbox",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(omap_mbox_resources),
+ .resource = omap_mbox_resources,
+};
+
+static inline void omap_mbox_init(void)
+{
+ platform_device_register(&omap_mbox_device);
+}
+#else
+static inline void omap_mbox_init(void) { }
+#endif /* CONFIG_OMAP_MBOX_FWK */
+
+static int __init omap34xx_init_devices(void)
+{
+ if (!cpu_is_omap34xx())
+ return 0;
+
+ omap_mbox_init();
+
+ return 0;
+}
+arch_initcall(omap34xx_init_devices);
diff --git a/arch/arm/mach-omap2/devices44xx.c b/arch/arm/mach-omap2/devices44xx.c
new file mode 100644
index 0000000..ad98033
--- /dev/null
+++ b/arch/arm/mach-omap2/devices44xx.c
@@ -0,0 +1,60 @@
+/*
+ * omap44xx architecture specific deivce initialization
+ *
+ * Copyright (C) 2010 Nokia Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+
+#include <plat/irqs.h>
+
+#include <mach/hardware.h>
+
+#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
+
+#define OMAP4_MBOX_REG_SIZE 0x130
+
+static struct resource omap_mbox_resources[] = {
+ {
+ .start = OMAP44XX_MAILBOX_BASE,
+ .end = OMAP44XX_MAILBOX_BASE +
+ OMAP4_MBOX_REG_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = INT_44XX_MAIL_U0_MPU,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device omap_mbox_device = {
+ .name = "omap2-mailbox",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(omap_mbox_resources),
+ .resource = omap_mbox_resources,
+};
+
+static inline void omap_mbox_init(void)
+{
+ platform_device_register(&omap_mbox_device);
+}
+#else
+static inline void omap_mbox_init(void) { }
+#endif /* CONFIG_OMAP_MBOX_FWK */
+
+static int __init omap44xx_init_devices(void)
+{
+ if (!cpu_is_omap44xx())
+ return;
+
+ omap_mbox_init();
+
+ return 0;
+}
+arch_initcall(omap44xx_init_devices);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] OMAP3: mailbox initialization for all omap versions
2010-04-01 11:26 ` Hiroshi DOYU
@ 2010-04-01 11:36 ` Felipe Balbi
2010-04-01 12:33 ` Paul Walmsley
1 sibling, 0 replies; 11+ messages in thread
From: Felipe Balbi @ 2010-04-01 11:36 UTC (permalink / raw)
To: Doyu Hiroshi (Nokia-D/Helsinki)
Cc: tony@atomide.com, Balbi Felipe (Nokia-D/Helsinki),
x0095840@ti.com, linux-omap@vger.kernel.org,
Palande Ameya (Nokia-D/Helsinki),
Contreras Felipe (Nokia-D/Helsinki)
Hi,
On Thu, Apr 01, 2010 at 01:26:29PM +0200, Doyu Hiroshi (Nokia-D/Helsinki) wrote:
>+static int __init omap24xx_init_devices(void)
>+{
>+ if (!cpu_is_omap24xx())
>+ return;
return 0
here.
>+static int __init omap44xx_init_devices(void)
>+{
>+ if (!cpu_is_omap44xx())
>+ return;
return 0
here too :-)
other than that, to me it looks a lot cleaner. Then we can start moving
any other device registration that still lies in devices.c to the new
files
--
balbi
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] OMAP3: mailbox initialization for all omap versions
2010-04-01 11:26 ` Hiroshi DOYU
2010-04-01 11:36 ` Felipe Balbi
@ 2010-04-01 12:33 ` Paul Walmsley
2010-04-01 12:50 ` Tony Lindgren
2010-04-01 13:06 ` Hiroshi DOYU
1 sibling, 2 replies; 11+ messages in thread
From: Paul Walmsley @ 2010-04-01 12:33 UTC (permalink / raw)
To: Hiroshi DOYU
Cc: tony, khilman, felipe.balbi, x0095840, linux-omap, ameya.palande,
felipe.contreras
Hi Hiroshi,
On Thu, 1 Apr 2010, Hiroshi DOYU wrote:
> From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
> Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
> Date: Thu, 01 Apr 2010 13:23:36 +0300 (EEST)
>
> > From: ext Tony Lindgren <tony@atomide.com>
> > Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
> > Date: Thu, 1 Apr 2010 11:52:04 +0200
> >
> >> * Hiroshi DOYU <Hiroshi.DOYU@nokia.com> [100329 02:05]:
> >>> From: "Balbi Felipe (Nokia-D/Helsinki)" <felipe.balbi@nokia.com>
> >>> Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
> >>> Date: Mon, 29 Mar 2010 09:01:45 +0200
> >>> >
> >>> > in that case, wouldn't it be better to split that into
> >>> > arch/arm/omap1/mbox.c arch/arm/omap2/mbox24xx.c
> >>> > arch/arm/omap2/mbox34xx.c arch/arm/omap2/mbox44xx.c ??
> >>> >
> >>> > that way we don't need ifdefs on the code and we will only compile what
> >>> > we really need.
> >>>
> >>> This is feasible.
> >>> But I'm not so sure whether adding 4 new files with around only 10
> >>> lines code is acceptable or not.
> >>>
> >>> Tony, any comment on the above?
> >>>
> >>> Basically there could be the case we need all resources if we want to
> >>> support omap1, 2, 3 and 4 at the same time, and the appropriate one
> >>> will be chosen at run time by CPUID. I'm not sure how mature "omap
> >>> multi arch" support is practically, but it's better to keep it as much
> >>> as possbile.
> >>
> >> I like Felipe's suggestion of adding devices2420.c, devices34xx.c,
> >> devices44xx.c or similar. Then do the device init from those with
> >> a arch_initcall that returns immediately if not running on the right
> >> soc.
> >
> > Ok, let's procced with this. I'll post something later.
> >
>
> Something like the following?
Is it possible to try a hwmod conversion of this? Similar to the UART,
HSMMC, etc. work that Kevin has queued in his pm-wip/hwmods branch:
http://git.kernel.org/?p=linux/kernel/git/khilman/linux-omap-pm.git;a=shortlog;h=refs/heads/pm-wip/hwmods
Otherwise this will all have to be redone when the mailbox is converted to
use hwmod.
- Paul
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] OMAP3: mailbox initialization for all omap versions
2010-04-01 12:33 ` Paul Walmsley
@ 2010-04-01 12:50 ` Tony Lindgren
2010-04-01 13:06 ` Hiroshi DOYU
1 sibling, 0 replies; 11+ messages in thread
From: Tony Lindgren @ 2010-04-01 12:50 UTC (permalink / raw)
To: Paul Walmsley
Cc: Hiroshi DOYU, khilman, felipe.balbi, x0095840, linux-omap,
ameya.palande, felipe.contreras
* Paul Walmsley <paul@pwsan.com> [100401 05:29]:
> Hi Hiroshi,
>
> On Thu, 1 Apr 2010, Hiroshi DOYU wrote:
>
> > From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
> > Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
> > Date: Thu, 01 Apr 2010 13:23:36 +0300 (EEST)
> >
> > > From: ext Tony Lindgren <tony@atomide.com>
> > > Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
> > > Date: Thu, 1 Apr 2010 11:52:04 +0200
> > >
> > >> * Hiroshi DOYU <Hiroshi.DOYU@nokia.com> [100329 02:05]:
> > >>> From: "Balbi Felipe (Nokia-D/Helsinki)" <felipe.balbi@nokia.com>
> > >>> Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
> > >>> Date: Mon, 29 Mar 2010 09:01:45 +0200
> > >>> >
> > >>> > in that case, wouldn't it be better to split that into
> > >>> > arch/arm/omap1/mbox.c arch/arm/omap2/mbox24xx.c
> > >>> > arch/arm/omap2/mbox34xx.c arch/arm/omap2/mbox44xx.c ??
> > >>> >
> > >>> > that way we don't need ifdefs on the code and we will only compile what
> > >>> > we really need.
> > >>>
> > >>> This is feasible.
> > >>> But I'm not so sure whether adding 4 new files with around only 10
> > >>> lines code is acceptable or not.
> > >>>
> > >>> Tony, any comment on the above?
> > >>>
> > >>> Basically there could be the case we need all resources if we want to
> > >>> support omap1, 2, 3 and 4 at the same time, and the appropriate one
> > >>> will be chosen at run time by CPUID. I'm not sure how mature "omap
> > >>> multi arch" support is practically, but it's better to keep it as much
> > >>> as possbile.
> > >>
> > >> I like Felipe's suggestion of adding devices2420.c, devices34xx.c,
> > >> devices44xx.c or similar. Then do the device init from those with
> > >> a arch_initcall that returns immediately if not running on the right
> > >> soc.
> > >
> > > Ok, let's procced with this. I'll post something later.
> > >
> >
> > Something like the following?
>
> Is it possible to try a hwmod conversion of this? Similar to the UART,
> HSMMC, etc. work that Kevin has queued in his pm-wip/hwmods branch:
>
> http://git.kernel.org/?p=linux/kernel/git/khilman/linux-omap-pm.git;a=shortlog;h=refs/heads/pm-wip/hwmods
>
> Otherwise this will all have to be redone when the mailbox is converted to
> use hwmod.
Sounds like a plan to me.
Tony
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] OMAP3: mailbox initialization for all omap versions
2010-04-01 12:33 ` Paul Walmsley
2010-04-01 12:50 ` Tony Lindgren
@ 2010-04-01 13:06 ` Hiroshi DOYU
1 sibling, 0 replies; 11+ messages in thread
From: Hiroshi DOYU @ 2010-04-01 13:06 UTC (permalink / raw)
To: paul
Cc: tony, khilman, felipe.balbi, x0095840, linux-omap, ameya.palande,
felipe.contreras
From: ext Paul Walmsley <paul@pwsan.com>
Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
Date: Thu, 1 Apr 2010 14:33:22 +0200
> Hi Hiroshi,
>
> On Thu, 1 Apr 2010, Hiroshi DOYU wrote:
>
>> From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
>> Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
>> Date: Thu, 01 Apr 2010 13:23:36 +0300 (EEST)
>>
>> > From: ext Tony Lindgren <tony@atomide.com>
>> > Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
>> > Date: Thu, 1 Apr 2010 11:52:04 +0200
>> >
>> >> * Hiroshi DOYU <Hiroshi.DOYU@nokia.com> [100329 02:05]:
>> >>> From: "Balbi Felipe (Nokia-D/Helsinki)" <felipe.balbi@nokia.com>
>> >>> Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
>> >>> Date: Mon, 29 Mar 2010 09:01:45 +0200
>> >>> >
>> >>> > in that case, wouldn't it be better to split that into
>> >>> > arch/arm/omap1/mbox.c arch/arm/omap2/mbox24xx.c
>> >>> > arch/arm/omap2/mbox34xx.c arch/arm/omap2/mbox44xx.c ??
>> >>> >
>> >>> > that way we don't need ifdefs on the code and we will only compile what
>> >>> > we really need.
>> >>>
>> >>> This is feasible.
>> >>> But I'm not so sure whether adding 4 new files with around only 10
>> >>> lines code is acceptable or not.
>> >>>
>> >>> Tony, any comment on the above?
>> >>>
>> >>> Basically there could be the case we need all resources if we want to
>> >>> support omap1, 2, 3 and 4 at the same time, and the appropriate one
>> >>> will be chosen at run time by CPUID. I'm not sure how mature "omap
>> >>> multi arch" support is practically, but it's better to keep it as much
>> >>> as possbile.
>> >>
>> >> I like Felipe's suggestion of adding devices2420.c, devices34xx.c,
>> >> devices44xx.c or similar. Then do the device init from those with
>> >> a arch_initcall that returns immediately if not running on the right
>> >> soc.
>> >
>> > Ok, let's procced with this. I'll post something later.
>> >
>>
>> Something like the following?
>
> Is it possible to try a hwmod conversion of this? Similar to the UART,
> HSMMC, etc. work that Kevin has queued in his pm-wip/hwmods branch:
I haven't followed this, but this looks more decriptive. I'll try.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2010-04-01 13:07 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-26 19:30 [PATCH] OMAP3: mailbox initialization for all omap versions Guzman Lugo, Fernando
2010-03-29 6:40 ` Hiroshi DOYU
2010-03-29 7:01 ` Felipe Balbi
2010-03-29 9:08 ` Hiroshi DOYU
2010-04-01 9:52 ` Tony Lindgren
2010-04-01 10:23 ` Hiroshi DOYU
2010-04-01 11:26 ` Hiroshi DOYU
2010-04-01 11:36 ` Felipe Balbi
2010-04-01 12:33 ` Paul Walmsley
2010-04-01 12:50 ` Tony Lindgren
2010-04-01 13:06 ` Hiroshi DOYU
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox