]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap2/devices.c
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / devices.c
index 5139677e426621bf55fad5a7d19c652f471d3249..7a7f02559075fc9ce8538c5f64d26c538ef03bc3 100644 (file)
@@ -9,23 +9,22 @@
  * (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 
-#include <asm/hardware.h>
+#include <mach/hardware.h>
 #include <asm/io.h>
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
 
-#include <asm/arch/tc.h>
-#include <asm/arch/board.h>
-#include <asm/arch/mux.h>
-#include <asm/arch/gpio.h>
+#include <mach/tc.h>
+#include <mach/board.h>
+#include <mach/mux.h>
+#include <mach/gpio.h>
 
-#if    defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
+#if    defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
 
 #define OMAP2_I2C_BASE2                0x48072000
 #define OMAP2_I2C_INT2         57
@@ -43,8 +42,8 @@ static struct resource i2c_resources2[] = {
 };
 
 static struct platform_device omap_i2c_device2 = {
-        .name           = "i2c_omap",
-        .id             = 2,
+       .name           = "i2c_omap",
+       .id             = 2,
        .num_resources  = ARRAY_SIZE(i2c_resources2),
        .resource       = i2c_resources2,
 };
@@ -56,8 +55,10 @@ static void omap_init_i2c(void)
        if (machine_is_omap_h4())
                return;
 
-       omap_cfg_reg(J15_24XX_I2C2_SCL);
-       omap_cfg_reg(H19_24XX_I2C2_SDA);
+       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);
 }
 
@@ -67,6 +68,40 @@ static void omap_init_i2c(void) {}
 
 #endif
 
+#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
+#define OMAP2_MBOX_BASE                IO_ADDRESS(OMAP24XX_MAILBOX_BASE)
+
+static struct resource mbox_resources[] = {
+       {
+               .start          = OMAP2_MBOX_BASE,
+               .end            = OMAP2_MBOX_BASE + 0x11f,
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .start          = INT_24XX_MAIL_U0_MPU,
+               .flags          = IORESOURCE_IRQ,
+       },
+       {
+               .start          = INT_24XX_MAIL_U3_MPU,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device mbox_device = {
+       .name           = "mailbox",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(mbox_resources),
+       .resource       = mbox_resources,
+};
+
+static inline void omap_init_mbox(void)
+{
+       platform_device_register(&mbox_device);
+}
+#else
+static inline void omap_init_mbox(void) { }
+#endif
+
 #if defined(CONFIG_OMAP_STI)
 
 #define OMAP2_STI_BASE         IO_ADDRESS(0x48068000)
@@ -107,34 +142,50 @@ static inline void omap_init_sti(void) {}
 
 #if defined(CONFIG_SPI_OMAP24XX)
 
-#include <asm/arch/mcspi.h>
+#include <mach/mcspi.h>
 
 #define OMAP2_MCSPI1_BASE              0x48098000
 #define OMAP2_MCSPI2_BASE              0x4809a000
 
-/* FIXME: use resources instead */
-
 static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
-       .base           = io_p2v(OMAP2_MCSPI1_BASE),
        .num_cs         = 4,
 };
 
+static struct resource omap2_mcspi1_resources[] = {
+       {
+               .start          = OMAP2_MCSPI1_BASE,
+               .end            = OMAP2_MCSPI1_BASE + 0xff,
+               .flags          = IORESOURCE_MEM,
+       },
+};
+
 struct platform_device omap2_mcspi1 = {
        .name           = "omap2_mcspi",
        .id             = 1,
+       .num_resources  = ARRAY_SIZE(omap2_mcspi1_resources),
+       .resource       = omap2_mcspi1_resources,
        .dev            = {
                .platform_data = &omap2_mcspi1_config,
        },
 };
 
 static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
-       .base           = io_p2v(OMAP2_MCSPI2_BASE),
        .num_cs         = 2,
 };
 
+static struct resource omap2_mcspi2_resources[] = {
+       {
+               .start          = OMAP2_MCSPI2_BASE,
+               .end            = OMAP2_MCSPI2_BASE + 0xff,
+               .flags          = IORESOURCE_MEM,
+       },
+};
+
 struct platform_device omap2_mcspi2 = {
        .name           = "omap2_mcspi",
        .id             = 2,
+       .num_resources  = ARRAY_SIZE(omap2_mcspi2_resources),
+       .resource       = omap2_mcspi2_resources,
        .dev            = {
                .platform_data = &omap2_mcspi2_config,
        },
@@ -158,10 +209,10 @@ static int __init omap2_init_devices(void)
         * in alphabetical order so they're easier to sort through.
         */
        omap_init_i2c();
+       omap_init_mbox();
        omap_init_mcspi();
        omap_init_sti();
 
        return 0;
 }
 arch_initcall(omap2_init_devices);
-