[xtensa-cvscommit] linux/arch/xtensa/boot/boot-redboot Makefile,1.1.1.1,1.2 boot.ld,1.1.1.1,1.2 boot
Brought to you by:
zankel
|
From: <za...@us...> - 2003-05-02 22:53:07
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot In directory sc8-pr-cvs1:/tmp/cvs-serv3499/boot-redboot Modified Files: Makefile boot.ld bootstrap.S Log Message: Added support for compressed kernels. Removed targets 'Image' and 'Image.initrd' for RedBoot. Use 'make zImage' and 'make zImage.initrd', instead. Index: Makefile =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 28 Aug 2002 16:10:13 -0000 1.1.1.1 --- Makefile 2 May 2003 22:53:02 -0000 1.2 *************** *** 5,55 **** # ! OBJECTS := bootstrap.o ! ! bootstrap.o: bootstrap.S ! Image: $(OBJECTS) $(TOPDIR)/vmlinux ! $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \ ! $(TOPDIR)/vmlinux vmlinux.bin $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section=image=vmlinux.bin \ --set-section-flags image=contents,alloc,load,load,data \ bootstrap.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp -L/xtensa-elf/lib $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f vmlinux.bin $@.tmp $@.elf ! Image.initrd: $(OBJECTS) $(TOPDIR)/vmlinux ! $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \ ! $(TOPDIR)/vmlinux vmlinux.bin $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=vmlinux.bin \ --set-section-flags image=contents,alloc,load,load,data \ --add-section .initrd=../images/ramdisk \ --set-section-flags .initrd=contents,alloc,load,load,data \ bootstrap.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp -L/xtensa-elf/lib $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f vmlinux.bin $@.elf $@.tmp $@.elf ! ! zImage: $(OBJECTS) ../images/vmlinux.gz ../lib/zlib.a ! $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=../images/vmlinux.gz \ ! --set-section-flags image=contents,alloc,load,load,data \ ! head.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp -L/xtensa-elf/lib ! $(OBJCOPY) -S -O binary $@.elf images/$@.redboot ! rm -f $@.tmp ! ! zImage.initrd: $(OBJECTS) ../images/vmlinux.gz ../lib/zlib.a ! $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=../images/vmlinux.gz \ ! --set-section-flags image=contents,alloc,load,load,data \ ! --add-section .initrd=../images/ramdisk \ ! --set-section-flags .initrd=contents,alloc,load,load,data \ ! head.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp -L/xtensa-elf/lib ! $(OBJCOPY) -S -O binary $@.elf images/$@.redboot ! rm -f $@.tmp USE_STANDARD_AS_RULE=y --- 5,30 ---- # ! obj-y += ../common/misc.o ../common/memcpy.o ../../lib/hal/libhal.a ! LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) ! zImage: $(OBJECTS) ../images/vmlinux.gz ../lib/zlib.a $(obj-y) bootstrap.o $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=../images/vmlinux.gz \ --set-section-flags image=contents,alloc,load,load,data \ bootstrap.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp $(obj-y) ../lib/zlib.a -L/xtensa-elf/lib $(LIBGCC) $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f $@.tmp $@.elf ! zImage.initrd: $(OBJECTS) ../images/vmlinux.gz ../lib/zlib.a $(obj-y) bootstrap.o $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=../images/vmlinux.gz \ --set-section-flags image=contents,alloc,load,load,data \ --add-section .initrd=../images/ramdisk \ --set-section-flags .initrd=contents,alloc,load,load,data \ bootstrap.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp $(obj-y) ../lib/zlib.a -L/xtensa-elf/lib $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f $@.tmp $@.elf USE_STANDARD_AS_RULE=y Index: boot.ld =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot/boot.ld,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** boot.ld 28 Aug 2002 16:10:13 -0000 1.1.1.1 --- boot.ld 2 May 2003 22:53:02 -0000 1.2 *************** *** 9,13 **** __reloc_start = . ; _text_start = . ; ! *(.text.literal .text) _text_end = . ; } --- 9,13 ---- __reloc_start = . ; _text_start = . ; ! *(.literal .text.literal .text) _text_end = . ; } Index: bootstrap.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot/bootstrap.S,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bootstrap.S 11 Mar 2003 19:09:40 -0000 1.3 --- bootstrap.S 2 May 2003 22:53:02 -0000 1.4 *************** *** 4,7 **** --- 4,8 ---- #include <xtensa/config/core.h> #include <xtensa/cacheasm.h> + /* * RB-Data: RedBoot data/bss *************** *** 24,29 **** */ ! #define STACK_SIZE 16384 ! #define HEAP_SIZE 65536 # a2: Parameter list --- 25,32 ---- */ ! /* Make sure we have enough space for the 'uncompressor' */ ! ! #define STACK_SIZE 163840 ! #define HEAP_SIZE 524288 # a2: Parameter list *************** *** 33,37 **** .globl __start ! /* this is the first byte of the loader! */ __start: entry sp, 32 # we do not intend to return --- 36,40 ---- .globl __start ! /* this must be the first byte of the loader! */ __start: entry sp, 32 # we do not intend to return *************** *** 64,68 **** rsync ! /* copy the loader to its address */ /* Note: The assembler cannot relax "addi a0, a0, ..." to an --- 67,77 ---- rsync ! /* copy the loader to its address ! * Note: The loader itself is a very small piece, so we assume we ! * don't partially overlap. We also assume (even more important) ! * that the kernel image is out of the way. Usually, when the ! * load address of this image is not at an arbitrary address, ! * but aligned to some 10K's we shouldn't overlap. ! */ /* Note: The assembler cannot relax "addi a0, a0, ..." to an *************** *** 95,104 **** ! /* 28feb2003 jn -- ! * I changed this to use the nice macros provided, it's ! * a bit of overkill because you don't really need to flush ! * the entire cache, just the regions to where we just copied ! * the code. ! */ #if XCHAL_DCACHE_IS_WRITEBACK dcache_writeback_all a5, a6 --- 104,109 ---- ! /* We have to flush and invalidate the caches here before we jump. */ ! #if XCHAL_DCACHE_IS_WRITEBACK dcache_writeback_all a5, a6 *************** *** 112,115 **** --- 117,123 ---- _reloc: + /* RedBoot is now at the end of the memory, so we don't have + * to copy the parameter list. Keep the code around; in case + * we need it again. */ #if 0 # a0: load address *************** *** 129,132 **** --- 137,141 ---- blt a2, a3, 2b #endif + /* clear BSS section */ movi a6, __bss_start *************** *** 137,144 **** addi a6, a6, 4 blt a6, a7, 3b ! movi a1, _stack + STACK_SIZE ! /* Uncompress/Relocate the kernel */ # a0: load address --- 146,155 ---- addi a6, a6, 4 blt a6, a7, 3b ! ! movi a5, -16 movi a1, _stack + STACK_SIZE + and a1, a1, a5 ! /* Uncompress the kernel */ # a0: load address *************** *** 148,186 **** movi a3, __image_load sub a4, a3, a4 ! add a6, a0, a4 # a1 Stack ! # a6(a2) Load address of image ! ## call4 start ! /* for now, copy the kernel */ ! movi a4, _image_end ! movi a3, _image_start ! 4: ! l32i a9, a6, 0 ! l32i a10, a6, 4 ! s32i a9, a3, 0 ! s32i a10, a3, 4 ! l32i a9, a6, 8 ! l32i a10, a6, 12 ! s32i a9, a3, 8 ! s32i a10, a3, 12 ! addi a3, a3, 16 ! addi a6, a6, 16 ! blt a3, a4, 4b ! /* jump to the kernel */ ! /* 28feb2003 -- jn ! * we just copied the kernel, it might be wise ! * at this point to flush the caches, no? ! */ dcache_writeback_all a5, a6 icache_invalidate_all a5, a6 - - /* movi a2, _param_start */ movi a5, __start movi a3, boot_initrd_start --- 159,191 ---- movi a3, __image_load sub a4, a3, a4 ! add a8, a0, a4 # a1 Stack ! # a8(a4) Load address of the image ! movi a6, _image_start ! movi a10, _image_end ! movi a7, 0x1000000 ! sub a10, a10, a6 ! movi a9, complen ! s32i a10, a9, 0 ! movi a0, 0 ! # a6 destination ! # a7 maximum size of destination ! # a8 source ! # a9 ptr to length + .extern gunzip + call4 gunzip + + /* jump to the kernel */ ! #if XCHAL_DCACHE_IS_WRITEBACK dcache_writeback_all a5, a6 + #endif icache_invalidate_all a5, a6 movi a5, __start movi a3, boot_initrd_start *************** *** 198,203 **** --- 203,220 ---- jx a0 + .align 16 + .data + .globl avail_ram + avail_ram: + .long _heap + .globl end_avail + end_avail: + .long _heap + HEAP_SIZE + .comm _stack, STACK_SIZE .comm _heap, HEAP_SIZE + + .globl end_avail + .comm complen, 4 .end literal_prefix |