patch-2.1.110 linux/arch/arm/boot/compressed/head-nexuspci.S

Next file: linux/arch/arm/boot/compressed/head.S
Previous file: linux/arch/arm/boot/compressed/Makefile.debug
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.109/linux/arch/arm/boot/compressed/head-nexuspci.S linux/arch/arm/boot/compressed/head-nexuspci.S
@@ -1,35 +1,32 @@
 /*
  * linux/arch/arm/boot/compressed/head-nexuspci.S
  *
- * Copyright (C) 1996 Philip Blundell
+ * Copyright (C) 1996, 1997, 1998 Philip Blundell
+ *
+ * NexusPCI is unusual because we don't have a bootloader -- the kernel is
+ * run directly out of ROM at the moment.  Maybe this will change one day and
+ * then this file can go away.
+ *
  */
 
-#define ARM_CP			p15
-#define ARM610_REG_CONTROL	cr1
-#define ARM_REG_ZERO		cr0
-
 		.text
 
-start:		b	skip1
-		b	go_uncompress
-		b	go_uncompress
-		b	go_uncompress
-		b	go_uncompress
-		b	go_uncompress
+.globl	_start
+_start:		b	reset
+		b	undefined
+		b	undefined
+		b	undefined
+		b	undefined
+		b	undefined
+		b	undefined
+		b	undefined
 		b	go_uncompress
-		b	go_uncompress
-		b	go_uncompress
-		b	go_uncompress
-skip1:		mov	sp, #0x40000000
-		add	sp, sp, #0x200000
-		mov	r2, #0x20000000
+	
+reset:		mov	r2, #0x20000000			@ LED off
 		mov	r1, #0x1a
 		str	r1, [r2]
 
-		MOV	r0, #0x30
-		MCR	ARM_CP, 0, r0, ARM610_REG_CONTROL, ARM_REG_ZERO
-		
-		mov	r2, #0x10000000
+		mov	r2, #0x10000000			@ SCC init
 
 		mov	r1, #42
 		strb	r1, [r2, #8]
@@ -57,37 +54,46 @@
 		mov	r1, #5
 		strb	r1, [r2, #0x8]
 
-		mov	r0, #0x50
+		ldr	r2, =_start
+		ldr	r3, =_edata
+		mov	r8, r2
+		mov	r0, #0
+1:
+		ldmia	r0!, {r4, r5, r6, r7}
+		stmia	r2!, {r4, r5, r6, r7}
+		cmp	r2, r3
+		ble	1b
+
+		ldr	r3, =_edata
+		ldr	r1, =_end
+		mov	r2, #0
+1:
+		strb	r2, [r3]
+		cmp	r3, r1
+		beq	2f
+		add	r3, r3, #1
+		b	1b
+2:	
+		add	pc, r8, #0x20
+
+undefined:	ldr	r4, =undef_msg
+1:		ldrb	r0, [r4], #1
+		movs	r0, r0
+2:		beq	2b
 		bl	_ll_write_char
+		b	1b
 
-		mov	r4, #0x40000000
-		mov	r1, #0x00200000
-		add	r4, r4, r1
-copylp:
-		ldr	r3, [r1]
-		str	r3, [r4, r1]
-		subs	r1, r1, #4
-		bne	copylp
-
-		add	pc, r4, #0x28
-
+undef_msg:	.ascii	"Undefined instruction (or other problem)\000"
+		.align	4
 
 /*
  * Uncompress the kernel
  */
 go_uncompress:
-		mov	r0,   #0x40000000
-		add	r0, r0, #0x300000
-		bl	_decompress_kernel
-
-		mov	r0,   #0x40000000
-		add	r1, r0, #0x300000
-		mov	r2, #0x100000
-
-clp2:		ldr	r3, [r1, r2]
-		str	r3, [r0, r2]
-		subs	r2, r2, #4
-		bne	clp2
+		mov	r0, #0x40000000
+		ldr	sp, =user_stack
+		add	sp, sp, #4096
+		bl	decompress_kernel
 
 		mov	r2, #0x40000000
 		mov	r0, #0

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov