sh: TMU platform data for SH-X3 proto CPU.
[safe/jmp/linux-2.6] / arch / sh / kernel / cpu / sh4a / setup-sh7366.c
index e17db39..7361ea9 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/serial.h>
 #include <linux/serial_sci.h>
 #include <linux/uio_driver.h>
+#include <linux/sh_timer.h>
 #include <asm/clock.h>
 
 static struct resource iic_resources[] = {
@@ -32,6 +33,7 @@ static struct resource iic_resources[] = {
 
 static struct platform_device iic_device = {
        .name           = "i2c-sh_mobile",
+       .id             = 0, /* "i2c0" clock */
        .num_resources  = ARRAY_SIZE(iic_resources),
        .resource       = iic_resources,
 };
@@ -146,6 +148,38 @@ static struct platform_device veu1_device = {
        .num_resources  = ARRAY_SIZE(veu1_resources),
 };
 
+static struct sh_timer_config cmt_platform_data = {
+       .name = "CMT",
+       .channel_offset = 0x60,
+       .timer_bit = 5,
+       .clk = "cmt0",
+       .clockevent_rating = 125,
+       .clocksource_rating = 200,
+};
+
+static struct resource cmt_resources[] = {
+       [0] = {
+               .name   = "CMT",
+               .start  = 0x044a0060,
+               .end    = 0x044a006b,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 104,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cmt_device = {
+       .name           = "sh_cmt",
+       .id             = 0,
+       .dev = {
+               .platform_data  = &cmt_platform_data,
+       },
+       .resource       = cmt_resources,
+       .num_resources  = ARRAY_SIZE(cmt_resources),
+};
+
 static struct plat_sci_port sci_platform_data[] = {
        {
                .mapbase        = 0xffe00000,
@@ -166,6 +200,7 @@ static struct platform_device sci_device = {
 };
 
 static struct platform_device *sh7366_devices[] __initdata = {
+       &cmt_device,
        &iic_device,
        &sci_device,
        &usb_host_device,
@@ -176,19 +211,11 @@ static struct platform_device *sh7366_devices[] __initdata = {
 
 static int __init sh7366_devices_setup(void)
 {
-       clk_always_enable("mstp031"); /* TLB */
-       clk_always_enable("mstp030"); /* IC */
-       clk_always_enable("mstp029"); /* OC */
-       clk_always_enable("mstp028"); /* RSMEM */
-       clk_always_enable("mstp026"); /* XYMEM */
-       clk_always_enable("mstp023"); /* INTC3 */
-       clk_always_enable("mstp022"); /* INTC */
-       clk_always_enable("mstp020"); /* SuperHyway */
-       clk_always_enable("mstp109"); /* I2C */
-       clk_always_enable("mstp211"); /* USB */
-       clk_always_enable("mstp207"); /* VEU-2 */
-       clk_always_enable("mstp202"); /* VEU-1 */
-       clk_always_enable("mstp201"); /* VPU */
+       clk_always_enable("rsmem0"); /* RSMEM */
+       clk_always_enable("xymem0"); /* XYMEM */
+       clk_always_enable("veu1"); /* VEU-2 */
+       clk_always_enable("veu0"); /* VEU-1 */
+       clk_always_enable("vpu0"); /* VPU */
 
        platform_resource_setup_memory(&vpu_device, "vpu", 2 << 20);
        platform_resource_setup_memory(&veu0_device, "veu0", 2 << 20);
@@ -199,6 +226,16 @@ static int __init sh7366_devices_setup(void)
 }
 __initcall(sh7366_devices_setup);
 
+static struct platform_device *sh7366_early_devices[] __initdata = {
+       &cmt_device,
+};
+
+void __init plat_early_device_setup(void)
+{
+       early_platform_add_devices(sh7366_early_devices,
+                                  ARRAY_SIZE(sh7366_early_devices));
+}
+
 enum {
        UNUSED=0,