Re: [PATCH 01/10] omap mailbox: cleanup omap2 register definition with macro

From: roel kluin
Date: Fri Jan 16 2009 - 04:56:38 EST


2009/1/16 Hiroshi DOYU <Hiroshi.DOYU@xxxxxxxxx>:
> Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@xxxxxxxxx>
> ---
>
> arch/arm/mach-omap2/mailbox.c | 77 +++++++++++++++--------------------------
> 1 files changed, 29 insertions(+), 48 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
> index 32b7af3..0609e2d 100644
> --- a/arch/arm/mach-omap2/mailbox.c
> +++ b/arch/arm/mach-omap2/mailbox.c

> @@ -18,40 +18,19 @@
> #include <mach/mailbox.h>
> #include <mach/irqs.h>
>
> -#define MAILBOX_REVISION 0x00
> -#define MAILBOX_SYSCONFIG 0x10
> -#define MAILBOX_SYSSTATUS 0x14
> -#define MAILBOX_MESSAGE_0 0x40
> -#define MAILBOX_MESSAGE_1 0x44
> -#define MAILBOX_MESSAGE_2 0x48
> -#define MAILBOX_MESSAGE_3 0x4c
> -#define MAILBOX_MESSAGE_4 0x50
> -#define MAILBOX_MESSAGE_5 0x54
> -#define MAILBOX_FIFOSTATUS_0 0x80
> -#define MAILBOX_FIFOSTATUS_1 0x84
> -#define MAILBOX_FIFOSTATUS_2 0x88
> -#define MAILBOX_FIFOSTATUS_3 0x8c
> -#define MAILBOX_FIFOSTATUS_4 0x90
> -#define MAILBOX_FIFOSTATUS_5 0x94
> -#define MAILBOX_MSGSTATUS_0 0xc0
> -#define MAILBOX_MSGSTATUS_1 0xc4
> -#define MAILBOX_MSGSTATUS_2 0xc8
> -#define MAILBOX_MSGSTATUS_3 0xcc
> -#define MAILBOX_MSGSTATUS_4 0xd0
> -#define MAILBOX_MSGSTATUS_5 0xd4
> -#define MAILBOX_IRQSTATUS_0 0x100
> -#define MAILBOX_IRQENABLE_0 0x104
> -#define MAILBOX_IRQSTATUS_1 0x108
> -#define MAILBOX_IRQENABLE_1 0x10c
> -#define MAILBOX_IRQSTATUS_2 0x110
> -#define MAILBOX_IRQENABLE_2 0x114
> -#define MAILBOX_IRQSTATUS_3 0x118
> -#define MAILBOX_IRQENABLE_3 0x11c
> +#define MAILBOX_REVISION 0x000
> +#define MAILBOX_SYSCONFIG 0x010
> +#define MAILBOX_SYSSTATUS 0x014
> +#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m))
> +#define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m))
> +#define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m))
> +#define MAILBOX_IRQSTATUS(u) (0x100 + 8 * (u))
> +#define MAILBOX_IRQENABLE(u) (0x108 + 8 * (u))
^^^^^^^
shouldn't this be
#define MAILBOX_IRQENABLE(u) (0x104 + 8 * (u))

>
> -static unsigned long mbox_base;
> +#define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u)))
> +#define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1))
>
> -#define MAILBOX_IRQ_NOTFULL(n) (1 << (2 * (n) + 1))
> -#define MAILBOX_IRQ_NEWMSG(n) (1 << (2 * (n)))
> +static unsigned long mbox_base;
>
> struct omap_mbox2_fifo {
> unsigned long msg;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/