diff options
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/io.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/memory.c | 48 |
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 @@ | |||
26 | extern void omap_sram_init(void); | 26 | extern void omap_sram_init(void); |
27 | extern int omap2_clk_init(void); | 27 | extern int omap2_clk_init(void); |
28 | extern void omap2_check_revision(void); | 28 | extern void omap2_check_revision(void); |
29 | extern void omap2_init_memory(void); | ||
29 | extern void gpmc_init(void); | 30 | extern void gpmc_init(void); |
30 | extern void omapfb_reserve_sdram(void); | 31 | extern 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 | |||
40 | static const u32 sms_base = IO_ADDRESS(SMS_BASE); | ||
41 | static const u32 sdrc_base = IO_ADDRESS(SDRC_BASE); | ||
42 | |||
43 | |||
44 | static inline void sms_write_reg(int idx, u32 val) | ||
45 | { | ||
46 | __raw_writel(val, sms_base + idx); | ||
47 | } | ||
48 | |||
49 | static inline u32 sms_read_reg(int idx) | ||
50 | { | ||
51 | return __raw_readl(sms_base + idx); | ||
52 | } | ||
53 | |||
54 | static inline void sdrc_write_reg(int idx, u32 val) | ||
55 | { | ||
56 | __raw_writel(val, sdrc_base + idx); | ||
57 | } | ||
58 | |||
59 | static inline u32 sdrc_read_reg(int idx) | ||
60 | { | ||
61 | return __raw_readl(sdrc_base + idx); | ||
62 | } | ||
63 | |||
64 | |||
33 | static struct memory_timings mem_timings; | 65 | static struct memory_timings mem_timings; |
34 | 66 | ||
35 | u32 omap2_memory_get_slow_dll_ctrl(void) | 67 | u32 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 | |||
135 | void __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 | } | ||