davinci: DA8XX/OMAP-L1XX: add support for cpuidle driver register
authorSekhar Nori <nsekhar@ti.com>
Thu, 22 Oct 2009 09:42:14 +0000 (15:12 +0530)
committerKevin Hilman <khilman@deeprootsystems.com>
Wed, 25 Nov 2009 18:21:37 +0000 (10:21 -0800)
This patch provides a function to help register cpuidle driver
on da8xx/omap-l1xx platforms.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/mach-davinci/devices-da8xx.c
arch/arm/mach-davinci/include/mach/da8xx.h

index fda83f82a5fe1643e40e9afbcaa89b0a4605a185..dd2d32c4ce8679fdf5995b8210b294d87b96f10a 100644 (file)
@@ -19,6 +19,7 @@
 #include <mach/common.h>
 #include <mach/time.h>
 #include <mach/da8xx.h>
+#include <mach/cpuidle.h>
 
 #include "clock.h"
 
@@ -486,3 +487,32 @@ int da8xx_register_rtc(void)
 
        return platform_device_register(&da8xx_rtc_device);
 }
+
+static struct resource da8xx_cpuidle_resources[] = {
+       {
+               .start          = DA8XX_DDR2_CTL_BASE,
+               .end            = DA8XX_DDR2_CTL_BASE + SZ_32K - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+};
+
+/* DA8XX devices support DDR2 power down */
+static struct davinci_cpuidle_config da8xx_cpuidle_pdata = {
+       .ddr2_pdown     = 1,
+};
+
+
+static struct platform_device da8xx_cpuidle_device = {
+       .name                   = "cpuidle-davinci",
+       .num_resources          = ARRAY_SIZE(da8xx_cpuidle_resources),
+       .resource               = da8xx_cpuidle_resources,
+       .dev = {
+               .platform_data  = &da8xx_cpuidle_pdata,
+       },
+};
+
+int __init da8xx_register_cpuidle(void)
+{
+       return platform_device_register(&da8xx_cpuidle_device);
+}
+
index 174c75817d3224e34a147530fce0312d544f3c80..90704910d343825e36a624dccd9991f0e7106029 100644 (file)
@@ -52,6 +52,7 @@ extern void __iomem *da8xx_syscfg_base;
 #define DA8XX_AEMIF_CS2_BASE   0x60000000
 #define DA8XX_AEMIF_CS3_BASE   0x62000000
 #define DA8XX_AEMIF_CTL_BASE   0x68000000
+#define DA8XX_DDR2_CTL_BASE    0xb0000000
 
 #define PINMUX0                        0x00
 #define PINMUX1                        0x04
@@ -88,6 +89,7 @@ int da8xx_register_mmcsd0(struct davinci_mmc_config *config);
 void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata);
 int da8xx_register_rtc(void);
 int da850_register_cpufreq(void);
+int da8xx_register_cpuidle(void);
 
 extern struct platform_device da8xx_serial_device;
 extern struct emac_platform_data da8xx_emac_pdata;