aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSekhar Nori <nsekhar@ti.com>2009-12-17 07:59:32 -0500
committerKevin Hilman <khilman@deeprootsystems.com>2010-02-04 16:29:56 -0500
commit044ca01521d077a35b46a445b02b93f413109a4b (patch)
tree0db27839f84fd697c7cb4256a700c9b4748106da
parentefc1bb8a6fd56f6df5b797dff5156c935175c319 (diff)
davinci: da850/omap-l138: add support for SoC suspend
This patch adds support for registering for suspend-to-RAM functionality on da850/omap-l138 SoCs. da850 supports wakeup based on external event and RTC alarm. Currently only RTC alarm based wakeup is supported. Support for wakeup based on external event will be added as later improvements. For scheduling an alarm event on RTC some useful code is present in Documentation/rtc.txt Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
-rw-r--r--arch/arm/mach-davinci/da850.c39
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h4
-rw-r--r--arch/arm/mach-davinci/include/mach/mux.h1
3 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 1ac8f6318c1b..b9a7b3bc36b2 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -26,6 +26,7 @@
26#include <mach/time.h> 26#include <mach/time.h>
27#include <mach/da8xx.h> 27#include <mach/da8xx.h>
28#include <mach/cpufreq.h> 28#include <mach/cpufreq.h>
29#include <mach/pm.h>
29 30
30#include "clock.h" 31#include "clock.h"
31#include "mux.h" 32#include "mux.h"
@@ -536,6 +537,7 @@ static const struct mux_config da850_pins[] = {
536 MUX_CFG(DA850, GPIO2_15, 5, 0, 15, 8, false) 537 MUX_CFG(DA850, GPIO2_15, 5, 0, 15, 8, false)
537 MUX_CFG(DA850, GPIO4_0, 10, 28, 15, 8, false) 538 MUX_CFG(DA850, GPIO4_0, 10, 28, 15, 8, false)
538 MUX_CFG(DA850, GPIO4_1, 10, 24, 15, 8, false) 539 MUX_CFG(DA850, GPIO4_1, 10, 24, 15, 8, false)
540 MUX_CFG(DA850, RTC_ALARM, 0, 28, 15, 2, false)
539#endif 541#endif
540}; 542};
541 543
@@ -1029,6 +1031,43 @@ static int da850_round_armrate(struct clk *clk, unsigned long rate)
1029} 1031}
1030#endif 1032#endif
1031 1033
1034int da850_register_pm(struct platform_device *pdev)
1035{
1036 int ret;
1037 struct davinci_pm_config *pdata = pdev->dev.platform_data;
1038
1039 ret = davinci_cfg_reg(DA850_RTC_ALARM);
1040 if (ret)
1041 return ret;
1042
1043 pdata->ddr2_ctlr_base = da8xx_get_mem_ctlr();
1044 pdata->deepsleep_reg = DA8XX_SYSCFG1_VIRT(DA8XX_DEEPSLEEP_REG);
1045 pdata->ddrpsc_num = DA8XX_LPSC1_EMIF3C;
1046
1047 pdata->cpupll_reg_base = ioremap(DA8XX_PLL0_BASE, SZ_4K);
1048 if (!pdata->cpupll_reg_base)
1049 return -ENOMEM;
1050
1051 pdata->ddrpll_reg_base = ioremap(DA8XX_PLL1_BASE, SZ_4K);
1052 if (!pdata->ddrpll_reg_base) {
1053 ret = -ENOMEM;
1054 goto no_ddrpll_mem;
1055 }
1056
1057 pdata->ddrpsc_reg_base = ioremap(DA8XX_PSC1_BASE, SZ_4K);
1058 if (!pdata->ddrpsc_reg_base) {
1059 ret = -ENOMEM;
1060 goto no_ddrpsc_mem;
1061 }
1062
1063 return platform_device_register(pdev);
1064
1065no_ddrpsc_mem:
1066 iounmap(pdata->ddrpll_reg_base);
1067no_ddrpll_mem:
1068 iounmap(pdata->cpupll_reg_base);
1069 return ret;
1070}
1032 1071
1033static struct davinci_soc_info davinci_soc_info_da850 = { 1072static struct davinci_soc_info davinci_soc_info_da850 = {
1034 .io_desc = da850_io_desc, 1073 .io_desc = da850_io_desc,
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index d9a7f11894c4..cc9be7fee627 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -20,6 +20,7 @@
20#include <mach/asp.h> 20#include <mach/asp.h>
21#include <mach/mmc.h> 21#include <mach/mmc.h>
22#include <mach/usb.h> 22#include <mach/usb.h>
23#include <mach/pm.h>
23 24
24extern void __iomem *da8xx_syscfg0_base; 25extern void __iomem *da8xx_syscfg0_base;
25extern void __iomem *da8xx_syscfg1_base; 26extern void __iomem *da8xx_syscfg1_base;
@@ -44,6 +45,7 @@ extern void __iomem *da8xx_syscfg1_base;
44 45
45#define DA8XX_SYSCFG1_BASE (IO_PHYS + 0x22C000) 46#define DA8XX_SYSCFG1_BASE (IO_PHYS + 0x22C000)
46#define DA8XX_SYSCFG1_VIRT(x) (da8xx_syscfg1_base + (x)) 47#define DA8XX_SYSCFG1_VIRT(x) (da8xx_syscfg1_base + (x))
48#define DA8XX_DEEPSLEEP_REG 0x8
47 49
48#define DA8XX_PSC0_BASE 0x01c10000 50#define DA8XX_PSC0_BASE 0x01c10000
49#define DA8XX_PLL0_BASE 0x01c11000 51#define DA8XX_PLL0_BASE 0x01c11000
@@ -52,6 +54,7 @@ extern void __iomem *da8xx_syscfg1_base;
52#define DA8XX_GPIO_BASE 0x01e26000 54#define DA8XX_GPIO_BASE 0x01e26000
53#define DA8XX_PSC1_BASE 0x01e27000 55#define DA8XX_PSC1_BASE 0x01e27000
54#define DA8XX_LCD_CNTRL_BASE 0x01e13000 56#define DA8XX_LCD_CNTRL_BASE 0x01e13000
57#define DA8XX_PLL1_BASE 0x01e1a000
55#define DA8XX_MMCSD0_BASE 0x01c40000 58#define DA8XX_MMCSD0_BASE 0x01c40000
56#define DA8XX_AEMIF_CS2_BASE 0x60000000 59#define DA8XX_AEMIF_CS2_BASE 0x60000000
57#define DA8XX_AEMIF_CS3_BASE 0x62000000 60#define DA8XX_AEMIF_CS3_BASE 0x62000000
@@ -96,6 +99,7 @@ int da8xx_register_rtc(void);
96int da850_register_cpufreq(void); 99int da850_register_cpufreq(void);
97int da8xx_register_cpuidle(void); 100int da8xx_register_cpuidle(void);
98void __iomem * __init da8xx_get_mem_ctlr(void); 101void __iomem * __init da8xx_get_mem_ctlr(void);
102int da850_register_pm(struct platform_device *pdev);
99 103
100extern struct platform_device da8xx_serial_device; 104extern struct platform_device da8xx_serial_device;
101extern struct emac_platform_data da8xx_emac_pdata; 105extern struct emac_platform_data da8xx_emac_pdata;
diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h
index b60c693985ff..137bfba51d1f 100644
--- a/arch/arm/mach-davinci/include/mach/mux.h
+++ b/arch/arm/mach-davinci/include/mach/mux.h
@@ -899,6 +899,7 @@ enum davinci_da850_index {
899 DA850_GPIO2_15, 899 DA850_GPIO2_15,
900 DA850_GPIO4_0, 900 DA850_GPIO4_0,
901 DA850_GPIO4_1, 901 DA850_GPIO4_1,
902 DA850_RTC_ALARM,
902}; 903};
903 904
904#ifdef CONFIG_DAVINCI_MUX 905#ifdef CONFIG_DAVINCI_MUX