aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorJuha Yrjola <juha.yrjola@solidboot.com>2006-12-06 20:13:46 -0500
committerTony Lindgren <tony@atomide.com>2007-09-20 12:59:16 -0400
commit33c9907535cef6cb5de1269540c04664c393d09c (patch)
tree6ed91debf2685a87c726964ea56f40d2209de5dc /arch/arm
parent81cfe79b9c577139a873483654640eb3f6e78c39 (diff)
ARM: OMAP2: Place SMS and SDRC into smart idle mode
Place SMS and SDRC into smart idle mode Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/io.c2
-rw-r--r--arch/arm/mach-omap2/memory.c48
2 files changed, 50 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 82dc70f6b779..a57a4295ce23 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -26,6 +26,7 @@
26extern void omap_sram_init(void); 26extern void omap_sram_init(void);
27extern int omap2_clk_init(void); 27extern int omap2_clk_init(void);
28extern void omap2_check_revision(void); 28extern void omap2_check_revision(void);
29extern void omap2_init_memory(void);
29extern void gpmc_init(void); 30extern void gpmc_init(void);
30extern void omapfb_reserve_sdram(void); 31extern void omapfb_reserve_sdram(void);
31 32
@@ -80,5 +81,6 @@ void __init omap2_init_common_hw(void)
80{ 81{
81 omap2_mux_init(); 82 omap2_mux_init();
82 omap2_clk_init(); 83 omap2_clk_init();
84 omap2_init_memory();
83 gpmc_init(); 85 gpmc_init();
84} 86}
diff --git a/arch/arm/mach-omap2/memory.c b/arch/arm/mach-omap2/memory.c
index 85cbc2a2e663..f173aa8d896f 100644
--- a/arch/arm/mach-omap2/memory.c
+++ b/arch/arm/mach-omap2/memory.c
@@ -30,6 +30,38 @@
30#include "prcm-regs.h" 30#include "prcm-regs.h"
31#include "memory.h" 31#include "memory.h"
32 32
33#define SMS_BASE 0x68008000
34#define SMS_SYSCONFIG 0x010
35
36#define SDRC_BASE 0x68009000
37#define SDRC_SYSCONFIG 0x010
38#define SDRC_SYSSTATUS 0x014
39
40static const u32 sms_base = IO_ADDRESS(SMS_BASE);
41static const u32 sdrc_base = IO_ADDRESS(SDRC_BASE);
42
43
44static inline void sms_write_reg(int idx, u32 val)
45{
46 __raw_writel(val, sms_base + idx);
47}
48
49static inline u32 sms_read_reg(int idx)
50{
51 return __raw_readl(sms_base + idx);
52}
53
54static inline void sdrc_write_reg(int idx, u32 val)
55{
56 __raw_writel(val, sdrc_base + idx);
57}
58
59static inline u32 sdrc_read_reg(int idx)
60{
61 return __raw_readl(sdrc_base + idx);
62}
63
64
33static struct memory_timings mem_timings; 65static struct memory_timings mem_timings;
34 66
35u32 omap2_memory_get_slow_dll_ctrl(void) 67u32 omap2_memory_get_slow_dll_ctrl(void)
@@ -99,3 +131,19 @@ void omap2_init_memory_params(u32 force_lock_to_unlock_mode)
99 /* 90 degree phase for anything below 133Mhz + disable DLL filter */ 131 /* 90 degree phase for anything below 133Mhz + disable DLL filter */
100 mem_timings.slow_dll_ctrl |= ((1 << 1) | (3 << 8)); 132 mem_timings.slow_dll_ctrl |= ((1 << 1) | (3 << 8));
101} 133}
134
135void __init omap2_init_memory(void)
136{
137 u32 l;
138
139 l = sms_read_reg(SMS_SYSCONFIG);
140 l &= ~(0x3 << 3);
141 l |= (0x2 << 3);
142 sms_write_reg(SMS_SYSCONFIG, l);
143
144 l = sdrc_read_reg(SDRC_SYSCONFIG);
145 l &= ~(0x3 << 3);
146 l |= (0x2 << 3);
147 sdrc_write_reg(SDRC_SYSCONFIG, l);
148
149}