aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v10/lib/dram_init.S
diff options
context:
space:
mode:
authorJesper Nilsson <jespern@axis.com>2014-01-15 08:42:37 -0500
committerJesper Nilsson <jespern@axis.com>2014-01-15 08:44:02 -0500
commite269a869417cd4053b37da1b19186902d3cbf63b (patch)
tree6d97e80f40859b62cfa8a1a634a1c3ad944681b1 /arch/cris/arch-v10/lib/dram_init.S
parente7672be573afa078e8d85d5ad0202b78bd6bd1fd (diff)
Drop code for CRISv10 CPU simulator
That simulator is dead and redundant. Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Diffstat (limited to 'arch/cris/arch-v10/lib/dram_init.S')
-rw-r--r--arch/cris/arch-v10/lib/dram_init.S40
1 files changed, 18 insertions, 22 deletions
diff --git a/arch/cris/arch-v10/lib/dram_init.S b/arch/cris/arch-v10/lib/dram_init.S
index b9190ff7d0a4..e541d3d8f922 100644
--- a/arch/cris/arch-v10/lib/dram_init.S
+++ b/arch/cris/arch-v10/lib/dram_init.S
@@ -5,9 +5,7 @@
5 * Note: This file may not modify r9 because r9 is used to carry 5 * Note: This file may not modify r9 because r9 is used to carry
6 * information from the decompresser to the kernel 6 * information from the decompresser to the kernel
7 * 7 *
8 * Copyright (C) 2000, 2001 Axis Communications AB 8 * Copyright (C) 2000-2012 Axis Communications AB
9 *
10 * Authors: Mikael Starvik (starvik@axis.com)
11 * 9 *
12 */ 10 */
13 11
@@ -18,16 +16,15 @@
18 16
19 17
20 ;; WARNING! The registers r8 and r9 are used as parameters carrying 18 ;; WARNING! The registers r8 and r9 are used as parameters carrying
21 ;; information from the decompressor (if the kernel was compressed). 19 ;; information from the decompressor (if the kernel was compressed).
22 ;; They should not be used in the code below. 20 ;; They should not be used in the code below.
23 21
24#ifndef CONFIG_SVINTO_SIM
25 move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0 22 move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0
26 move.d $r0, [R_WAITSTATES] 23 move.d $r0, [R_WAITSTATES]
27 24
28 move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0 25 move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0
29 move.d $r0, [R_BUS_CONFIG] 26 move.d $r0, [R_BUS_CONFIG]
30 27
31#ifndef CONFIG_ETRAX_SDRAM 28#ifndef CONFIG_ETRAX_SDRAM
32 move.d CONFIG_ETRAX_DEF_R_DRAM_CONFIG, $r0 29 move.d CONFIG_ETRAX_DEF_R_DRAM_CONFIG, $r0
33 move.d $r0, [R_DRAM_CONFIG] 30 move.d $r0, [R_DRAM_CONFIG]
@@ -38,14 +35,14 @@
38 ;; Samsung SDRAMs seem to require to be initialized twice to work properly. 35 ;; Samsung SDRAMs seem to require to be initialized twice to work properly.
39 moveq 2, $r6 36 moveq 2, $r6
40_sdram_init: 37_sdram_init:
41 38
42 ; Refer to ETRAX 100LX Designers Reference for a description of SDRAM initialization 39 ; Refer to ETRAX 100LX Designers Reference for a description of SDRAM initialization
43 40
44 ; Bank configuration 41 ; Bank configuration
45 move.d CONFIG_ETRAX_DEF_R_SDRAM_CONFIG, $r0 42 move.d CONFIG_ETRAX_DEF_R_SDRAM_CONFIG, $r0
46 move.d $r0, [R_SDRAM_CONFIG] 43 move.d $r0, [R_SDRAM_CONFIG]
47 44
48 ; Calculate value of mrs_data 45 ; Calculate value of mrs_data
49 ; CAS latency = 2 && bus_width = 32 => 0x40 46 ; CAS latency = 2 && bus_width = 32 => 0x40
50 ; CAS latency = 3 && bus_width = 32 => 0x60 47 ; CAS latency = 3 && bus_width = 32 => 0x60
51 ; CAS latency = 2 && bus_width = 16 => 0x20 48 ; CAS latency = 2 && bus_width = 16 => 0x20
@@ -56,22 +53,22 @@ _sdram_init:
56 and.d 0x00ff0000, $r2 53 and.d 0x00ff0000, $r2
57 bne _set_timing 54 bne _set_timing
58 lsrq 16, $r2 55 lsrq 16, $r2
59 56
60 move.d 0x40, $r2 ; Assume 32 bits and CAS latency = 2 57 move.d 0x40, $r2 ; Assume 32 bits and CAS latency = 2
61 move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1 58 move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1
62 move.d $r1, $r3 59 move.d $r1, $r3
63 and.d 0x03, $r1 ; Get CAS latency 60 and.d 0x03, $r1 ; Get CAS latency
64 and.d 0x1000, $r3 ; 50 or 100 MHz? 61 and.d 0x1000, $r3 ; 50 or 100 MHz?
65 beq _speed_50 62 beq _speed_50
66 nop 63 nop
67_speed_100: 64_speed_100:
68 cmp.d 0x00, $r1 ; CAS latency = 2? 65 cmp.d 0x00, $r1 ; CAS latency = 2?
69 beq _bw_check 66 beq _bw_check
70 nop 67 nop
71 or.d 0x20, $r2 ; CAS latency = 3 68 or.d 0x20, $r2 ; CAS latency = 3
72 ba _bw_check 69 ba _bw_check
73 nop 70 nop
74_speed_50: 71_speed_50:
75 cmp.d 0x01, $r1 ; CAS latency = 2? 72 cmp.d 0x01, $r1 ; CAS latency = 2?
76 beq _bw_check 73 beq _bw_check
77 nop 74 nop
@@ -86,19 +83,19 @@ _bw_check:
86 ; Set timing parameters. Starts master clock 83 ; Set timing parameters. Starts master clock
87_set_timing: 84_set_timing:
88 move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1 85 move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1
89 and.d 0x8000f9ff, $r1 ; Make sure mrs data and command is 0 86 and.d 0x8000f9ff, $r1 ; Make sure mrs data and command is 0
90 or.d 0x80000000, $r1 ; Make sure sdram enable bit is set 87 or.d 0x80000000, $r1 ; Make sure sdram enable bit is set
91 move.d $r1, $r5 88 move.d $r1, $r5
92 or.d 0x0000c000, $r1 ; ref = disable 89 or.d 0x0000c000, $r1 ; ref = disable
93 lslq 16, $r2 ; mrs data starts at bit 16 90 lslq 16, $r2 ; mrs data starts at bit 16
94 or.d $r2, $r1 91 or.d $r2, $r1
95 move.d $r1, [R_SDRAM_TIMING] 92 move.d $r1, [R_SDRAM_TIMING]
96 93
97 ; Wait 200us 94 ; Wait 200us
98 move.d 10000, $r2 95 move.d 10000, $r2
991: bne 1b 961: bne 1b
100 subq 1, $r2 97 subq 1, $r2
101 98
102 ; Issue initialization command sequence 99 ; Issue initialization command sequence
103 move.d _sdram_commands_start, $r2 100 move.d _sdram_commands_start, $r2
104 and.d 0x000fffff, $r2 ; Make sure commands are read from flash 101 and.d 0x000fffff, $r2 ; Make sure commands are read from flash
@@ -144,7 +141,6 @@ _sdram_commands_start:
144 .byte 2 ; refresh 141 .byte 2 ; refresh
145 .byte 0 ; nop 142 .byte 0 ; nop
146 .byte 1 ; mrs 143 .byte 1 ; mrs
147 .byte 0 ; nop 144 .byte 0 ; nop
148_sdram_commands_end: 145_sdram_commands_end:
149#endif
150#endif 146#endif