From: Tony Lindgren Date: Mon, 22 Dec 2008 15:27:47 +0000 (+0200) Subject: Merge branch 'for-tony-mailbox' X-Git-Tag: v2.6.28-omap1~55 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?p=linux-2.6-omap-h63xx.git;a=commitdiff_plain;h=76044b05598cd9350738c3e74018a29960e3ca24 Merge branch 'for-tony-mailbox' Conflicts: arch/arm/plat-omap/Kconfig arch/arm/plat-omap/include/mach/omap34xx.h arch/arm/plat-omap/mailbox.c --- 76044b05598cd9350738c3e74018a29960e3ca24 diff --cc arch/arm/mach-omap1/mailbox.c index 59abbf331a9,47f6eb88f42..87539db7658 --- a/arch/arm/mach-omap1/mailbox.c +++ b/arch/arm/mach-omap1/mailbox.c @@@ -13,10 -13,12 +13,12 @@@ #include #include #include +#include #include #include -#include + #define DRV_NAME "omap1-mailbox" + #define MAILBOX_ARM2DSP1 0x00 #define MAILBOX_ARM2DSP1b 0x04 #define MAILBOX_DSP2ARM1 0x08 diff --cc arch/arm/mach-omap2/devices.c index 423647e14bf,7c33856a17d..937fb1840b7 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@@ -37,61 -36,46 +37,62 @@@ static struct resource cam_resources[] .flags = IORESOURCE_MEM, }, { - .start = OMAP2_I2C_INT2, + .start = INT_24XX_CAM_IRQ, .flags = IORESOURCE_IRQ, - }, + } }; -static struct platform_device omap_i2c_device2 = { - .name = "i2c_omap", - .id = 2, - .num_resources = ARRAY_SIZE(i2c_resources2), - .resource = i2c_resources2, +static struct platform_device omap_cam_device = { + .name = "omap24xxcam", + .id = -1, + .num_resources = ARRAY_SIZE(cam_resources), + .resource = cam_resources, }; -/* See also arch/arm/plat-omap/devices.c for first I2C on 24xx */ -static void omap_init_i2c(void) +static inline void omap_init_camera(void) { - /* REVISIT: Second I2C not in use on H4? */ - if (machine_is_omap_h4()) - return; - - if (!cpu_is_omap2430()) { - omap_cfg_reg(J15_24XX_I2C2_SCL); - omap_cfg_reg(H19_24XX_I2C2_SDA); - } - (void) platform_device_register(&omap_i2c_device2); + platform_device_register(&omap_cam_device); } -#else +#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) + +static struct resource cam_resources[] = { + { + .start = OMAP34XX_CAMERA_BASE, + .end = OMAP34XX_CAMERA_BASE + 0x1B70, + .flags = IORESOURCE_MEM, + }, + { + .start = INT_34XX_CAM_IRQ, + .flags = IORESOURCE_IRQ, + } +}; -static void omap_init_i2c(void) {} +static struct platform_device omap_cam_device = { + .name = "omap34xxcam", + .id = -1, + .num_resources = ARRAY_SIZE(cam_resources), + .resource = cam_resources, +}; +static inline void omap_init_camera(void) +{ + platform_device_register(&omap_cam_device); +} +#else +static inline void omap_init_camera(void) +{ +} #endif - #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) - #define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE) + #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) - static struct resource mbox_resources[] = { + #define MBOX_REG_SIZE 0x120 + + static struct resource omap2_mbox_resources[] = { { - .start = OMAP2_MBOX_BASE, - .end = OMAP2_MBOX_BASE + 0x11f, + .start = OMAP24XX_MAILBOX_BASE, + .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, .flags = IORESOURCE_MEM, }, { diff --cc arch/arm/mach-omap2/mailbox.c index 32b7af3c610,571aea7166a..544dde9d07b --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@@ -14,44 -14,27 +14,27 @@@ #include #include #include +#include #include #include -#include - #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 - - static unsigned long mbox_base; - - #define MAILBOX_IRQ_NOTFULL(n) (1 << (2 * (n) + 1)) - #define MAILBOX_IRQ_NEWMSG(n) (1 << (2 * (n))) + #define DRV_NAME "omap2-mailbox" + + #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)) + + #define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u))) + #define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1)) + + #define MBOX_REG_SIZE 0x120 + + static void __iomem *mbox_base; struct omap_mbox2_fifo { unsigned long msg; diff --cc arch/arm/plat-omap/include/mach/omap34xx.h index 0a137c12490,89173f16b9b..2f82e28eda0 --- a/arch/arm/plat-omap/include/mach/omap34xx.h +++ b/arch/arm/plat-omap/include/mach/omap34xx.h @@@ -63,7 -61,7 +63,8 @@@ #define OMAP2_CM_BASE OMAP3430_CM_BASE #define OMAP2_PRM_BASE OMAP3430_PRM_BASE #define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP34XX_IC_BASE) +#define OMAP34XX_CAMERA_BASE (L4_34XX_BASE + 0xBC000) + #define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000) #endif