sh: TMU platform data for SH-X3 proto CPU.
[safe/jmp/linux-2.6] / arch / sh / kernel / cpu / sh4a / setup-sh7724.c
index 65570ed..e074951 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/mm.h>
 #include <linux/serial_sci.h>
 #include <linux/uio_driver.h>
-#include <linux/sh_cmt.h>
+#include <linux/sh_timer.h>
 #include <linux/io.h>
 #include <asm/clock.h>
 #include <asm/mmzone.h>
@@ -230,7 +230,40 @@ 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 platform_device *sh7724_devices[] __initdata = {
+       &cmt_device,
        &sci_device,
        &rtc_device,
        &iic0_device,
@@ -242,7 +275,6 @@ static struct platform_device *sh7724_devices[] __initdata = {
 
 static int __init sh7724_devices_setup(void)
 {
-       clk_always_enable("rtc0");   /* RTC */
        clk_always_enable("vpu0");   /* VPU */
        clk_always_enable("veu1");   /* VEU3F1 */
        clk_always_enable("veu0");   /* VEU3F0 */
@@ -256,6 +288,16 @@ static int __init sh7724_devices_setup(void)
 }
 device_initcall(sh7724_devices_setup);
 
+static struct platform_device *sh7724_early_devices[] __initdata = {
+       &cmt_device,
+};
+
+void __init plat_early_device_setup(void)
+{
+       early_platform_add_devices(sh7724_early_devices,
+                                  ARRAY_SIZE(sh7724_early_devices));
+}
+
 enum {
        UNUSED = 0,