patch-2.4.20 linux-2.4.20/arch/cris/lib/dram_init.S
Next file: linux-2.4.20/arch/cris/lib/hw_settings.S
Previous file: linux-2.4.20/arch/cris/kernel/traps.c
Back to the patch index
Back to the overall index
- Lines: 55
- Date:
Thu Nov 28 15:53:09 2002
- Orig file:
linux-2.4.19/arch/cris/lib/dram_init.S
- Orig date:
Mon Oct 8 11:43:54 2001
diff -urN linux-2.4.19/arch/cris/lib/dram_init.S linux-2.4.20/arch/cris/lib/dram_init.S
@@ -1,4 +1,4 @@
-/* $Id: dram_init.S,v 1.10 2001/10/04 12:00:21 martinnn Exp $
+/* $Id: dram_init.S,v 1.12 2002/08/09 11:37:37 orjanf Exp $
*
* DRAM/SDRAM initialization - alter with care
* This file is intended to be included from other assembler files
@@ -11,6 +11,12 @@
* Authors: Mikael Starvik (starvik@axis.com)
*
* $Log: dram_init.S,v $
+ * Revision 1.12 2002/08/09 11:37:37 orjanf
+ * Added double initialization work-around for Samsung SDRAMs.
+ *
+ * Revision 1.11 2002/06/04 11:43:21 starvik
+ * Check if mrs_data is specified in kernelconfig (necessary for MCM)
+ *
* Revision 1.10 2001/10/04 12:00:21 martinnn
* Added missing underscores.
*
@@ -70,7 +76,11 @@
move.d CONFIG_ETRAX_DEF_R_DRAM_TIMING, $r0
move.d $r0, [R_DRAM_TIMING]
-#else
+#else
+ ;; Samsung SDRAMs seem to require to be initialized twice to work properly.
+ moveq 2, $r6
+_sdram_init:
+
; Refer to ETRAX 100LX Designers Reference for a description of SDRAM initialization
; Bank configuration
@@ -82,6 +92,12 @@
; CAS latency = 3 && bus_width = 32 => 0x60
; CAS latency = 2 && bus_width = 16 => 0x20
; CAS latency = 3 && bus_width = 16 => 0x30
+
+ ; Check if value is already supplied in kernel config
+ move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r2
+ and.d 0x00ff0000, $r2
+ bne _set_timing
+ lsrq 16, $r2
move.d 0x40, $r2 ; Assume 32 bits and CAS latency = 2
move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1
@@ -142,6 +158,9 @@
bne 1b
nop
move.d $r5, [R_SDRAM_TIMING]
+ subq 1, $r6
+ bne _sdram_init
+ nop
ba _sdram_commands_end
nop
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)