diff options
author | Paul Walmsley <paul@pwsan.com> | 2008-03-18 04:04:51 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-04-14 13:29:37 -0400 |
commit | 445959821f82846913fe09fee0573e0238415e8c (patch) | |
tree | 38d0ec8fd827017e21961a42a58a9bcaaede7c6e /arch/arm/mach-omap2/memory.c | |
parent | c595713da76bc7cedddf5135072ea6037cc0befb (diff) |
ARM: OMAP2: Change 24xx to use new register access
This patch changes 24xx to use new register access, except for clock
framework. Clock framework register access will get updates in the
next patch.
Note that board-*.c files change GPMC (General Purpose Memory Controller)
access to use gpmc_cs_write_reg() instead of accessing the registers
directly. The code also uses gpmc_fck instead of it's parent clock
core_l3_ck for GPMC clock.
The H4 board file also adds h4_init_flash() function, which specify the
flash start and end addresses.
Also note that sleep.S removes some unused registers addresses.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/memory.c')
-rw-r--r-- | arch/arm/mach-omap2/memory.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/memory.c b/arch/arm/mach-omap2/memory.c index 3e5d8cd4ea4f..b56c1a082d92 100644 --- a/arch/arm/mach-omap2/memory.c +++ b/arch/arm/mach-omap2/memory.c | |||
@@ -27,11 +27,16 @@ | |||
27 | #include <asm/arch/clock.h> | 27 | #include <asm/arch/clock.h> |
28 | #include <asm/arch/sram.h> | 28 | #include <asm/arch/sram.h> |
29 | 29 | ||
30 | #include "prcm-regs.h" | 30 | #include "prm.h" |
31 | |||
31 | #include "memory.h" | 32 | #include "memory.h" |
33 | #include "sdrc.h" | ||
32 | 34 | ||
35 | unsigned long omap2_sdrc_base; | ||
36 | unsigned long omap2_sms_base; | ||
33 | 37 | ||
34 | static struct memory_timings mem_timings; | 38 | static struct memory_timings mem_timings; |
39 | static u32 curr_perf_level = CORE_CLK_SRC_DPLL_X2; | ||
35 | 40 | ||
36 | u32 omap2_memory_get_slow_dll_ctrl(void) | 41 | u32 omap2_memory_get_slow_dll_ctrl(void) |
37 | { | 42 | { |
@@ -53,7 +58,7 @@ void omap2_init_memory_params(u32 force_lock_to_unlock_mode) | |||
53 | unsigned long dll_cnt; | 58 | unsigned long dll_cnt; |
54 | u32 fast_dll = 0; | 59 | u32 fast_dll = 0; |
55 | 60 | ||
56 | mem_timings.m_type = !((SDRC_MR_0 & 0x3) == 0x1); /* DDR = 1, SDR = 0 */ | 61 | mem_timings.m_type = !((sdrc_read_reg(SDRC_MR_0) & 0x3) == 0x1); /* DDR = 1, SDR = 0 */ |
57 | 62 | ||
58 | /* 2422 es2.05 and beyond has a single SIP DDR instead of 2 like others. | 63 | /* 2422 es2.05 and beyond has a single SIP DDR instead of 2 like others. |
59 | * In the case of 2422, its ok to use CS1 instead of CS0. | 64 | * In the case of 2422, its ok to use CS1 instead of CS0. |
@@ -73,11 +78,11 @@ void omap2_init_memory_params(u32 force_lock_to_unlock_mode) | |||
73 | mem_timings.dll_mode = M_LOCK; | 78 | mem_timings.dll_mode = M_LOCK; |
74 | 79 | ||
75 | if (mem_timings.base_cs == 0) { | 80 | if (mem_timings.base_cs == 0) { |
76 | fast_dll = SDRC_DLLA_CTRL; | 81 | fast_dll = sdrc_read_reg(SDRC_DLLA_CTRL); |
77 | dll_cnt = SDRC_DLLA_STATUS & 0xff00; | 82 | dll_cnt = sdrc_read_reg(SDRC_DLLA_STATUS) & 0xff00; |
78 | } else { | 83 | } else { |
79 | fast_dll = SDRC_DLLB_CTRL; | 84 | fast_dll = sdrc_read_reg(SDRC_DLLB_CTRL); |
80 | dll_cnt = SDRC_DLLB_STATUS & 0xff00; | 85 | dll_cnt = sdrc_read_reg(SDRC_DLLB_STATUS) & 0xff00; |
81 | } | 86 | } |
82 | if (force_lock_to_unlock_mode) { | 87 | if (force_lock_to_unlock_mode) { |
83 | fast_dll &= ~0xff00; | 88 | fast_dll &= ~0xff00; |
@@ -106,14 +111,13 @@ void __init omap2_init_memory(void) | |||
106 | { | 111 | { |
107 | u32 l; | 112 | u32 l; |
108 | 113 | ||
109 | l = SMS_SYSCONFIG; | 114 | l = sms_read_reg(SMS_SYSCONFIG); |
110 | l &= ~(0x3 << 3); | 115 | l &= ~(0x3 << 3); |
111 | l |= (0x2 << 3); | 116 | l |= (0x2 << 3); |
112 | SMS_SYSCONFIG = l; | 117 | sms_write_reg(l, SMS_SYSCONFIG); |
113 | 118 | ||
114 | l = SDRC_SYSCONFIG; | 119 | l = sdrc_read_reg(SDRC_SYSCONFIG); |
115 | l &= ~(0x3 << 3); | 120 | l &= ~(0x3 << 3); |
116 | l |= (0x2 << 3); | 121 | l |= (0x2 << 3); |
117 | SDRC_SYSCONFIG = l; | 122 | sdrc_write_reg(l, SDRC_SYSCONFIG); |
118 | |||
119 | } | 123 | } |