|
From: Andy P. <at...@us...> - 2002-04-09 17:08:14
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/compressed
In directory usw-pr-cvs1:/tmp/cvs-serv13825/cris/boot/compressed
Modified Files:
Makefile README decompress.ld head.S misc.c
Log Message:
synch 2.4.15 commit 29
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/compressed/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 25 Feb 2001 23:15:23 -0000 1.1.1.1
+++ Makefile 9 Apr 2002 17:03:15 -0000 1.2
@@ -16,12 +16,15 @@
all: vmlinuz
-vmlinuz: piggy.img $(OBJECTS)
- $(LD) -mcriself -T decompress.ld -o decompress.o $(OBJECTS)
+decompress.bin: $(OBJECTS)
+ $(LD) -T decompress.ld -o decompress.o $(OBJECTS)
$(OBJCOPY) -O binary --remove-section=.bss decompress.o decompress.bin
# save it for mkprod in the topdir.
cp decompress.bin $(TOPDIR)
- cat decompress.bin piggy.img $(TOPDIR)/cramfs.img > vmlinuz
+
+
+vmlinuz: piggy.img decompress.bin
+ cat decompress.bin piggy.img > vmlinuz
rm -f piggy.img
head.o: head.S
Index: README
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/compressed/README,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: decompress.ld
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/compressed/decompress.ld,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- decompress.ld 25 Feb 2001 23:15:23 -0000 1.1.1.1
+++ decompress.ld 9 Apr 2002 17:03:15 -0000 1.2
@@ -1,3 +1,5 @@
+OUTPUT_FORMAT(elf32-us-cris)
+
MEMORY
{
dram : ORIGIN = 0x40700000,
Index: head.S
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/compressed/head.S,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- head.S 25 Feb 2001 23:15:23 -0000 1.1.1.1
+++ head.S 9 Apr 2002 17:03:15 -0000 1.2
@@ -1,7 +1,7 @@
/*
- * 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.
@@ -12,6 +12,8 @@
#define ASSEMBLER_MACROS_ONLY
#include <asm/sv_addr_ag.h>
+#define RAM_INIT_MAGIC 0x56902387
+
;; Exported symbols
.globl _input_data
@@ -22,23 +24,29 @@
nop
di
-#ifndef CONFIG_SVINTO_SIM
-
- ;; We need to setup the bus registers before we start using the DRAM
+;; We need to initialze DRAM registers before we start using the DRAM
+
+ 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.d DEF_R_WAITSTATES, r0
- move.d r0, [R_WAITSTATES]
+ move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0
+ move.b r0, [R_PORT_PA_DATA]
- move.d DEF_R_BUS_CONFIG, r0
- move.d r0, [R_BUS_CONFIG]
-
- move.d DEF_R_DRAM_CONFIG, r0
- move.d r0, [R_DRAM_CONFIG]
+ move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0
+ move.b r0, [R_PORT_PA_DIR]
- move.d DEF_R_DRAM_TIMING, r0
- move.d r0, [R_DRAM_TIMING]
+ move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0
+ move.b r0, [R_PORT_PB_DATA]
-#endif
+ 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.
;; We assume 8 MB is the minimum DRAM in an eLinux
@@ -70,6 +78,7 @@
move.d r5, [_input_data] ; for the decompressor
+
;; Clear the decompressors BSS (between _edata and _end)
moveq 0, r0
@@ -81,20 +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
+ jsr _decompress_kernel
+
+ ;; 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"
Index: misc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/compressed/misc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- misc.c 25 Feb 2001 23:15:23 -0000 1.1.1.1
+++ misc.c 9 Apr 2002 17:03:15 -0000 1.2
@@ -13,7 +13,7 @@
*/
/* where the piggybacked kernel image expects itself to live.
- * it is the same address we use when we network load an uncompressed
+ * it is the same adress we use when we network load an uncompressed
* image into DRAM, and it is the address the kernel is linked to live
* at by etrax100.ld.
*/
@@ -21,6 +21,7 @@
#define KERNEL_LOAD_ADR 0x40004000
#include <linux/config.h>
+
#include <linux/types.h>
#include <asm/svinto.h>
@@ -143,21 +144,21 @@
static void
puts(const char *s)
{
-#ifndef CONFIG_DEBUG_PORT_NULL
+#ifndef CONFIG_ETRAX_DEBUG_PORT_NULL
while(*s) {
-#ifdef CONFIG_DEBUG_PORT0
+#ifdef CONFIG_ETRAX_DEBUG_PORT0
while(!(*R_SERIAL0_STATUS & (1 << 5))) ;
*R_SERIAL0_TR_DATA = *s++;
#endif
-#ifdef CONFIG_DEBUG_PORT1
+#ifdef CONFIG_ETRAX_DEBUG_PORT1
while(!(*R_SERIAL1_STATUS & (1 << 5))) ;
*R_SERIAL1_TR_DATA = *s++;
#endif
-#ifdef CONFIG_DEBUG_PORT2
+#ifdef CONFIG_ETRAX_DEBUG_PORT2
while(!(*R_SERIAL2_STATUS & (1 << 5))) ;
*R_SERIAL2_TR_DATA = *s++;
#endif
-#ifdef CONFIG_DEBUG_PORT3
+#ifdef CONFIG_ETRAX_DEBUG_PORT3
while(!(*R_SERIAL3_STATUS & (1 << 5))) ;
*R_SERIAL3_TR_DATA = *s++;
#endif
@@ -227,33 +228,45 @@
void
decompress_kernel()
{
+ char revision;
+
/* input_data is set in head.S */
inbuf = input_data;
-#ifdef CONFIG_DEBUG_PORT0
+#ifdef CONFIG_ETRAX_DEBUG_PORT0
*R_SERIAL0_XOFF = 0;
*R_SERIAL0_BAUD = 0x99;
*R_SERIAL0_TR_CTRL = 0x40;
#endif
-#ifdef CONFIG_DEBUG_PORT1
+#ifdef CONFIG_ETRAX_DEBUG_PORT1
*R_SERIAL1_XOFF = 0;
*R_SERIAL1_BAUD = 0x99;
*R_SERIAL1_TR_CTRL = 0x40;
#endif
-#ifdef CONFIG_DEBUG_PORT2
+#ifdef CONFIG_ETRAX_DEBUG_PORT2
+ *R_GEN_CONFIG = 0x08;
*R_SERIAL2_XOFF = 0;
*R_SERIAL2_BAUD = 0x99;
*R_SERIAL2_TR_CTRL = 0x40;
#endif
-#ifdef CONFIG_DEBUG_PORT3
+#ifdef CONFIG_ETRAX_DEBUG_PORT3
+ *R_GEN_CONFIG = 0x100;
*R_SERIAL3_XOFF = 0;
*R_SERIAL3_BAUD = 0x99;
*R_SERIAL3_TR_CTRL = 0x40;
#endif
-
+
setup_normal_output_buffer();
makecrc();
+
+ __asm__ volatile ("move vr,%0" : "=rm" (revision));
+ if (revision < 10)
+ {
+ puts("You need an ETRAX 100LX to run linux 2.4\n");
+ while(1);
+ }
+
puts("Uncompressing Linux...\n");
gunzip();
puts("Done. Now booting the kernel.\n");
|