* [PATCH 00/15] omap: mailbox: reorganize init
@ 2010-05-13 17:47 Felipe Contreras
2010-05-13 17:47 ` [PATCH 01/15] omap: mailbox: trivial cleanups Felipe Contreras
` (15 more replies)
0 siblings, 16 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
The main purpose of this patch series is to be able to compile mach platform
data as built-in. Otherwise, client modules such as bridgedriver will load the
platform code, but not the mach code when mailbox is built as a module.
Unfortunately, there's no easy way to do that since plat and mach code are
deepely interrelated. So the first patches try to separate the mailbox
registering through a defined omap_mbox_platform_data.
Also, it's worth noting that mailboxes are not a one-to-one mapping to
resources; that is, some resources belong to multiple mboxes. So it's best to
think of mailboxes as fake devices. That is why custom platform_data is required.
Finally, a bunch of cleaning up is done in the very first patches, specially for
OMAP1.
The initial RFC included comments from Felipe Balbi, and this proposal includes
comments from Tony Lindgren.
Tested on OMAP3 (beagleboard), and compiled-tested for OMAP1.
Felipe Contreras (15):
omap: mailbox: trivial cleanups
omap: mailbox: reorganize structures
omap: mailbox: 2420 should be detected at run-time
omap: mailbox: use correct config for omap1
omap: mailbox: update omap1 probing
omap: mailbox: reorganize registering
omap: mailbox: only compile for configured archs
omap: mailbox: reorganize omap platform_device
omap: mailbox: move more stuff to omap_mbox_init()
omap: mailbox: trivial sync between omap1 and 2
omap: mailbox: split platform driver
omap: mailbox: always built-in platform data
omap: mailbox: reorganize headers
omap: mailbox: don't export unecessary symbols
omap: mailbox: mark some resources as __initdata
arch/arm/mach-omap1/Makefile | 6 +-
arch/arm/mach-omap1/devices.c | 40 -----
arch/arm/mach-omap1/mailbox.c | 114 ++++++++-----
arch/arm/mach-omap2/Makefile | 5 +-
arch/arm/mach-omap2/devices.c | 74 --------
arch/arm/mach-omap2/mailbox.c | 259 ++++++++++++++++-------------
arch/arm/plat-omap/include/plat/mailbox.h | 7 +-
arch/arm/plat-omap/mailbox.c | 53 +++++-
8 files changed, 275 insertions(+), 283 deletions(-)
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 01/15] omap: mailbox: trivial cleanups
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 02/15] omap: mailbox: reorganize structures Felipe Contreras
` (14 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
And fix a few compilation warnings.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap1/devices.c | 6 ++----
arch/arm/mach-omap1/mailbox.c | 3 +--
arch/arm/mach-omap2/mailbox.c | 7 +++----
arch/arm/plat-omap/mailbox.c | 2 --
4 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index a2d07aa..462b59c 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -73,12 +73,10 @@ static inline void omap_init_rtc(void) {}
# define INT_DSP_MAILBOX1 INT_1610_DSP_MAILBOX1
#endif
-#define OMAP1_MBOX_BASE OMAP1_IO_ADDRESS(OMAP16XX_MAILBOX_BASE)
-
static struct resource mbox_resources[] = {
{
- .start = OMAP1_MBOX_BASE,
- .end = OMAP1_MBOX_BASE + OMAP1_MBOX_SIZE,
+ .start = OMAP16XX_MAILBOX_BASE,
+ .end = OMAP16XX_MAILBOX_BASE + OMAP1_MBOX_SIZE,
.flags = IORESOURCE_MEM,
},
{
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index caf889a..f3266dd 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -146,7 +146,6 @@ EXPORT_SYMBOL(mbox_dsp_info);
static int __devinit omap1_mbox_probe(struct platform_device *pdev)
{
struct resource *res;
- int ret = 0;
if (pdev->num_resources != 2) {
dev_err(&pdev->dev, "invalid number of resources: %d\n",
@@ -160,7 +159,7 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "invalid mem resource\n");
return -ENODEV;
}
- mbox_base = res->start;
+ mbox_base = OMAP1_IO_ADDRESS(res->start);
/* DSP IRQ */
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 281ab63..7263b9b 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -93,7 +93,7 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
mbox_ick_handle = clk_get(NULL, "mailboxes_ick");
if (IS_ERR(mbox_ick_handle)) {
- printk(KERN_ERR "Could not get mailboxes_ick: %d\n",
+ printk(KERN_ERR "Could not get mailboxes_ick: %ld\n",
PTR_ERR(mbox_ick_handle));
return PTR_ERR(mbox_ick_handle);
}
@@ -279,8 +279,6 @@ static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
.irqdisable = MAILBOX_IRQENABLE(0),
};
-
-
/* OMAP4 specific data structure. Use the cpu_is_omap4xxx()
to use this*/
static struct omap_mbox2_priv omap2_mbox_1_priv = {
@@ -336,7 +334,6 @@ struct omap_mbox mbox_2_info = {
};
EXPORT_SYMBOL(mbox_2_info);
-
#if defined(CONFIG_ARCH_OMAP2420) /* IVA */
static struct omap_mbox2_priv omap2_mbox_iva_priv = {
.tx_fifo = {
@@ -419,8 +416,10 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
#endif
return 0;
+#if defined(CONFIG_ARCH_OMAP2420) /* IVA */
err_iva1:
omap_mbox_unregister(&mbox_dsp_info);
+#endif
err_dsp:
iounmap(mbox_base);
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 8d86b0b..822c377 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -82,7 +82,6 @@ static int __mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
return ret;
}
-
int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
{
@@ -108,7 +107,6 @@ static void mbox_tx_tasklet(unsigned long tx_data)
struct request_queue *q = mbox->txq->queue;
while (1) {
-
rq = blk_fetch_request(q);
if (!rq)
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 02/15] omap: mailbox: reorganize structures
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
2010-05-13 17:47 ` [PATCH 01/15] omap: mailbox: trivial cleanups Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 03/15] omap: mailbox: 2420 should be detected at run-time Felipe Contreras
` (13 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
OMAP4 ones messed up the organization.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap2/mailbox.c | 68 +++++++++++++++++++++--------------------
1 files changed, 35 insertions(+), 33 deletions(-)
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 7263b9b..252e53b 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -262,6 +262,7 @@ static struct omap_mbox_ops omap2_mbox_ops = {
*/
/* FIXME: the following structs should be filled automatically by the user id */
+
/* DSP */
static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
.tx_fifo = {
@@ -279,8 +280,40 @@ static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
.irqdisable = MAILBOX_IRQENABLE(0),
};
-/* OMAP4 specific data structure. Use the cpu_is_omap4xxx()
-to use this*/
+struct omap_mbox mbox_dsp_info = {
+ .name = "dsp",
+ .ops = &omap2_mbox_ops,
+ .priv = &omap2_mbox_dsp_priv,
+};
+EXPORT_SYMBOL(mbox_dsp_info);
+
+#if defined(CONFIG_ARCH_OMAP2420)
+
+/* IVA */
+static struct omap_mbox2_priv omap2_mbox_iva_priv = {
+ .tx_fifo = {
+ .msg = MAILBOX_MESSAGE(2),
+ .fifo_stat = MAILBOX_FIFOSTATUS(2),
+ },
+ .rx_fifo = {
+ .msg = MAILBOX_MESSAGE(3),
+ .msg_stat = MAILBOX_MSGSTATUS(3),
+ },
+ .irqenable = MAILBOX_IRQENABLE(3),
+ .irqstatus = MAILBOX_IRQSTATUS(3),
+ .notfull_bit = MAILBOX_IRQ_NOTFULL(2),
+ .newmsg_bit = MAILBOX_IRQ_NEWMSG(3),
+ .irqdisable = MAILBOX_IRQENABLE(3),
+};
+
+static struct omap_mbox mbox_iva_info = {
+ .name = "iva",
+ .ops = &omap2_mbox_ops,
+ .priv = &omap2_mbox_iva_priv,
+};
+#endif
+
+/* OMAP4 */
static struct omap_mbox2_priv omap2_mbox_1_priv = {
.tx_fifo = {
.msg = MAILBOX_MESSAGE(0),
@@ -304,13 +337,6 @@ struct omap_mbox mbox_1_info = {
};
EXPORT_SYMBOL(mbox_1_info);
-struct omap_mbox mbox_dsp_info = {
- .name = "dsp",
- .ops = &omap2_mbox_ops,
- .priv = &omap2_mbox_dsp_priv,
-};
-EXPORT_SYMBOL(mbox_dsp_info);
-
static struct omap_mbox2_priv omap2_mbox_2_priv = {
.tx_fifo = {
.msg = MAILBOX_MESSAGE(3),
@@ -334,30 +360,6 @@ struct omap_mbox mbox_2_info = {
};
EXPORT_SYMBOL(mbox_2_info);
-#if defined(CONFIG_ARCH_OMAP2420) /* IVA */
-static struct omap_mbox2_priv omap2_mbox_iva_priv = {
- .tx_fifo = {
- .msg = MAILBOX_MESSAGE(2),
- .fifo_stat = MAILBOX_FIFOSTATUS(2),
- },
- .rx_fifo = {
- .msg = MAILBOX_MESSAGE(3),
- .msg_stat = MAILBOX_MSGSTATUS(3),
- },
- .irqenable = MAILBOX_IRQENABLE(3),
- .irqstatus = MAILBOX_IRQSTATUS(3),
- .notfull_bit = MAILBOX_IRQ_NOTFULL(2),
- .newmsg_bit = MAILBOX_IRQ_NEWMSG(3),
- .irqdisable = MAILBOX_IRQENABLE(3),
-};
-
-static struct omap_mbox mbox_iva_info = {
- .name = "iva",
- .ops = &omap2_mbox_ops,
- .priv = &omap2_mbox_iva_priv,
-};
-#endif
-
static int __devinit omap2_mbox_probe(struct platform_device *pdev)
{
struct resource *res;
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 03/15] omap: mailbox: 2420 should be detected at run-time
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
2010-05-13 17:47 ` [PATCH 01/15] omap: mailbox: trivial cleanups Felipe Contreras
2010-05-13 17:47 ` [PATCH 02/15] omap: mailbox: reorganize structures Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-14 10:17 ` Sergei Shtylyov
2010-05-13 17:47 ` [PATCH 04/15] omap: mailbox: use correct config for omap1 Felipe Contreras
` (12 subsequent siblings)
15 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap2/mailbox.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 252e53b..6d17da8 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -431,7 +431,8 @@ err_dsp:
static int __devexit omap2_mbox_remove(struct platform_device *pdev)
{
#if defined(CONFIG_ARCH_OMAP2420)
- omap_mbox_unregister(&mbox_iva_info);
+ if (cpu_is_omap2420())
+ omap_mbox_unregister(&mbox_iva_info);
#endif
if (cpu_is_omap44xx()) {
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 04/15] omap: mailbox: use correct config for omap1
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (2 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 03/15] omap: mailbox: 2420 should be detected at run-time Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 05/15] omap: mailbox: update omap1 probing Felipe Contreras
` (11 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
CONFIG_OMAP_DSP is not in mainline, CONFIG_OMAP_MBOX_FWK is.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap1/devices.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 462b59c..da796f2 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -63,7 +63,7 @@ static void omap_init_rtc(void)
static inline void omap_init_rtc(void) {}
#endif
-#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
+#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
#if defined(CONFIG_ARCH_OMAP15XX)
# define OMAP1_MBOX_SIZE 0x23
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 05/15] omap: mailbox: update omap1 probing
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (3 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 04/15] omap: mailbox: use correct config for omap1 Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 06/15] omap: mailbox: reorganize registering Felipe Contreras
` (10 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Based on omap2 code.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap1/mailbox.c | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index f3266dd..9667f2f 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -146,12 +146,7 @@ EXPORT_SYMBOL(mbox_dsp_info);
static int __devinit omap1_mbox_probe(struct platform_device *pdev)
{
struct resource *res;
-
- if (pdev->num_resources != 2) {
- dev_err(&pdev->dev, "invalid number of resources: %d\n",
- pdev->num_resources);
- return -ENODEV;
- }
+ int ret;
/* MBOX base */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -159,23 +154,33 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "invalid mem resource\n");
return -ENODEV;
}
- mbox_base = OMAP1_IO_ADDRESS(res->start);
+ mbox_base = ioremap(res->start, resource_size(res));
+ if (!mbox_base)
+ return -ENOMEM;
/* DSP IRQ */
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (unlikely(!res)) {
dev_err(&pdev->dev, "invalid irq resource\n");
- return -ENODEV;
+ ret = -ENODEV;
+ goto err_out;
}
mbox_dsp_info.irq = res->start;
- return omap_mbox_register(&pdev->dev, &mbox_dsp_info);
+ ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info);
+ if (ret)
+ goto err_out;
+ return 0;
+
+err_out:
+ iounmap(mbox_base);
+ return ret;
}
static int __devexit omap1_mbox_remove(struct platform_device *pdev)
{
omap_mbox_unregister(&mbox_dsp_info);
-
+ iounmap(mbox_base);
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 06/15] omap: mailbox: reorganize registering
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (4 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 05/15] omap: mailbox: update omap1 probing Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 07/15] omap: mailbox: only compile for configured archs Felipe Contreras
` (9 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
This is a step forward to split the mbox registers.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap1/mailbox.c | 42 +++++++++--------
arch/arm/mach-omap2/mailbox.c | 99 +++++++++++++++++-----------------------
2 files changed, 65 insertions(+), 76 deletions(-)
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 9667f2f..8b18313 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -29,6 +29,8 @@
static void __iomem *mbox_base;
+static struct omap_mbox **list;
+
struct omap_mbox1_fifo {
unsigned long cmd;
unsigned long data;
@@ -143,43 +145,45 @@ struct omap_mbox mbox_dsp_info = {
};
EXPORT_SYMBOL(mbox_dsp_info);
+struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL };
+
static int __devinit omap1_mbox_probe(struct platform_device *pdev)
{
struct resource *res;
int ret;
+ int i;
- /* MBOX base */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (unlikely(!res)) {
- dev_err(&pdev->dev, "invalid mem resource\n");
- return -ENODEV;
- }
- mbox_base = ioremap(res->start, resource_size(res));
+ res = pdev->resource;
+
+ mbox_base = ioremap(res[0].start, resource_size(&res[0]));
if (!mbox_base)
return -ENOMEM;
- /* DSP IRQ */
- res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- if (unlikely(!res)) {
- dev_err(&pdev->dev, "invalid irq resource\n");
- ret = -ENODEV;
- goto err_out;
- }
- mbox_dsp_info.irq = res->start;
+ list = omap1_mboxes;
- ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info);
- if (ret)
- goto err_out;
+ list[0]->irq = res[1].start;
+
+ for (i = 0; list[i]; i++) {
+ ret = omap_mbox_register(&pdev->dev, list[i]);
+ if (ret)
+ goto err_out;
+ }
return 0;
err_out:
+ while (i--)
+ omap_mbox_unregister(list[i]);
iounmap(mbox_base);
return ret;
}
static int __devexit omap1_mbox_remove(struct platform_device *pdev)
{
- omap_mbox_unregister(&mbox_dsp_info);
+ int i;
+
+ for (i = 0; list[i]; i++)
+ omap_mbox_unregister(list[i]);
+
iounmap(mbox_base);
return 0;
}
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 6d17da8..0902965 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -53,6 +53,8 @@
static void __iomem *mbox_base;
+static struct omap_mbox **list;
+
struct omap_mbox2_fifo {
unsigned long msg;
unsigned long fifo_stat;
@@ -287,6 +289,8 @@ struct omap_mbox mbox_dsp_info = {
};
EXPORT_SYMBOL(mbox_dsp_info);
+struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL };
+
#if defined(CONFIG_ARCH_OMAP2420)
/* IVA */
@@ -311,6 +315,8 @@ static struct omap_mbox mbox_iva_info = {
.ops = &omap2_mbox_ops,
.priv = &omap2_mbox_iva_priv,
};
+
+struct omap_mbox *omap2_mboxes[] = { &mbox_iva_info, &mbox_dsp_info, NULL };
#endif
/* OMAP4 */
@@ -360,86 +366,65 @@ struct omap_mbox mbox_2_info = {
};
EXPORT_SYMBOL(mbox_2_info);
+struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL };
+
static int __devinit omap2_mbox_probe(struct platform_device *pdev)
{
struct resource *res;
int ret;
+ int i;
- /* MBOX base */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (unlikely(!res)) {
- dev_err(&pdev->dev, "invalid mem resource\n");
- return -ENODEV;
- }
- mbox_base = ioremap(res->start, resource_size(res));
+ res = pdev->resource;
+
+ mbox_base = ioremap(res[0].start, resource_size(&res[0]));
if (!mbox_base)
return -ENOMEM;
- /* DSP or IVA2 IRQ */
- res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+ if (cpu_is_omap3430()) {
+ list = omap3_mboxes;
+
+ list[0]->irq = res[1].start;
+ }
+#if defined(CONFIG_ARCH_OMAP2420)
+ else if (cpu_is_omap2420()) {
+ list = omap2_mboxes;
- if (unlikely(!res)) {
- dev_err(&pdev->dev, "invalid irq resource\n");
- ret = -ENODEV;
- goto err_dsp;
+ list[0]->irq = res[1].start;
+ list[1]->irq = res[2].start;
}
- if (cpu_is_omap44xx()) {
- mbox_1_info.irq = res->start;
- ret = omap_mbox_register(&pdev->dev, &mbox_1_info);
- } else {
- mbox_dsp_info.irq = res->start;
- ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info);
+#endif
+ else if (cpu_is_omap44xx()) {
+ list = omap4_mboxes;
+
+ list[0]->irq = res[1].start;
+ list[1]->irq = res[1].start;
}
- if (ret)
- goto err_dsp;
-
- if (cpu_is_omap44xx()) {
- mbox_2_info.irq = res->start;
- ret = omap_mbox_register(&pdev->dev, &mbox_2_info);
- if (ret) {
- omap_mbox_unregister(&mbox_1_info);
- goto err_dsp;
- }
+ else {
+ pr_err("%s: platform not supported\n", __func__);
+ return -ENODEV;
}
-#if defined(CONFIG_ARCH_OMAP2420) /* IVA */
- if (cpu_is_omap2420()) {
- /* IVA IRQ */
- res = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
- if (unlikely(!res)) {
- dev_err(&pdev->dev, "invalid irq resource\n");
- ret = -ENODEV;
- goto err_iva1;
- }
- mbox_iva_info.irq = res->start;
- ret = omap_mbox_register(&pdev->dev, &mbox_iva_info);
+
+ for (i = 0; list[i]; i++) {
+ ret = omap_mbox_register(&pdev->dev, list[i]);
if (ret)
- goto err_iva1;
+ goto err_out;
}
-#endif
return 0;
-#if defined(CONFIG_ARCH_OMAP2420) /* IVA */
-err_iva1:
- omap_mbox_unregister(&mbox_dsp_info);
-#endif
-
-err_dsp:
+err_out:
+ while (i--)
+ omap_mbox_unregister(list[i]);
iounmap(mbox_base);
return ret;
}
static int __devexit omap2_mbox_remove(struct platform_device *pdev)
{
-#if defined(CONFIG_ARCH_OMAP2420)
- if (cpu_is_omap2420())
- omap_mbox_unregister(&mbox_iva_info);
-#endif
+ int i;
+
+ for (i = 0; list[i]; i++)
+ omap_mbox_unregister(list[i]);
- if (cpu_is_omap44xx()) {
- omap_mbox_unregister(&mbox_2_info);
- omap_mbox_unregister(&mbox_1_info);
- } else
- omap_mbox_unregister(&mbox_dsp_info);
iounmap(mbox_base);
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 07/15] omap: mailbox: only compile for configured archs
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (5 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 06/15] omap: mailbox: reorganize registering Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 08/15] omap: mailbox: reorganize omap platform_device Felipe Contreras
` (8 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap2/mailbox.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 0902965..103c670 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -265,6 +265,7 @@ static struct omap_mbox_ops omap2_mbox_ops = {
/* FIXME: the following structs should be filled automatically by the user id */
+#if defined(CONFIG_ARCH_OMAP3430) || defined(CONFIG_ARCH_OMAP2420)
/* DSP */
static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
.tx_fifo = {
@@ -288,11 +289,13 @@ struct omap_mbox mbox_dsp_info = {
.priv = &omap2_mbox_dsp_priv,
};
EXPORT_SYMBOL(mbox_dsp_info);
+#endif
+#if defined(CONFIG_ARCH_OMAP3430)
struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL };
+#endif
#if defined(CONFIG_ARCH_OMAP2420)
-
/* IVA */
static struct omap_mbox2_priv omap2_mbox_iva_priv = {
.tx_fifo = {
@@ -319,6 +322,7 @@ static struct omap_mbox mbox_iva_info = {
struct omap_mbox *omap2_mboxes[] = { &mbox_iva_info, &mbox_dsp_info, NULL };
#endif
+#if defined(CONFIG_ARCH_OMAP4)
/* OMAP4 */
static struct omap_mbox2_priv omap2_mbox_1_priv = {
.tx_fifo = {
@@ -367,6 +371,7 @@ struct omap_mbox mbox_2_info = {
EXPORT_SYMBOL(mbox_2_info);
struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL };
+#endif
static int __devinit omap2_mbox_probe(struct platform_device *pdev)
{
@@ -380,11 +385,15 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
if (!mbox_base)
return -ENOMEM;
- if (cpu_is_omap3430()) {
+ if (false) {
+ }
+#if defined(CONFIG_ARCH_OMAP3430)
+ else if (cpu_is_omap3430()) {
list = omap3_mboxes;
list[0]->irq = res[1].start;
}
+#endif
#if defined(CONFIG_ARCH_OMAP2420)
else if (cpu_is_omap2420()) {
list = omap2_mboxes;
@@ -393,12 +402,14 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
list[1]->irq = res[2].start;
}
#endif
+#if defined(CONFIG_ARCH_OMAP4)
else if (cpu_is_omap44xx()) {
list = omap4_mboxes;
list[0]->irq = res[1].start;
list[1]->irq = res[1].start;
}
+#endif
else {
pr_err("%s: platform not supported\n", __func__);
return -ENODEV;
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 08/15] omap: mailbox: reorganize omap platform_device
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (6 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 07/15] omap: mailbox: only compile for configured archs Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 09/15] omap: mailbox: move more stuff to omap_mbox_init() Felipe Contreras
` (7 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Makes more sense to register in the mach file, plus it will allow more
functionality later on.
Also, this probably enables multi-omap for real.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap1/devices.c | 38 ----------------
arch/arm/mach-omap1/mailbox.c | 57 ++++++++++++++++++++++++
arch/arm/mach-omap2/devices.c | 74 -------------------------------
arch/arm/mach-omap2/mailbox.c | 97 +++++++++++++++++++++++++++++++++++++++--
4 files changed, 150 insertions(+), 116 deletions(-)
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index da796f2..093dd13 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -63,43 +63,6 @@ static void omap_init_rtc(void)
static inline void omap_init_rtc(void) {}
#endif
-#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
-
-#if defined(CONFIG_ARCH_OMAP15XX)
-# define OMAP1_MBOX_SIZE 0x23
-# define INT_DSP_MAILBOX1 INT_1510_DSP_MAILBOX1
-#elif defined(CONFIG_ARCH_OMAP16XX)
-# define OMAP1_MBOX_SIZE 0x2f
-# define INT_DSP_MAILBOX1 INT_1610_DSP_MAILBOX1
-#endif
-
-static struct resource mbox_resources[] = {
- {
- .start = OMAP16XX_MAILBOX_BASE,
- .end = OMAP16XX_MAILBOX_BASE + OMAP1_MBOX_SIZE,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = INT_DSP_MAILBOX1,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device mbox_device = {
- .name = "omap1-mailbox",
- .id = -1,
- .num_resources = ARRAY_SIZE(mbox_resources),
- .resource = mbox_resources,
-};
-
-static inline void omap_init_mbox(void)
-{
- platform_device_register(&mbox_device);
-}
-#else
-static inline void omap_init_mbox(void) { }
-#endif
-
/*-------------------------------------------------------------------------*/
#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
@@ -293,7 +256,6 @@ static int __init omap1_init_devices(void)
* in alphabetical order so they're easier to sort through.
*/
- omap_init_mbox();
omap_init_rtc();
omap_init_spi100k();
omap_init_sti();
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 8b18313..e28b226 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -147,6 +147,20 @@ EXPORT_SYMBOL(mbox_dsp_info);
struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL };
+#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
+static struct resource omap1_mbox_resources[] = {
+ {
+ .start = OMAP16XX_MAILBOX_BASE,
+ .end = OMAP16XX_MAILBOX_BASE, /* to be updated */
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = 10,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+#endif
+
static int __devinit omap1_mbox_probe(struct platform_device *pdev)
{
struct resource *res;
@@ -198,7 +212,50 @@ static struct platform_driver omap1_mbox_driver = {
static int __init omap1_mbox_init(void)
{
+ int err;
+ struct platform_device *pdev;
+ struct resource *res;
+ unsigned num;
+
+ if (false) {
+ }
+#if defined(CONFIG_ARCH_OMAP15XX)
+ else if (cpu_is_omap15xx()) {
+ res = omap1_mbox_resources;
+ num = ARRAY_SIZE(omap1_mbox_resources);
+ res[1].end += 0x23;
+ }
+#endif
+#if defined(CONFIG_ARCH_OMAP16XX)
+ else if (cpu_is_omap16xx()) {
+ res = omap1_mbox_resources;
+ num = ARRAY_SIZE(omap1_mbox_resources);
+ res[1].end += 0x2f;
+ }
+#endif
+ else {
+ pr_err("%s: platform not supported\n", __func__);
+ return -ENODEV;
+ }
+
+ pdev = platform_device_alloc("omap1-mailbox", -1);
+ if (!pdev) {
+ err = -ENOMEM;
+ goto err_out;
+ }
+
+ err = platform_device_add_resources(pdev, res, num);
+ if (err)
+ goto err_out;
+
+ err = platform_device_add(pdev);
+ if (err)
+ goto err_out;
+
return platform_driver_register(&omap1_mbox_driver);
+
+err_out:
+ return err;
}
static void __exit omap1_mbox_exit(void)
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 18ad931..bc7ac38 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -136,79 +136,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_STI)
#if defined(CONFIG_ARCH_OMAP2)
@@ -772,7 +699,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/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 103c670..31a0659 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -373,6 +373,52 @@ EXPORT_SYMBOL(mbox_2_info);
struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL };
#endif
+#ifdef CONFIG_ARCH_OMAP2420
+static struct resource omap2_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_OMAP3430
+static struct resource omap3_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
+static struct resource omap4_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 int __devinit omap2_mbox_probe(struct platform_device *pdev)
{
struct resource *res;
@@ -410,10 +456,6 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
list[1]->irq = res[1].start;
}
#endif
- else {
- pr_err("%s: platform not supported\n", __func__);
- return -ENODEV;
- }
for (i = 0; list[i]; i++) {
ret = omap_mbox_register(&pdev->dev, list[i]);
@@ -450,7 +492,54 @@ static struct platform_driver omap2_mbox_driver = {
static int __init omap2_mbox_init(void)
{
+ int err;
+ struct platform_device *pdev;
+ struct resource *res;
+ unsigned num;
+
+ if (false) {
+ }
+#if defined(CONFIG_ARCH_OMAP3430)
+ else if (cpu_is_omap3430()) {
+ res = omap3_mbox_resources;
+ num = ARRAY_SIZE(omap3_mbox_resources);
+ }
+#endif
+#if defined(CONFIG_ARCH_OMAP2420)
+ else if (cpu_is_omap2420()) {
+ res = omap2_mbox_resources;
+ num = ARRAY_SIZE(omap2_mbox_resources);
+ }
+#endif
+#if defined(CONFIG_ARCH_OMAP4)
+ else if (cpu_is_omap44xx()) {
+ res = omap4_mbox_resources;
+ num = ARRAY_SIZE(omap4_mbox_resources);
+ }
+#endif
+ else {
+ pr_err("%s: platform not supported\n", __func__);
+ return -ENODEV;
+ }
+
+ pdev = platform_device_alloc("omap2-mailbox", -1);
+ if (!pdev) {
+ err = -ENOMEM;
+ goto err_out;
+ }
+
+ err = platform_device_add_resources(pdev, res, num);
+ if (err)
+ goto err_out;
+
+ err = platform_device_add(pdev);
+ if (err)
+ goto err_out;
+
return platform_driver_register(&omap2_mbox_driver);
+
+err_out:
+ return err;
}
static void __exit omap2_mbox_exit(void)
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 09/15] omap: mailbox: move more stuff to omap_mbox_init()
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (7 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 08/15] omap: mailbox: reorganize omap platform_device Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 10/15] omap: mailbox: trivial sync between omap1 and 2 Felipe Contreras
` (6 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Will be needed to split the platform_driver.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap1/mailbox.c | 23 ++++++++++--------
arch/arm/mach-omap2/mailbox.c | 50 ++++++++++++++--------------------------
2 files changed, 31 insertions(+), 42 deletions(-)
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index e28b226..d57fb5d 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -169,14 +169,6 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev)
res = pdev->resource;
- mbox_base = ioremap(res[0].start, resource_size(&res[0]));
- if (!mbox_base)
- return -ENOMEM;
-
- list = omap1_mboxes;
-
- list[0]->irq = res[1].start;
-
for (i = 0; list[i]; i++) {
ret = omap_mbox_register(&pdev->dev, list[i]);
if (ret)
@@ -187,7 +179,6 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev)
err_out:
while (i--)
omap_mbox_unregister(list[i]);
- iounmap(mbox_base);
return ret;
}
@@ -198,7 +189,6 @@ static int __devexit omap1_mbox_remove(struct platform_device *pdev)
for (i = 0; list[i]; i++)
omap_mbox_unregister(list[i]);
- iounmap(mbox_base);
return 0;
}
@@ -223,14 +213,20 @@ static int __init omap1_mbox_init(void)
else if (cpu_is_omap15xx()) {
res = omap1_mbox_resources;
num = ARRAY_SIZE(omap1_mbox_resources);
+ list = omap1_mboxes;
+
res[1].end += 0x23;
+ list[0]->irq = res[1].start;
}
#endif
#if defined(CONFIG_ARCH_OMAP16XX)
else if (cpu_is_omap16xx()) {
res = omap1_mbox_resources;
num = ARRAY_SIZE(omap1_mbox_resources);
+ list = omap1_mboxes;
+
res[1].end += 0x2f;
+ list[0]->irq = res[1].start;
}
#endif
else {
@@ -252,6 +248,12 @@ static int __init omap1_mbox_init(void)
if (err)
goto err_out;
+ mbox_base = ioremap(res[0].start, resource_size(&res[0]));
+ if (!mbox_base) {
+ platform_device_put(pdev);
+ return -ENOMEM;
+ }
+
return platform_driver_register(&omap1_mbox_driver);
err_out:
@@ -261,6 +263,7 @@ err_out:
static void __exit omap1_mbox_exit(void)
{
platform_driver_unregister(&omap1_mbox_driver);
+ iounmap(mbox_base);
}
module_init(omap1_mbox_init);
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 31a0659..cea18bc 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -427,36 +427,6 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
res = pdev->resource;
- mbox_base = ioremap(res[0].start, resource_size(&res[0]));
- if (!mbox_base)
- return -ENOMEM;
-
- if (false) {
- }
-#if defined(CONFIG_ARCH_OMAP3430)
- else if (cpu_is_omap3430()) {
- list = omap3_mboxes;
-
- list[0]->irq = res[1].start;
- }
-#endif
-#if defined(CONFIG_ARCH_OMAP2420)
- else if (cpu_is_omap2420()) {
- list = omap2_mboxes;
-
- list[0]->irq = res[1].start;
- list[1]->irq = res[2].start;
- }
-#endif
-#if defined(CONFIG_ARCH_OMAP4)
- else if (cpu_is_omap44xx()) {
- list = omap4_mboxes;
-
- list[0]->irq = res[1].start;
- list[1]->irq = res[1].start;
- }
-#endif
-
for (i = 0; list[i]; i++) {
ret = omap_mbox_register(&pdev->dev, list[i]);
if (ret)
@@ -467,7 +437,6 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
err_out:
while (i--)
omap_mbox_unregister(list[i]);
- iounmap(mbox_base);
return ret;
}
@@ -478,7 +447,6 @@ static int __devexit omap2_mbox_remove(struct platform_device *pdev)
for (i = 0; list[i]; i++)
omap_mbox_unregister(list[i]);
- iounmap(mbox_base);
return 0;
}
@@ -503,18 +471,29 @@ static int __init omap2_mbox_init(void)
else if (cpu_is_omap3430()) {
res = omap3_mbox_resources;
num = ARRAY_SIZE(omap3_mbox_resources);
+ list = omap3_mboxes;
+
+ list[0]->irq = res[1].start;
}
#endif
#if defined(CONFIG_ARCH_OMAP2420)
else if (cpu_is_omap2420()) {
res = omap2_mbox_resources;
num = ARRAY_SIZE(omap2_mbox_resources);
+ list = omap2_mboxes;
+
+ list[0]->irq = res[1].start;
+ list[1]->irq = res[2].start;
}
#endif
#if defined(CONFIG_ARCH_OMAP4)
else if (cpu_is_omap44xx()) {
res = omap4_mbox_resources;
num = ARRAY_SIZE(omap4_mbox_resources);
+ list = omap4_mboxes;
+
+ list[0]->irq = res[1].start;
+ list[1]->irq = res[1].start;
}
#endif
else {
@@ -536,6 +515,12 @@ static int __init omap2_mbox_init(void)
if (err)
goto err_out;
+ mbox_base = ioremap(res[0].start, resource_size(&res[0]));
+ if (!mbox_base) {
+ platform_device_put(pdev);
+ return -ENOMEM;
+ }
+
return platform_driver_register(&omap2_mbox_driver);
err_out:
@@ -545,6 +530,7 @@ err_out:
static void __exit omap2_mbox_exit(void)
{
platform_driver_unregister(&omap2_mbox_driver);
+ iounmap(mbox_base);
}
module_init(omap2_mbox_init);
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 10/15] omap: mailbox: trivial sync between omap1 and 2
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (8 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 09/15] omap: mailbox: move more stuff to omap_mbox_init() Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 11/15] omap: mailbox: split platform driver Felipe Contreras
` (5 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap1/mailbox.c | 2 +-
arch/arm/mach-omap2/mailbox.c | 6 ++----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index d57fb5d..64c1dc2 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -1,5 +1,5 @@
/*
- * Mailbox reservation modules for DSP
+ * Mailbox reservation modules for OMAP1
*
* Copyright (C) 2006-2009 Nokia Corporation
* Written by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index cea18bc..941ee30 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -18,8 +18,6 @@
#include <plat/mailbox.h>
#include <mach/irqs.h>
-#define DRV_NAME "omap2-mailbox"
-
#define MAILBOX_REVISION 0x000
#define MAILBOX_SYSCONFIG 0x010
#define MAILBOX_SYSSTATUS 0x014
@@ -454,7 +452,7 @@ static struct platform_driver omap2_mbox_driver = {
.probe = omap2_mbox_probe,
.remove = __devexit_p(omap2_mbox_remove),
.driver = {
- .name = DRV_NAME,
+ .name = "omap2-mailbox",
},
};
@@ -539,4 +537,4 @@ module_exit(omap2_mbox_exit);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("omap mailbox: omap2/3/4 architecture specific functions");
MODULE_AUTHOR("Hiroshi DOYU <Hiroshi.DOYU@nokia.com>, Paul Mundt");
-MODULE_ALIAS("platform:"DRV_NAME);
+MODULE_ALIAS("platform:omap2-mailbox");
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 11/15] omap: mailbox: split platform driver
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (9 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 10/15] omap: mailbox: trivial sync between omap1 and 2 Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 12/15] omap: mailbox: always built-in platform data Felipe Contreras
` (4 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
This will allow the current 'mailbox_mach' to be built-in.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap1/mailbox.c | 50 +++++------------------------
arch/arm/mach-omap2/mailbox.c | 50 +++++------------------------
arch/arm/plat-omap/include/plat/mailbox.h | 4 ++
arch/arm/plat-omap/mailbox.c | 45 +++++++++++++++++++++++++-
4 files changed, 64 insertions(+), 85 deletions(-)
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 64c1dc2..036e159 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -161,51 +161,13 @@ static struct resource omap1_mbox_resources[] = {
};
#endif
-static int __devinit omap1_mbox_probe(struct platform_device *pdev)
-{
- struct resource *res;
- int ret;
- int i;
-
- res = pdev->resource;
-
- for (i = 0; list[i]; i++) {
- ret = omap_mbox_register(&pdev->dev, list[i]);
- if (ret)
- goto err_out;
- }
- return 0;
-
-err_out:
- while (i--)
- omap_mbox_unregister(list[i]);
- return ret;
-}
-
-static int __devexit omap1_mbox_remove(struct platform_device *pdev)
-{
- int i;
-
- for (i = 0; list[i]; i++)
- omap_mbox_unregister(list[i]);
-
- return 0;
-}
-
-static struct platform_driver omap1_mbox_driver = {
- .probe = omap1_mbox_probe,
- .remove = __devexit_p(omap1_mbox_remove),
- .driver = {
- .name = "omap1-mailbox",
- },
-};
-
static int __init omap1_mbox_init(void)
{
int err;
struct platform_device *pdev;
struct resource *res;
unsigned num;
+ struct omap_mbox_platform_data pdata;
if (false) {
}
@@ -234,7 +196,7 @@ static int __init omap1_mbox_init(void)
return -ENODEV;
}
- pdev = platform_device_alloc("omap1-mailbox", -1);
+ pdev = platform_device_alloc("omap-mailbox", -1);
if (!pdev) {
err = -ENOMEM;
goto err_out;
@@ -244,6 +206,11 @@ static int __init omap1_mbox_init(void)
if (err)
goto err_out;
+ pdata.list = list;
+ err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
+ if (err)
+ goto err_out;
+
err = platform_device_add(pdev);
if (err)
goto err_out;
@@ -254,7 +221,7 @@ static int __init omap1_mbox_init(void)
return -ENOMEM;
}
- return platform_driver_register(&omap1_mbox_driver);
+ return 0;
err_out:
return err;
@@ -262,7 +229,6 @@ err_out:
static void __exit omap1_mbox_exit(void)
{
- platform_driver_unregister(&omap1_mbox_driver);
iounmap(mbox_base);
}
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 941ee30..7abd159 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -417,51 +417,13 @@ static struct resource omap4_mbox_resources[] = {
};
#endif
-static int __devinit omap2_mbox_probe(struct platform_device *pdev)
-{
- struct resource *res;
- int ret;
- int i;
-
- res = pdev->resource;
-
- for (i = 0; list[i]; i++) {
- ret = omap_mbox_register(&pdev->dev, list[i]);
- if (ret)
- goto err_out;
- }
- return 0;
-
-err_out:
- while (i--)
- omap_mbox_unregister(list[i]);
- return ret;
-}
-
-static int __devexit omap2_mbox_remove(struct platform_device *pdev)
-{
- int i;
-
- for (i = 0; list[i]; i++)
- omap_mbox_unregister(list[i]);
-
- return 0;
-}
-
-static struct platform_driver omap2_mbox_driver = {
- .probe = omap2_mbox_probe,
- .remove = __devexit_p(omap2_mbox_remove),
- .driver = {
- .name = "omap2-mailbox",
- },
-};
-
static int __init omap2_mbox_init(void)
{
int err;
struct platform_device *pdev;
struct resource *res;
unsigned num;
+ struct omap_mbox_platform_data pdata;
if (false) {
}
@@ -499,7 +461,7 @@ static int __init omap2_mbox_init(void)
return -ENODEV;
}
- pdev = platform_device_alloc("omap2-mailbox", -1);
+ pdev = platform_device_alloc("omap-mailbox", -1);
if (!pdev) {
err = -ENOMEM;
goto err_out;
@@ -509,6 +471,11 @@ static int __init omap2_mbox_init(void)
if (err)
goto err_out;
+ pdata.list = list;
+ err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
+ if (err)
+ goto err_out;
+
err = platform_device_add(pdev);
if (err)
goto err_out;
@@ -519,7 +486,7 @@ static int __init omap2_mbox_init(void)
return -ENOMEM;
}
- return platform_driver_register(&omap2_mbox_driver);
+ return 0;
err_out:
return err;
@@ -527,7 +494,6 @@ err_out:
static void __exit omap2_mbox_exit(void)
{
- platform_driver_unregister(&omap2_mbox_driver);
iounmap(mbox_base);
}
diff --git a/arch/arm/plat-omap/include/plat/mailbox.h b/arch/arm/plat-omap/include/plat/mailbox.h
index 729166b..cfbe221 100644
--- a/arch/arm/plat-omap/include/plat/mailbox.h
+++ b/arch/arm/plat-omap/include/plat/mailbox.h
@@ -67,6 +67,10 @@ struct omap_mbox {
void (*err_notify)(void);
};
+struct omap_mbox_platform_data {
+ struct omap_mbox **list;
+};
+
int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg);
void omap_mbox_init_seq(struct omap_mbox *);
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 822c377..7ccd1e7 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -25,6 +25,7 @@
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/delay.h>
+#include <linux/platform_device.h>
#include <plat/mailbox.h>
@@ -408,14 +409,56 @@ int omap_mbox_unregister(struct omap_mbox *mbox)
}
EXPORT_SYMBOL(omap_mbox_unregister);
-static int __init omap_mbox_init(void)
+static int __devinit omap_mbox_probe(struct platform_device *pdev)
+{
+ struct omap_mbox_platform_data *pdata = pdev->dev.platform_data;
+ struct resource *res;
+ int ret;
+ int i;
+
+ res = pdev->resource;
+
+ for (i = 0; pdata->list[i]; i++) {
+ ret = omap_mbox_register(&pdev->dev, pdata->list[i]);
+ if (ret)
+ goto err_out;
+ }
+ return 0;
+
+err_out:
+ while (i--)
+ omap_mbox_unregister(pdata->list[i]);
+ return ret;
+}
+
+static int __devexit omap_mbox_remove(struct platform_device *pdev)
{
+ struct omap_mbox_platform_data *pdata = pdev->dev.platform_data;
+ int i;
+
+ for (i = 0; pdata->list[i]; i++)
+ omap_mbox_unregister(pdata->list[i]);
+
return 0;
}
+
+static struct platform_driver omap_mbox_driver = {
+ .probe = omap_mbox_probe,
+ .remove = __devexit_p(omap_mbox_remove),
+ .driver = {
+ .name = "omap-mailbox",
+ },
+};
+
+static int __init omap_mbox_init(void)
+{
+ return platform_driver_register(&omap_mbox_driver);
+}
module_init(omap_mbox_init);
static void __exit omap_mbox_exit(void)
{
+ platform_driver_unregister(&omap_mbox_driver);
}
module_exit(omap_mbox_exit);
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 12/15] omap: mailbox: always built-in platform data
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (10 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 11/15] omap: mailbox: split platform driver Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 13/15] omap: mailbox: reorganize headers Felipe Contreras
` (3 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap1/Makefile | 6 +++---
arch/arm/mach-omap2/Makefile | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 9ce17f1..af2b2ea 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -14,9 +14,9 @@ obj-$(CONFIG_OMAP_32K_TIMER) += timer32k.o
# Power Management
obj-$(CONFIG_PM) += pm.o sleep.o
-# DSP
-obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
-mailbox_mach-objs := mailbox.o
+ifneq ($(CONFIG_OMAP_MBOX_FWK),)
+obj-y += mailbox.o
+endif
i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
obj-y += $(i2c-omap-m) $(i2c-omap-y)
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 307f8b0..9fcd87b 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -56,8 +56,9 @@ obj-$(CONFIG_ARCH_OMAP4) += clock44xx.o clock44xx_data.o
# EMU peripherals
obj-$(CONFIG_OMAP3_EMU) += emu.o
-obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
-mailbox_mach-objs := mailbox.o
+ifneq ($(CONFIG_OMAP_MBOX_FWK),)
+obj-y += mailbox.o
+endif
iommu-y += iommu2.o
iommu-$(CONFIG_ARCH_OMAP3) += omap3-iommu.o
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 13/15] omap: mailbox: reorganize headers
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (11 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 12/15] omap: mailbox: always built-in platform data Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 14/15] omap: mailbox: don't export unecessary symbols Felipe Contreras
` (2 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap1/mailbox.c | 5 +----
arch/arm/mach-omap2/mailbox.c | 7 +++----
arch/arm/plat-omap/include/plat/mailbox.h | 3 ---
arch/arm/plat-omap/mailbox.c | 6 +++---
4 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 036e159..8eea651 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -9,13 +9,10 @@
* for more details.
*/
-#include <linux/kernel.h>
-#include <linux/resource.h>
-#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/io.h>
+
#include <plat/mailbox.h>
-#include <mach/irqs.h>
#define MAILBOX_ARM2DSP1 0x00
#define MAILBOX_ARM2DSP1b 0x04
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 7abd159..2817103 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -10,13 +10,12 @@
* for more details.
*/
-#include <linux/kernel.h>
-#include <linux/clk.h>
-#include <linux/err.h>
#include <linux/platform_device.h>
+#include <linux/clk.h>
#include <linux/io.h>
+#include <linux/err.h>
+
#include <plat/mailbox.h>
-#include <mach/irqs.h>
#define MAILBOX_REVISION 0x000
#define MAILBOX_SYSCONFIG 0x010
diff --git a/arch/arm/plat-omap/include/plat/mailbox.h b/arch/arm/plat-omap/include/plat/mailbox.h
index cfbe221..fe30dc5 100644
--- a/arch/arm/plat-omap/include/plat/mailbox.h
+++ b/arch/arm/plat-omap/include/plat/mailbox.h
@@ -3,9 +3,6 @@
#ifndef MAILBOX_H
#define MAILBOX_H
-#include <linux/wait.h>
-#include <linux/workqueue.h>
-#include <linux/blkdev.h>
#include <linux/interrupt.h>
typedef u32 mbox_msg_t;
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 7ccd1e7..2727e52 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -21,11 +21,11 @@
*
*/
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/device.h>
+#include <linux/spinlock_types.h>
+#include <linux/mutex.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
+#include <linux/blkdev.h>
#include <plat/mailbox.h>
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 14/15] omap: mailbox: don't export unecessary symbols
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (12 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 13/15] omap: mailbox: reorganize headers Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 15/15] omap: mailbox: mark some resources as __initdata Felipe Contreras
2010-05-14 9:12 ` [PATCH 00/15] omap: mailbox: reorganize init Hiroshi DOYU
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap1/mailbox.c | 1 -
arch/arm/mach-omap2/mailbox.c | 3 ---
2 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 8eea651..b01d3c3 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -140,7 +140,6 @@ struct omap_mbox mbox_dsp_info = {
.ops = &omap1_mbox_ops,
.priv = &omap1_mbox_dsp_priv,
};
-EXPORT_SYMBOL(mbox_dsp_info);
struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL };
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 2817103..b0d7740 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -285,7 +285,6 @@ struct omap_mbox mbox_dsp_info = {
.ops = &omap2_mbox_ops,
.priv = &omap2_mbox_dsp_priv,
};
-EXPORT_SYMBOL(mbox_dsp_info);
#endif
#if defined(CONFIG_ARCH_OMAP3430)
@@ -342,7 +341,6 @@ struct omap_mbox mbox_1_info = {
.ops = &omap2_mbox_ops,
.priv = &omap2_mbox_1_priv,
};
-EXPORT_SYMBOL(mbox_1_info);
static struct omap_mbox2_priv omap2_mbox_2_priv = {
.tx_fifo = {
@@ -365,7 +363,6 @@ struct omap_mbox mbox_2_info = {
.ops = &omap2_mbox_ops,
.priv = &omap2_mbox_2_priv,
};
-EXPORT_SYMBOL(mbox_2_info);
struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL };
#endif
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 15/15] omap: mailbox: mark some resources as __initdata
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (13 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 14/15] omap: mailbox: don't export unecessary symbols Felipe Contreras
@ 2010-05-13 17:47 ` Felipe Contreras
2010-05-14 9:12 ` [PATCH 00/15] omap: mailbox: reorganize init Hiroshi DOYU
15 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-13 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
arch/arm/mach-omap1/mailbox.c | 2 +-
arch/arm/mach-omap2/mailbox.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index b01d3c3..74d2677 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -144,7 +144,7 @@ struct omap_mbox mbox_dsp_info = {
struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL };
#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
-static struct resource omap1_mbox_resources[] = {
+static struct resource __initdata omap1_mbox_resources[] = {
{
.start = OMAP16XX_MAILBOX_BASE,
.end = OMAP16XX_MAILBOX_BASE, /* to be updated */
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index b0d7740..a2fa784 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -368,7 +368,7 @@ struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL };
#endif
#ifdef CONFIG_ARCH_OMAP2420
-static struct resource omap2_mbox_resources[] = {
+static struct resource __initdata omap2_mbox_resources[] = {
{
.start = OMAP24XX_MAILBOX_BASE,
.end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
@@ -386,7 +386,7 @@ static struct resource omap2_mbox_resources[] = {
#endif
#ifdef CONFIG_ARCH_OMAP3430
-static struct resource omap3_mbox_resources[] = {
+static struct resource __initdata omap3_mbox_resources[] = {
{
.start = OMAP34XX_MAILBOX_BASE,
.end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
@@ -400,7 +400,7 @@ static struct resource omap3_mbox_resources[] = {
#endif
#ifdef CONFIG_ARCH_OMAP4
-static struct resource omap4_mbox_resources[] = {
+static struct resource __initdata omap4_mbox_resources[] = {
{
.start = OMAP44XX_MAILBOX_BASE,
.end = OMAP44XX_MAILBOX_BASE + OMAP4_MBOX_REG_SIZE - 1,
--
1.7.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 00/15] omap: mailbox: reorganize init
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
` (14 preceding siblings ...)
2010-05-13 17:47 ` [PATCH 15/15] omap: mailbox: mark some resources as __initdata Felipe Contreras
@ 2010-05-14 9:12 ` Hiroshi DOYU
2010-05-14 15:06 ` Felipe Contreras
15 siblings, 1 reply; 20+ messages in thread
From: Hiroshi DOYU @ 2010-05-14 9:12 UTC (permalink / raw)
To: linux-arm-kernel
Hi Felipe,
From: ext Felipe Contreras <felipe.contreras@gmail.com>
Subject: [PATCH 00/15] omap: mailbox: reorganize init
Date: Thu, 13 May 2010 19:47:21 +0200
> Hi,
>
> The main purpose of this patch series is to be able to compile mach platform
> data as built-in. Otherwise, client modules such as bridgedriver will load the
> platform code, but not the mach code when mailbox is built as a module.
>
> Unfortunately, there's no easy way to do that since plat and mach code are
> deepely interrelated. So the first patches try to separate the mailbox
> registering through a defined omap_mbox_platform_data.
>
> Also, it's worth noting that mailboxes are not a one-to-one mapping to
> resources; that is, some resources belong to multiple mboxes. So it's best to
> think of mailboxes as fake devices. That is why custom platform_data is required.
>
> Finally, a bunch of cleaning up is done in the very first patches, specially for
> OMAP1.
Can you rebase them against the following?
git://gitorious.org/~doyu/lk/mainline.git v2.6.34-rc7.mailbox
The above includes the unmerged patches for omap mailbox, and it seems
that yours can be applied to neither v2.6.34-rc7 or omap/master now.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 03/15] omap: mailbox: 2420 should be detected at run-time
2010-05-13 17:47 ` [PATCH 03/15] omap: mailbox: 2420 should be detected at run-time Felipe Contreras
@ 2010-05-14 10:17 ` Sergei Shtylyov
2010-05-14 10:47 ` Felipe Contreras
0 siblings, 1 reply; 20+ messages in thread
From: Sergei Shtylyov @ 2010-05-14 10:17 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
Felipe Contreras wrote:
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
> arch/arm/mach-omap2/mailbox.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
> index 252e53b..6d17da8 100644
> --- a/arch/arm/mach-omap2/mailbox.c
> +++ b/arch/arm/mach-omap2/mailbox.c
> @@ -431,7 +431,8 @@ err_dsp:
> static int __devexit omap2_mbox_remove(struct platform_device *pdev)
> {
> #if defined(CONFIG_ARCH_OMAP2420)
> - omap_mbox_unregister(&mbox_iva_info);
> + if (cpu_is_omap2420())
> + omap_mbox_unregister(&mbox_iva_info);
> #endif
Shouldn't #ifdef be remove then?
WBR, Sergei
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 03/15] omap: mailbox: 2420 should be detected at run-time
2010-05-14 10:17 ` Sergei Shtylyov
@ 2010-05-14 10:47 ` Felipe Contreras
0 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-14 10:47 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Fri, May 14, 2010 at 1:17 PM, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
> Felipe Contreras wrote:
>
>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
>> ---
>> ?arch/arm/mach-omap2/mailbox.c | ? ?3 ++-
>> ?1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
>> index 252e53b..6d17da8 100644
>> --- a/arch/arm/mach-omap2/mailbox.c
>> +++ b/arch/arm/mach-omap2/mailbox.c
>> @@ -431,7 +431,8 @@ err_dsp:
>> ?static int __devexit omap2_mbox_remove(struct platform_device *pdev)
>> ?{
>> ?#if defined(CONFIG_ARCH_OMAP2420)
>> - ? ? ? omap_mbox_unregister(&mbox_iva_info);
>> + ? ? ? if (cpu_is_omap2420())
>> + ? ? ? ? ? ? ? omap_mbox_unregister(&mbox_iva_info);
>> ?#endif
>
> ? Shouldn't #ifdef be remove then?
My first patch did that, but now mbox_iva_info is only available when
ARCH_OMAP2420=y to save space when building for a specific OMAP.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 00/15] omap: mailbox: reorganize init
2010-05-14 9:12 ` [PATCH 00/15] omap: mailbox: reorganize init Hiroshi DOYU
@ 2010-05-14 15:06 ` Felipe Contreras
0 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2010-05-14 15:06 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, May 14, 2010 at 12:12 PM, Hiroshi DOYU <Hiroshi.DOYU@nokia.com> wrote:
> Can you rebase them against the following?
>
> ?git://gitorious.org/~doyu/lk/mainline.git v2.6.34-rc7.mailbox
Done.
> The above includes the unmerged patches for omap mailbox, and it seems
> that yours can be applied to neither v2.6.34-rc7 or omap/master now.
Yeah, I didn't know where to rebase to, so I just used what I was
running: v2.6.33.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2010-05-14 15:06 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-13 17:47 [PATCH 00/15] omap: mailbox: reorganize init Felipe Contreras
2010-05-13 17:47 ` [PATCH 01/15] omap: mailbox: trivial cleanups Felipe Contreras
2010-05-13 17:47 ` [PATCH 02/15] omap: mailbox: reorganize structures Felipe Contreras
2010-05-13 17:47 ` [PATCH 03/15] omap: mailbox: 2420 should be detected at run-time Felipe Contreras
2010-05-14 10:17 ` Sergei Shtylyov
2010-05-14 10:47 ` Felipe Contreras
2010-05-13 17:47 ` [PATCH 04/15] omap: mailbox: use correct config for omap1 Felipe Contreras
2010-05-13 17:47 ` [PATCH 05/15] omap: mailbox: update omap1 probing Felipe Contreras
2010-05-13 17:47 ` [PATCH 06/15] omap: mailbox: reorganize registering Felipe Contreras
2010-05-13 17:47 ` [PATCH 07/15] omap: mailbox: only compile for configured archs Felipe Contreras
2010-05-13 17:47 ` [PATCH 08/15] omap: mailbox: reorganize omap platform_device Felipe Contreras
2010-05-13 17:47 ` [PATCH 09/15] omap: mailbox: move more stuff to omap_mbox_init() Felipe Contreras
2010-05-13 17:47 ` [PATCH 10/15] omap: mailbox: trivial sync between omap1 and 2 Felipe Contreras
2010-05-13 17:47 ` [PATCH 11/15] omap: mailbox: split platform driver Felipe Contreras
2010-05-13 17:47 ` [PATCH 12/15] omap: mailbox: always built-in platform data Felipe Contreras
2010-05-13 17:47 ` [PATCH 13/15] omap: mailbox: reorganize headers Felipe Contreras
2010-05-13 17:47 ` [PATCH 14/15] omap: mailbox: don't export unecessary symbols Felipe Contreras
2010-05-13 17:47 ` [PATCH 15/15] omap: mailbox: mark some resources as __initdata Felipe Contreras
2010-05-14 9:12 ` [PATCH 00/15] omap: mailbox: reorganize init Hiroshi DOYU
2010-05-14 15:06 ` Felipe Contreras
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox