diff options
author | Jesper Nilsson <jesper.nilsson@axis.com> | 2010-08-03 11:34:28 -0400 |
---|---|---|
committer | Jesper Nilsson <jesper.nilsson@axis.com> | 2010-08-04 07:02:30 -0400 |
commit | 98560bd83e73b5c0cf38e3d984892f46a405a172 (patch) | |
tree | 7ebd32772309f6ea50866b3fe7a9364ce3c77996 | |
parent | 2d0503d1a6816e920e5b827bbe4eea7370c8130e (diff) |
CRIS: Add more delays in DDR setup
Also, make DDR latency configurable.
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
-rw-r--r-- | arch/cris/arch-v32/mach-a3/Kconfig | 4 | ||||
-rw-r--r-- | arch/cris/arch-v32/mach-a3/dram_init.S | 16 | ||||
-rw-r--r-- | arch/cris/arch-v32/mach-a3/hw_settings.S | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/arch/cris/arch-v32/mach-a3/Kconfig b/arch/cris/arch-v32/mach-a3/Kconfig index a4df06d5997a..7796aafc711e 100644 --- a/arch/cris/arch-v32/mach-a3/Kconfig +++ b/arch/cris/arch-v32/mach-a3/Kconfig | |||
@@ -33,6 +33,10 @@ config ETRAX_DDR2_CONFIG | |||
33 | hex "DDR2 config" | 33 | hex "DDR2 config" |
34 | default "0" | 34 | default "0" |
35 | 35 | ||
36 | config ETRAX_DDR2_LATENCY | ||
37 | hex "DDR2 latency" | ||
38 | default "0" | ||
39 | |||
36 | config ETRAX_PIO_CE0_CFG | 40 | config ETRAX_PIO_CE0_CFG |
37 | hex "PIO CE0 configuration" | 41 | hex "PIO CE0 configuration" |
38 | default "0" | 42 | default "0" |
diff --git a/arch/cris/arch-v32/mach-a3/dram_init.S b/arch/cris/arch-v32/mach-a3/dram_init.S index 94d6b41cb299..ec8648be32d3 100644 --- a/arch/cris/arch-v32/mach-a3/dram_init.S +++ b/arch/cris/arch-v32/mach-a3/dram_init.S | |||
@@ -24,11 +24,21 @@ | |||
24 | 24 | ||
25 | ;; Refer to ddr2 MDS for initialization sequence | 25 | ;; Refer to ddr2 MDS for initialization sequence |
26 | 26 | ||
27 | ; 2. Wait 200us | ||
28 | move.d 10000, $r2 | ||
29 | 1: bne 1b | ||
30 | subq 1, $r2 | ||
31 | |||
27 | ; Start clock | 32 | ; Start clock |
28 | move.d REG_ADDR(ddr2, regi_ddr2_ctrl, rw_phy_cfg), $r0 | 33 | move.d REG_ADDR(ddr2, regi_ddr2_ctrl, rw_phy_cfg), $r0 |
29 | move.d REG_STATE(ddr2, rw_phy_cfg, en, yes), $r1 | 34 | move.d REG_STATE(ddr2, rw_phy_cfg, en, yes), $r1 |
30 | move.d $r1, [$r0] | 35 | move.d $r1, [$r0] |
31 | 36 | ||
37 | ; 2. Wait 200us | ||
38 | move.d 10000, $r2 | ||
39 | 1: bne 1b | ||
40 | subq 1, $r2 | ||
41 | |||
32 | ; Reset phy and start calibration | 42 | ; Reset phy and start calibration |
33 | move.d REG_ADDR(ddr2, regi_ddr2_ctrl, rw_phy_ctrl), $r0 | 43 | move.d REG_ADDR(ddr2, regi_ddr2_ctrl, rw_phy_ctrl), $r0 |
34 | move.d REG_STATE(ddr2, rw_phy_ctrl, rst, yes) | \ | 44 | move.d REG_STATE(ddr2, rw_phy_ctrl, rst, yes) | \ |
@@ -52,6 +62,10 @@ do_cmd: | |||
52 | lslq 16, $r1 | 62 | lslq 16, $r1 |
53 | or.d $r3, $r1 | 63 | or.d $r3, $r1 |
54 | move.d $r1, [$r0] | 64 | move.d $r1, [$r0] |
65 | ; 2. Wait 200us | ||
66 | move.d 10000, $r4 | ||
67 | 1: bne 1b | ||
68 | subq 1, $r4 | ||
55 | cmp.d sdram_commands_end, $r2 | 69 | cmp.d sdram_commands_end, $r2 |
56 | blo command_loop | 70 | blo command_loop |
57 | nop | 71 | nop |
@@ -63,7 +77,7 @@ do_cmd: | |||
63 | 77 | ||
64 | ; Set latency | 78 | ; Set latency |
65 | move.d REG_ADDR(ddr2, regi_ddr2_ctrl, rw_latency), $r0 | 79 | move.d REG_ADDR(ddr2, regi_ddr2_ctrl, rw_latency), $r0 |
66 | move.d 0x13, $r1 | 80 | move.d CONFIG_ETRAX_DDR2_LATENCY, $r1 |
67 | move.d $r1, [$r0] | 81 | move.d $r1, [$r0] |
68 | 82 | ||
69 | ; Set configuration | 83 | ; Set configuration |
diff --git a/arch/cris/arch-v32/mach-a3/hw_settings.S b/arch/cris/arch-v32/mach-a3/hw_settings.S index 258a6329cd4a..0145725a1ce5 100644 --- a/arch/cris/arch-v32/mach-a3/hw_settings.S +++ b/arch/cris/arch-v32/mach-a3/hw_settings.S | |||
@@ -31,6 +31,8 @@ | |||
31 | ; Register values | 31 | ; Register values |
32 | .dword REG_ADDR(ddr2, regi_ddr2_ctrl, rw_cfg) | 32 | .dword REG_ADDR(ddr2, regi_ddr2_ctrl, rw_cfg) |
33 | .dword CONFIG_ETRAX_DDR2_CONFIG | 33 | .dword CONFIG_ETRAX_DDR2_CONFIG |
34 | .dword REG_ADDR(ddr2, regi_ddr2_ctrl, rw_latency) | ||
35 | .dword CONFIG_ETRAX_DDR2_LATENCY | ||
34 | .dword REG_ADDR(ddr2, regi_ddr2_ctrl, rw_timing) | 36 | .dword REG_ADDR(ddr2, regi_ddr2_ctrl, rw_timing) |
35 | .dword CONFIG_ETRAX_DDR2_TIMING | 37 | .dword CONFIG_ETRAX_DDR2_TIMING |
36 | .dword CONFIG_ETRAX_DDR2_MRS | 38 | .dword CONFIG_ETRAX_DDR2_MRS |