aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/configs/omap1_defconfig3
-rw-r--r--arch/arm/mach-omap1/Makefile4
-rw-r--r--arch/arm/mach-omap2/Makefile3
-rw-r--r--arch/arm/mach-omap2/devices.c4
-rw-r--r--arch/arm/plat-omap/Kconfig16
-rw-r--r--arch/arm/plat-omap/Makefile3
-rw-r--r--drivers/mailbox/Kconfig34
-rw-r--r--drivers/mailbox/Makefile6
-rw-r--r--drivers/mailbox/mailbox-omap1.c (renamed from arch/arm/mach-omap1/mailbox.c)3
-rw-r--r--drivers/mailbox/mailbox-omap2.c (renamed from arch/arm/mach-omap2/mailbox.c)8
-rw-r--r--drivers/mailbox/omap-mailbox.c (renamed from arch/arm/plat-omap/mailbox.c)36
-rw-r--r--drivers/mailbox/omap-mbox.h (renamed from arch/arm/plat-omap/include/plat/mailbox.h)68
-rw-r--r--drivers/remoteproc/Kconfig3
-rw-r--r--drivers/remoteproc/omap_remoteproc.c2
-rw-r--r--drivers/staging/tidspbridge/Kconfig3
-rw-r--r--drivers/staging/tidspbridge/include/dspbridge/host_os.h2
-rw-r--r--include/linux/omap-mailbox.h29
17 files changed, 135 insertions, 92 deletions
diff --git a/arch/arm/configs/omap1_defconfig b/arch/arm/configs/omap1_defconfig
index 9940f7b4e438..d74edbad18fc 100644
--- a/arch/arm/configs/omap1_defconfig
+++ b/arch/arm/configs/omap1_defconfig
@@ -26,7 +26,8 @@ CONFIG_ARCH_OMAP=y
26CONFIG_ARCH_OMAP1=y 26CONFIG_ARCH_OMAP1=y
27CONFIG_OMAP_RESET_CLOCKS=y 27CONFIG_OMAP_RESET_CLOCKS=y
28# CONFIG_OMAP_MUX is not set 28# CONFIG_OMAP_MUX is not set
29CONFIG_OMAP_MBOX_FWK=y 29CONFIG_MAILBOX=y
30CONFIG_OMAP1_MBOX=y
30CONFIG_OMAP_32K_TIMER=y 31CONFIG_OMAP_32K_TIMER=y
31CONFIG_OMAP_DM_TIMER=y 32CONFIG_OMAP_DM_TIMER=y
32CONFIG_ARCH_OMAP730=y 33CONFIG_ARCH_OMAP730=y
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 222d58c0ae76..3889b6cd211e 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -19,10 +19,6 @@ obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
19# Power Management 19# Power Management
20obj-$(CONFIG_PM) += pm.o sleep.o 20obj-$(CONFIG_PM) += pm.o sleep.o
21 21
22# DSP
23obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
24mailbox_mach-objs := mailbox.o
25
26i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o 22i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
27obj-y += $(i2c-omap-m) $(i2c-omap-y) 23obj-y += $(i2c-omap-m) $(i2c-omap-y)
28 24
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 55a9d6777683..f2d19af051eb 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -203,9 +203,6 @@ obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o
203obj-$(CONFIG_OMAP3_EMU) += emu.o 203obj-$(CONFIG_OMAP3_EMU) += emu.o
204obj-$(CONFIG_HW_PERF_EVENTS) += pmu.o 204obj-$(CONFIG_HW_PERF_EVENTS) += pmu.o
205 205
206obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
207mailbox_mach-objs := mailbox.o
208
209iommu-$(CONFIG_OMAP_IOMMU) := omap-iommu.o 206iommu-$(CONFIG_OMAP_IOMMU) := omap-iommu.o
210obj-y += $(iommu-m) $(iommu-y) 207obj-y += $(iommu-m) $(iommu-y)
211 208
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 4c97a86115e6..73762accd128 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -328,7 +328,7 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
328 return 0; 328 return 0;
329} 329}
330 330
331#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) 331#if defined(CONFIG_OMAP2PLUS_MBOX) || defined(CONFIG_OMAP2PLUS_MBOX_MODULE)
332static inline void __init omap_init_mbox(void) 332static inline void __init omap_init_mbox(void)
333{ 333{
334 struct omap_hwmod *oh; 334 struct omap_hwmod *oh;
@@ -352,7 +352,7 @@ static inline void __init omap_init_mbox(void)
352} 352}
353#else 353#else
354static inline void omap_init_mbox(void) { } 354static inline void omap_init_mbox(void) { }
355#endif /* CONFIG_OMAP_MBOX_FWK */ 355#endif /* CONFIG_OMAP2PLUS_MBOX */
356 356
357static inline void omap_init_sti(void) {} 357static inline void omap_init_sti(void) {}
358 358
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index ce66eb9be481..f82bae2171eb 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -86,22 +86,6 @@ config OMAP_MUX_WARNINGS
86 to change the pin multiplexing setup. When there are no warnings 86 to change the pin multiplexing setup. When there are no warnings
87 printed, it's safe to deselect OMAP_MUX for your product. 87 printed, it's safe to deselect OMAP_MUX for your product.
88 88
89config OMAP_MBOX_FWK
90 tristate "Mailbox framework support"
91 depends on ARCH_OMAP && !ARCH_MULTIPLATFORM
92 help
93 Say Y here if you want to use OMAP Mailbox framework support for
94 DSP, IVA1.0 and IVA2 in OMAP1/2/3.
95
96config OMAP_MBOX_KFIFO_SIZE
97 int "Mailbox kfifo default buffer size (bytes)"
98 depends on OMAP_MBOX_FWK
99 default 256
100 help
101 Specify the default size of mailbox's kfifo buffers (bytes).
102 This can also be changed at runtime (via the mbox_kfifo_size
103 module parameter).
104
105config OMAP_IOMMU_IVA2 89config OMAP_IOMMU_IVA2
106 bool 90 bool
107 91
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index 31199417b56a..0b01b68fd033 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -17,6 +17,3 @@ obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
17i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o 17i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
18obj-y += $(i2c-omap-m) $(i2c-omap-y) 18obj-y += $(i2c-omap-m) $(i2c-omap-y)
19 19
20# OMAP mailbox framework
21obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o
22
diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
index 9545c9f03809..c8b5c13bcd05 100644
--- a/drivers/mailbox/Kconfig
+++ b/drivers/mailbox/Kconfig
@@ -16,4 +16,38 @@ config PL320_MBOX
16 Management Engine, primarily for cpufreq. Say Y here if you want 16 Management Engine, primarily for cpufreq. Say Y here if you want
17 to use the PL320 IPCM support. 17 to use the PL320 IPCM support.
18 18
19config OMAP_MBOX
20 tristate
21 help
22 This option is selected by any OMAP architecture specific mailbox
23 driver such as CONFIG_OMAP1_MBOX or CONFIG_OMAP2PLUS_MBOX. This
24 enables the common OMAP mailbox framework code.
25
26config OMAP1_MBOX
27 tristate "OMAP1 Mailbox framework support"
28 depends on ARCH_OMAP1
29 select OMAP_MBOX
30 help
31 Mailbox implementation for OMAP chips with hardware for
32 interprocessor communication involving DSP in OMAP1. Say Y here
33 if you want to use OMAP1 Mailbox framework support.
34
35config OMAP2PLUS_MBOX
36 tristate "OMAP2+ Mailbox framework support"
37 depends on ARCH_OMAP2PLUS
38 select OMAP_MBOX
39 help
40 Mailbox implementation for OMAP family chips with hardware for
41 interprocessor communication involving DSP, IVA1.0 and IVA2 in
42 OMAP2/3; or IPU, IVA HD and DSP in OMAP4/5. Say Y here if you
43 want to use OMAP2+ Mailbox framework support.
44
45config OMAP_MBOX_KFIFO_SIZE
46 int "Mailbox kfifo default buffer size (bytes)"
47 depends on OMAP2PLUS_MBOX || OMAP1_MBOX
48 default 256
49 help
50 Specify the default size of mailbox's kfifo buffers (bytes).
51 This can also be changed at runtime (via the mbox_kfifo_size
52 module parameter).
19endif 53endif
diff --git a/drivers/mailbox/Makefile b/drivers/mailbox/Makefile
index 543ad6a79505..e0facb34084a 100644
--- a/drivers/mailbox/Makefile
+++ b/drivers/mailbox/Makefile
@@ -1 +1,7 @@
1obj-$(CONFIG_PL320_MBOX) += pl320-ipc.o 1obj-$(CONFIG_PL320_MBOX) += pl320-ipc.o
2
3obj-$(CONFIG_OMAP_MBOX) += omap-mailbox.o
4obj-$(CONFIG_OMAP1_MBOX) += mailbox_omap1.o
5mailbox_omap1-objs := mailbox-omap1.o
6obj-$(CONFIG_OMAP2PLUS_MBOX) += mailbox_omap2.o
7mailbox_omap2-objs := mailbox-omap2.o
diff --git a/arch/arm/mach-omap1/mailbox.c b/drivers/mailbox/mailbox-omap1.c
index 7246a5258292..9001b7633f10 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/drivers/mailbox/mailbox-omap1.c
@@ -13,7 +13,8 @@
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <plat/mailbox.h> 16
17#include "omap-mbox.h"
17 18
18#define MAILBOX_ARM2DSP1 0x00 19#define MAILBOX_ARM2DSP1 0x00
19#define MAILBOX_ARM2DSP1b 0x04 20#define MAILBOX_ARM2DSP1b 0x04
diff --git a/arch/arm/mach-omap2/mailbox.c b/drivers/mailbox/mailbox-omap2.c
index de21198d54ff..eba380d7b17f 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/drivers/mailbox/mailbox-omap2.c
@@ -19,7 +19,7 @@
19#include <linux/pm_runtime.h> 19#include <linux/pm_runtime.h>
20#include <linux/platform_data/mailbox-omap.h> 20#include <linux/platform_data/mailbox-omap.h>
21 21
22#include <plat/mailbox.h> 22#include "omap-mbox.h"
23 23
24#define MAILBOX_REVISION 0x000 24#define MAILBOX_REVISION 0x000
25#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) 25#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m))
@@ -331,9 +331,9 @@ static int omap2_mbox_remove(struct platform_device *pdev)
331} 331}
332 332
333static struct platform_driver omap2_mbox_driver = { 333static struct platform_driver omap2_mbox_driver = {
334 .probe = omap2_mbox_probe, 334 .probe = omap2_mbox_probe,
335 .remove = omap2_mbox_remove, 335 .remove = omap2_mbox_remove,
336 .driver = { 336 .driver = {
337 .name = "omap-mailbox", 337 .name = "omap-mailbox",
338 }, 338 },
339}; 339};
diff --git a/arch/arm/plat-omap/mailbox.c b/drivers/mailbox/omap-mailbox.c
index f65eaf00fce6..d79a646b9042 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/drivers/mailbox/omap-mailbox.c
@@ -31,7 +31,7 @@
31#include <linux/notifier.h> 31#include <linux/notifier.h>
32#include <linux/module.h> 32#include <linux/module.h>
33 33
34#include <plat/mailbox.h> 34#include "omap-mbox.h"
35 35
36static struct omap_mbox **mboxes; 36static struct omap_mbox **mboxes;
37 37
@@ -116,6 +116,40 @@ out:
116} 116}
117EXPORT_SYMBOL(omap_mbox_msg_send); 117EXPORT_SYMBOL(omap_mbox_msg_send);
118 118
119void omap_mbox_save_ctx(struct omap_mbox *mbox)
120{
121 if (!mbox->ops->save_ctx) {
122 dev_err(mbox->dev, "%s:\tno save\n", __func__);
123 return;
124 }
125
126 mbox->ops->save_ctx(mbox);
127}
128EXPORT_SYMBOL(omap_mbox_save_ctx);
129
130void omap_mbox_restore_ctx(struct omap_mbox *mbox)
131{
132 if (!mbox->ops->restore_ctx) {
133 dev_err(mbox->dev, "%s:\tno restore\n", __func__);
134 return;
135 }
136
137 mbox->ops->restore_ctx(mbox);
138}
139EXPORT_SYMBOL(omap_mbox_restore_ctx);
140
141void omap_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
142{
143 mbox->ops->enable_irq(mbox, irq);
144}
145EXPORT_SYMBOL(omap_mbox_enable_irq);
146
147void omap_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
148{
149 mbox->ops->disable_irq(mbox, irq);
150}
151EXPORT_SYMBOL(omap_mbox_disable_irq);
152
119static void mbox_tx_tasklet(unsigned long tx_data) 153static void mbox_tx_tasklet(unsigned long tx_data)
120{ 154{
121 struct omap_mbox *mbox = (struct omap_mbox *)tx_data; 155 struct omap_mbox *mbox = (struct omap_mbox *)tx_data;
diff --git a/arch/arm/plat-omap/include/plat/mailbox.h b/drivers/mailbox/omap-mbox.h
index e98f7e234686..6cd38fc68599 100644
--- a/arch/arm/plat-omap/include/plat/mailbox.h
+++ b/drivers/mailbox/omap-mbox.h
@@ -1,20 +1,20 @@
1/* mailbox.h */ 1/*
2 * omap-mbox.h: OMAP mailbox internal definitions
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
2 8
3#ifndef MAILBOX_H 9#ifndef OMAP_MBOX_H
4#define MAILBOX_H 10#define OMAP_MBOX_H
5 11
6#include <linux/spinlock.h>
7#include <linux/workqueue.h>
8#include <linux/interrupt.h>
9#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/interrupt.h>
10#include <linux/kfifo.h> 14#include <linux/kfifo.h>
11 15#include <linux/spinlock.h>
12typedef u32 mbox_msg_t; 16#include <linux/workqueue.h>
13struct omap_mbox; 17#include <linux/omap-mailbox.h>
14
15typedef int __bitwise omap_mbox_irq_t;
16#define IRQ_TX ((__force omap_mbox_irq_t) 1)
17#define IRQ_RX ((__force omap_mbox_irq_t) 2)
18 18
19typedef int __bitwise omap_mbox_type_t; 19typedef int __bitwise omap_mbox_type_t;
20#define OMAP_MBOX_TYPE1 ((__force omap_mbox_type_t) 1) 20#define OMAP_MBOX_TYPE1 ((__force omap_mbox_type_t) 1)
@@ -58,48 +58,10 @@ struct omap_mbox {
58 struct device *dev; 58 struct device *dev;
59 void *priv; 59 void *priv;
60 int use_count; 60 int use_count;
61 struct blocking_notifier_head notifier; 61 struct blocking_notifier_head notifier;
62}; 62};
63 63
64int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg);
65void omap_mbox_init_seq(struct omap_mbox *);
66
67struct omap_mbox *omap_mbox_get(const char *, struct notifier_block *nb);
68void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb);
69
70int omap_mbox_register(struct device *parent, struct omap_mbox **); 64int omap_mbox_register(struct device *parent, struct omap_mbox **);
71int omap_mbox_unregister(void); 65int omap_mbox_unregister(void);
72 66
73static inline void omap_mbox_save_ctx(struct omap_mbox *mbox) 67#endif /* OMAP_MBOX_H */
74{
75 if (!mbox->ops->save_ctx) {
76 dev_err(mbox->dev, "%s:\tno save\n", __func__);
77 return;
78 }
79
80 mbox->ops->save_ctx(mbox);
81}
82
83static inline void omap_mbox_restore_ctx(struct omap_mbox *mbox)
84{
85 if (!mbox->ops->restore_ctx) {
86 dev_err(mbox->dev, "%s:\tno restore\n", __func__);
87 return;
88 }
89
90 mbox->ops->restore_ctx(mbox);
91}
92
93static inline void omap_mbox_enable_irq(struct omap_mbox *mbox,
94 omap_mbox_irq_t irq)
95{
96 mbox->ops->enable_irq(mbox, irq);
97}
98
99static inline void omap_mbox_disable_irq(struct omap_mbox *mbox,
100 omap_mbox_irq_t irq)
101{
102 mbox->ops->disable_irq(mbox, irq);
103}
104
105#endif /* MAILBOX_H */
diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
index d4d377c40ec9..ce1743d0b679 100644
--- a/drivers/remoteproc/Kconfig
+++ b/drivers/remoteproc/Kconfig
@@ -14,8 +14,9 @@ config OMAP_REMOTEPROC
14 depends on HAS_DMA 14 depends on HAS_DMA
15 depends on ARCH_OMAP4 || SOC_OMAP5 15 depends on ARCH_OMAP4 || SOC_OMAP5
16 depends on OMAP_IOMMU 16 depends on OMAP_IOMMU
17 depends on OMAP_MBOX_FWK
18 select REMOTEPROC 17 select REMOTEPROC
18 select MAILBOX
19 select OMAP2PLUS_MBOX
19 select RPMSG 20 select RPMSG
20 help 21 help
21 Say y here to support OMAP's remote processors (dual M3 22 Say y here to support OMAP's remote processors (dual M3
diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c
index 0e396c155b3b..51689721ea7a 100644
--- a/drivers/remoteproc/omap_remoteproc.c
+++ b/drivers/remoteproc/omap_remoteproc.c
@@ -27,8 +27,8 @@
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/dma-mapping.h> 28#include <linux/dma-mapping.h>
29#include <linux/remoteproc.h> 29#include <linux/remoteproc.h>
30#include <linux/omap-mailbox.h>
30 31
31#include <plat/mailbox.h>
32#include <linux/platform_data/remoteproc-omap.h> 32#include <linux/platform_data/remoteproc-omap.h>
33 33
34#include "omap_remoteproc.h" 34#include "omap_remoteproc.h"
diff --git a/drivers/staging/tidspbridge/Kconfig b/drivers/staging/tidspbridge/Kconfig
index 60848f198b48..165b918b8171 100644
--- a/drivers/staging/tidspbridge/Kconfig
+++ b/drivers/staging/tidspbridge/Kconfig
@@ -5,7 +5,8 @@
5menuconfig TIDSPBRIDGE 5menuconfig TIDSPBRIDGE
6 tristate "DSP Bridge driver" 6 tristate "DSP Bridge driver"
7 depends on ARCH_OMAP3 && !ARCH_MULTIPLATFORM 7 depends on ARCH_OMAP3 && !ARCH_MULTIPLATFORM
8 select OMAP_MBOX_FWK 8 select MAILBOX
9 select OMAP2PLUS_MBOX
9 help 10 help
10 DSP/BIOS Bridge is designed for platforms that contain a GPP and 11 DSP/BIOS Bridge is designed for platforms that contain a GPP and
11 one or more attached DSPs. The GPP is considered the master or 12 one or more attached DSPs. The GPP is considered the master or
diff --git a/drivers/staging/tidspbridge/include/dspbridge/host_os.h b/drivers/staging/tidspbridge/include/dspbridge/host_os.h
index 7f3a1db31619..d1441db469fc 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/host_os.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/host_os.h
@@ -41,7 +41,7 @@
41#include <linux/ioport.h> 41#include <linux/ioport.h>
42#include <linux/platform_device.h> 42#include <linux/platform_device.h>
43#include <linux/clk.h> 43#include <linux/clk.h>
44#include <plat/mailbox.h> 44#include <linux/omap-mailbox.h>
45#include <linux/pagemap.h> 45#include <linux/pagemap.h>
46#include <asm/cacheflush.h> 46#include <asm/cacheflush.h>
47#include <linux/dma-mapping.h> 47#include <linux/dma-mapping.h>
diff --git a/include/linux/omap-mailbox.h b/include/linux/omap-mailbox.h
new file mode 100644
index 000000000000..f8322d9cd235
--- /dev/null
+++ b/include/linux/omap-mailbox.h
@@ -0,0 +1,29 @@
1/*
2 * omap-mailbox: interprocessor communication module for OMAP
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef OMAP_MAILBOX_H
10#define OMAP_MAILBOX_H
11
12typedef u32 mbox_msg_t;
13struct omap_mbox;
14
15typedef int __bitwise omap_mbox_irq_t;
16#define IRQ_TX ((__force omap_mbox_irq_t) 1)
17#define IRQ_RX ((__force omap_mbox_irq_t) 2)
18
19int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg);
20
21struct omap_mbox *omap_mbox_get(const char *, struct notifier_block *nb);
22void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb);
23
24void omap_mbox_save_ctx(struct omap_mbox *mbox);
25void omap_mbox_restore_ctx(struct omap_mbox *mbox);
26void omap_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq);
27void omap_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq);
28
29#endif /* OMAP_MAILBOX_H */