aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/mailbox.c
diff options
context:
space:
mode:
authorHiroshi DOYU <Hiroshi.DOYU@nokia.com>2009-03-23 21:07:23 -0400
committerTony Lindgren <tony@atomide.com>2009-03-23 21:07:23 -0400
commit733ecc5c06bb2892f04ab1881721d665644cd261 (patch)
tree7f43e332caa6a3578f50a0a6e395e242b954e108 /arch/arm/mach-omap2/mailbox.c
parent8e0ee43bc2c3e19db56a4adaa9a9b04ce885cd84 (diff)
omap mailbox: cleanup omap2 register definition with macro
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Diffstat (limited to 'arch/arm/mach-omap2/mailbox.c')
-rw-r--r--arch/arm/mach-omap2/mailbox.c77
1 files changed, 29 insertions, 48 deletions
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 32b7af3c610b..4487a4de52f3 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * Mailbox reservation modules for OMAP2 2 * Mailbox reservation modules for OMAP2/3
3 * 3 *
4 * Copyright (C) 2006 Nokia Corporation 4 * Copyright (C) 2006-2009 Nokia Corporation
5 * Written by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com> 5 * Written by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
6 * and Paul Mundt <paul.mundt@nokia.com> 6 * and Paul Mundt
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
@@ -18,40 +18,19 @@
18#include <mach/mailbox.h> 18#include <mach/mailbox.h>
19#include <mach/irqs.h> 19#include <mach/irqs.h>
20 20
21#define MAILBOX_REVISION 0x00 21#define MAILBOX_REVISION 0x000
22#define MAILBOX_SYSCONFIG 0x10 22#define MAILBOX_SYSCONFIG 0x010
23#define MAILBOX_SYSSTATUS 0x14 23#define MAILBOX_SYSSTATUS 0x014
24#define MAILBOX_MESSAGE_0 0x40 24#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m))
25#define MAILBOX_MESSAGE_1 0x44 25#define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m))
26#define MAILBOX_MESSAGE_2 0x48 26#define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m))
27#define MAILBOX_MESSAGE_3 0x4c 27#define MAILBOX_IRQSTATUS(u) (0x100 + 8 * (u))
28#define MAILBOX_MESSAGE_4 0x50 28#define MAILBOX_IRQENABLE(u) (0x104 + 8 * (u))
29#define MAILBOX_MESSAGE_5 0x54
30#define MAILBOX_FIFOSTATUS_0 0x80
31#define MAILBOX_FIFOSTATUS_1 0x84
32#define MAILBOX_FIFOSTATUS_2 0x88
33#define MAILBOX_FIFOSTATUS_3 0x8c
34#define MAILBOX_FIFOSTATUS_4 0x90
35#define MAILBOX_FIFOSTATUS_5 0x94
36#define MAILBOX_MSGSTATUS_0 0xc0
37#define MAILBOX_MSGSTATUS_1 0xc4
38#define MAILBOX_MSGSTATUS_2 0xc8
39#define MAILBOX_MSGSTATUS_3 0xcc
40#define MAILBOX_MSGSTATUS_4 0xd0
41#define MAILBOX_MSGSTATUS_5 0xd4
42#define MAILBOX_IRQSTATUS_0 0x100
43#define MAILBOX_IRQENABLE_0 0x104
44#define MAILBOX_IRQSTATUS_1 0x108
45#define MAILBOX_IRQENABLE_1 0x10c
46#define MAILBOX_IRQSTATUS_2 0x110
47#define MAILBOX_IRQENABLE_2 0x114
48#define MAILBOX_IRQSTATUS_3 0x118
49#define MAILBOX_IRQENABLE_3 0x11c
50 29
51static unsigned long mbox_base; 30#define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u)))
31#define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1))
52 32
53#define MAILBOX_IRQ_NOTFULL(n) (1 << (2 * (n) + 1)) 33static unsigned long mbox_base;
54#define MAILBOX_IRQ_NEWMSG(n) (1 << (2 * (n)))
55 34
56struct omap_mbox2_fifo { 35struct omap_mbox2_fifo {
57 unsigned long msg; 36 unsigned long msg;
@@ -209,15 +188,15 @@ static struct omap_mbox_ops omap2_mbox_ops = {
209/* DSP */ 188/* DSP */
210static struct omap_mbox2_priv omap2_mbox_dsp_priv = { 189static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
211 .tx_fifo = { 190 .tx_fifo = {
212 .msg = MAILBOX_MESSAGE_0, 191 .msg = MAILBOX_MESSAGE(0),
213 .fifo_stat = MAILBOX_FIFOSTATUS_0, 192 .fifo_stat = MAILBOX_FIFOSTATUS(0),
214 }, 193 },
215 .rx_fifo = { 194 .rx_fifo = {
216 .msg = MAILBOX_MESSAGE_1, 195 .msg = MAILBOX_MESSAGE(1),
217 .msg_stat = MAILBOX_MSGSTATUS_1, 196 .msg_stat = MAILBOX_MSGSTATUS(1),
218 }, 197 },
219 .irqenable = MAILBOX_IRQENABLE_0, 198 .irqenable = MAILBOX_IRQENABLE(0),
220 .irqstatus = MAILBOX_IRQSTATUS_0, 199 .irqstatus = MAILBOX_IRQSTATUS(0),
221 .notfull_bit = MAILBOX_IRQ_NOTFULL(0), 200 .notfull_bit = MAILBOX_IRQ_NOTFULL(0),
222 .newmsg_bit = MAILBOX_IRQ_NEWMSG(1), 201 .newmsg_bit = MAILBOX_IRQ_NEWMSG(1),
223}; 202};
@@ -232,15 +211,15 @@ EXPORT_SYMBOL(mbox_dsp_info);
232/* IVA */ 211/* IVA */
233static struct omap_mbox2_priv omap2_mbox_iva_priv = { 212static struct omap_mbox2_priv omap2_mbox_iva_priv = {
234 .tx_fifo = { 213 .tx_fifo = {
235 .msg = MAILBOX_MESSAGE_2, 214 .msg = MAILBOX_MESSAGE(2),
236 .fifo_stat = MAILBOX_FIFOSTATUS_2, 215 .fifo_stat = MAILBOX_FIFOSTATUS(2),
237 }, 216 },
238 .rx_fifo = { 217 .rx_fifo = {
239 .msg = MAILBOX_MESSAGE_3, 218 .msg = MAILBOX_MESSAGE(3),
240 .msg_stat = MAILBOX_MSGSTATUS_3, 219 .msg_stat = MAILBOX_MSGSTATUS(3),
241 }, 220 },
242 .irqenable = MAILBOX_IRQENABLE_3, 221 .irqenable = MAILBOX_IRQENABLE(3),
243 .irqstatus = MAILBOX_IRQSTATUS_3, 222 .irqstatus = MAILBOX_IRQSTATUS(3),
244 .notfull_bit = MAILBOX_IRQ_NOTFULL(2), 223 .notfull_bit = MAILBOX_IRQ_NOTFULL(2),
245 .newmsg_bit = MAILBOX_IRQ_NEWMSG(3), 224 .newmsg_bit = MAILBOX_IRQ_NEWMSG(3),
246}; 225};
@@ -320,4 +299,6 @@ static void __exit omap2_mbox_exit(void)
320module_init(omap2_mbox_init); 299module_init(omap2_mbox_init);
321module_exit(omap2_mbox_exit); 300module_exit(omap2_mbox_exit);
322 301
323MODULE_LICENSE("GPL"); 302MODULE_LICENSE("GPL v2");
303MODULE_DESCRIPTION("omap mailbox: omap2/3 architecture specific functions");
304MODULE_AUTHOR("Hiroshi DOYU <Hiroshi.DOYU@nokia.com>, Paul Mundt");