aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap4-common.c
diff options
context:
space:
mode:
authorSantosh Shilimkar <santosh.shilimkar@ti.com>2011-01-01 09:26:04 -0500
committerKevin Hilman <khilman@ti.com>2011-12-08 14:28:59 -0500
commit501f0c751de06d8484b4279131c26f58bd49a69d (patch)
treeb993d2a9ad7df11dbde65e41ee0dc8d4e444113b /arch/arm/mach-omap2/omap4-common.c
parent02afe8a7f23d562cec76743ae34c4735d2819345 (diff)
ARM: OMAP4: PM: Add SAR RAM support
This patch adds SAR RAM support on OMAP4430. SAR RAM used to save and restore the HW context in low power modes. Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Jean Pihet <j-pihet@ti.com> Reviewed-by: Kevin Hilman <khilman@ti.com> Tested-by: Vishwanath BS <vishwanath.bs@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap4-common.c')
-rw-r--r--arch/arm/mach-omap2/omap4-common.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 4a3d2898543b..2489f5b8b983 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -24,11 +24,14 @@
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25 25
26#include "common.h" 26#include "common.h"
27#include "omap4-sar-layout.h"
27 28
28#ifdef CONFIG_CACHE_L2X0 29#ifdef CONFIG_CACHE_L2X0
29static void __iomem *l2cache_base; 30static void __iomem *l2cache_base;
30#endif 31#endif
31 32
33static void __iomem *sar_ram_base;
34
32void __init gic_init_irq(void) 35void __init gic_init_irq(void)
33{ 36{
34 void __iomem *omap_irq_base; 37 void __iomem *omap_irq_base;
@@ -118,3 +121,30 @@ static int __init omap_l2_cache_init(void)
118} 121}
119early_initcall(omap_l2_cache_init); 122early_initcall(omap_l2_cache_init);
120#endif 123#endif
124
125void __iomem *omap4_get_sar_ram_base(void)
126{
127 return sar_ram_base;
128}
129
130/*
131 * SAR RAM used to save and restore the HW
132 * context in low power modes
133 */
134static int __init omap4_sar_ram_init(void)
135{
136 /*
137 * To avoid code running on other OMAPs in
138 * multi-omap builds
139 */
140 if (!cpu_is_omap44xx())
141 return -ENOMEM;
142
143 /* Static mapping, never released */
144 sar_ram_base = ioremap(OMAP44XX_SAR_RAM_BASE, SZ_16K);
145 if (WARN_ON(!sar_ram_base))
146 return -ENOMEM;
147
148 return 0;
149}
150early_initcall(omap4_sar_ram_init);