#include <linux/resource.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
+#include <linux/io.h>
#include <mach/mailbox.h>
#include <mach/irqs.h>
-#include <asm/io.h>
+ #define DRV_NAME "omap1-mailbox"
+
#define MAILBOX_ARM2DSP1 0x00
#define MAILBOX_ARM2DSP1b 0x04
#define MAILBOX_DSP2ARM1 0x08
.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,
},
{
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/platform_device.h>
+#include <linux/io.h>
#include <mach/mailbox.h>
#include <mach/irqs.h>
-#include <asm/io.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
-
- 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;
#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