From c7fc24dc4420057f103afe8fc64524ebc25c5d37 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 25 Aug 1998 09:12:35 +0000 Subject: o Merge with Linux 2.1.116. o New Newport console code. o New G364 console code. --- arch/arm/boot/compressed/Makefile.debug | 13 ++++- arch/arm/boot/compressed/head-nexuspci.S | 96 +++++++++++++++++--------------- arch/arm/boot/compressed/head.S | 13 +++-- arch/arm/boot/compressed/misc.c | 6 +- arch/arm/boot/tools/.cvsignore | 2 + 5 files changed, 75 insertions(+), 55 deletions(-) create mode 100644 arch/arm/boot/tools/.cvsignore (limited to 'arch/arm/boot') diff --git a/arch/arm/boot/compressed/Makefile.debug b/arch/arm/boot/compressed/Makefile.debug index 3c87b0569..491a037b2 100644 --- a/arch/arm/boot/compressed/Makefile.debug +++ b/arch/arm/boot/compressed/Makefile.debug @@ -5,12 +5,19 @@ # COMPRESSED_EXTRA=../../lib/ll_char_wr.o -OBJECTS=misc-debug.o $(COMPRESSED_EXTRA) +OBJECTS=misc-debug.o ll_char_wr.aout.o CFLAGS=-D__KERNEL__ -O2 -DSTDC_HEADERS -DSTANDALONE_DEBUG -Wall -I../../../../include -c -test-gzip: piggy.o $(OBJECTS) - $(CC) -o $@ $(OBJECTS) piggy.o +test-gzip: piggy.aout.o $(OBJECTS) + $(CC) -o $@ $(OBJECTS) piggy.aout.o misc-debug.o: misc.c $(CC) $(CFLAGS) -o $@ misc.c + +piggy.aout.o: piggy.o + arm-linuxelf-objcopy --change-leading-char -I elf32-arm -O arm-aout32-linux piggy.o piggy.aout.o + +ll_char_wr.aout.o: $(COMPRESSED_EXTRA) + arm-linuxelf-objcopy --change-leading-char -I elf32-arm -O arm-aout32-linux $(COMPRESSED_EXTRA) ll_char_wr.aout.o + diff --git a/arch/arm/boot/compressed/head-nexuspci.S b/arch/arm/boot/compressed/head-nexuspci.S index 92840fbda..1fd49a95c 100644 --- a/arch/arm/boot/compressed/head-nexuspci.S +++ b/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 +.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 - 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 @@ skip1: mov sp, #0x40000000 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 diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 98853511b..ab2541f34 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -20,7 +20,10 @@ start: mov r0, r0 mov r0, r0 mov r0, r0 mov r0, r0 - teq r0, #0 + b 1f + .word 0x016f2818 @ Magic numbers to help the loader + .word _start +1: teq r0, #0 beq 2f mov r4, #0x02000000 add r4, r4, #0x7C000 @@ -59,11 +62,13 @@ start: mov r0, r0 * Uncompress the kernel */ mov r1, #0x8000 - add r2, r2, r1, lsl #1 @ Add 64k for malloc + add r3, r2, r1, lsl #1 @ Add 64k for malloc sub r1, r1, #1 - add r2, r2, r1 - bic r5, r2, r1 @ decompress kernel to after end of the compressed + add r3, r3, r1 + bic r5, r3, r1 @ decompress kernel to after end of the compressed mov r0, r5 + mov r1, r2 + mov r2, r0 bl SYMBOL_NAME(decompress_kernel) add r0, r0, #7 bic r2, r0, #7 diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c index 181583b75..ce2672911 100644 --- a/arch/arm/boot/compressed/misc.c +++ b/arch/arm/boot/compressed/misc.c @@ -274,10 +274,10 @@ ulg user_stack [STACK_SIZE]; #ifndef STANDALONE_DEBUG -ulg decompress_kernel(ulg output_start) +ulg decompress_kernel(ulg output_start, ulg free_mem_ptr_p, ulg free_mem_ptr_end_p) { - free_mem_ptr = (ulg)&end; - free_mem_ptr_end = output_start; + free_mem_ptr = free_mem_ptr_p; + free_mem_ptr_end = free_mem_ptr_end_p; proc_decomp_setup (); arch_decomp_setup (); diff --git a/arch/arm/boot/tools/.cvsignore b/arch/arm/boot/tools/.cvsignore new file mode 100644 index 000000000..857dd22e9 --- /dev/null +++ b/arch/arm/boot/tools/.cvsignore @@ -0,0 +1,2 @@ +.depend +.*.flags -- cgit v1.2.3