patch-2.4.5 linux/arch/cris/boot/compressed/head.S

Next file: linux/arch/cris/boot/compressed/misc.c
Previous file: linux/arch/cris/boot/compressed/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.4/linux/arch/cris/boot/compressed/head.S linux/arch/cris/boot/compressed/head.S
@@ -1,16 +1,19 @@
 /*
- *  arch/etrax100/boot/compressed/head.S
+ *  arch/cris/boot/compressed/head.S
  *
- *  Copyright (C) 1999 Axis Communications AB
+ *  Copyright (C) 1999, 2001 Axis Communications AB
  *
  *  Code that sets up the DRAM registers, calls the
  *  decompressor to unpack the piggybacked kernel, and jumps.
  *
  */
 
+#include <linux/config.h>
 #define ASSEMBLER_MACROS_ONLY
 #include <asm/sv_addr_ag.h>
 
+#define RAM_INIT_MAGIC 0x56902387
+	
 	;; Exported symbols
 	
 	.globl	_input_data
@@ -21,23 +24,28 @@
 	nop
 	di
 
-	;; We need to initialze DRAM registers before we start using the DRAM
-#include "../../lib/dram_init.S"
+;; We need to initialze DRAM registers before we start using the DRAM
 	
-dram_init_finished:
+	cmp.d	RAM_INIT_MAGIC, r8	; Already initialized?
+	beq	dram_init_finished
+	nop
+	
+#include "../../lib/dram_init.S"
 	
+dram_init_finished:	
+		
 	;; Initiate the PA and PB ports
 
-	move.b   DEF_R_PORT_PA_DATA, r0
+	move.b   CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0
 	move.b   r0, [R_PORT_PA_DATA]
 
-	move.b   DEF_R_PORT_PA_DIR, r0
+	move.b   CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0
 	move.b   r0, [R_PORT_PA_DIR]
 
-	move.b   DEF_R_PORT_PB_DATA, r0
+	move.b   CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0
 	move.b   r0, [R_PORT_PB_DATA]
 
-	move.b   DEF_R_PORT_PB_DIR, r0
+	move.b   CONFIG_ETRAX_DEF_R_PORT_PB_DIR, r0
 	move.b   r0, [R_PORT_PB_DIR]
 
 	;; Setup the stack to a suitably high address.
@@ -70,6 +78,7 @@
 
 	move.d	r5, [_input_data] ; for the decompressor
 
+
 	;; Clear the decompressors BSS (between _edata and _end)
 	
 	moveq	0, r0
@@ -81,19 +90,22 @@
 	nop
 	
 	;; Do the decompression and save compressed size in _inptr
-	
+
 	jsr	_decompress_kernel
 	
-	;; Put start address of cramfs in r9 so the kernel can use it
+	;; Put start address of root partition in r9 so the kernel can use it
 	;; when mounting from flash
 
 	move.d	[_input_data], r9	; flash address of compressed kernel
 	add.d	[_inptr], r9		; size of compressed kernel
-
+	 
 	;; Enter the decompressed kernel
+	move.d	RAM_INIT_MAGIC, r8	; Tell kernel that DRAM is initialized
 	jump	0x40004000	; kernel is linked to this address
 	
 	.data
 
 _input_data:
 	.dword	0		; used by the decompressor
+
+#include "../../lib/hw_settings.S"

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)