X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/2b14ffa0114f67068778e18cb35f448b762f0730..e1600d34b08ab1844be0440e8ffe6afc8ee46ea1:/target/linux/etrax/patches/100-compile_fixes.patch?ds=sidebyside diff --git a/target/linux/etrax/patches/100-compile_fixes.patch b/target/linux/etrax/patches/100-compile_fixes.patch index 18c93d678..59d47c683 100644 --- a/target/linux/etrax/patches/100-compile_fixes.patch +++ b/target/linux/etrax/patches/100-compile_fixes.patch @@ -1,46 +1,29 @@ -Index: linux-2.6.25.1/arch/cris/mm/init.c -=================================================================== ---- linux-2.6.25.1.orig/arch/cris/mm/init.c 2008-05-03 09:53:53.000000000 +0100 -+++ linux-2.6.25.1/arch/cris/mm/init.c 2008-05-03 09:54:05.000000000 +0100 -@@ -112,3 +112,7 @@ - printk (KERN_INFO "Freeing unused kernel memory: %luk freed\n", - (unsigned long)((&__init_end - &__init_begin) >> 10)); - } -+ -+void free_initrd_mem(unsigned long start, unsigned long end) -+{ -+} -Index: linux-2.6.25.1/arch/cris/boot/compressed/Makefile -=================================================================== ---- linux-2.6.25.1.orig/arch/cris/boot/compressed/Makefile 2008-05-03 10:00:53.000000000 +0100 -+++ linux-2.6.25.1/arch/cris/boot/compressed/Makefile 2008-05-03 10:01:12.000000000 +0100 -@@ -7,7 +7,7 @@ - LD = ld-cris - ldflags-y += -T $(obj)/decompress.ld - OBJECTS = $(obj)/head.o $(obj)/misc.o --OBJCOPY = objcopy-cris -+OBJCOPY = /usr/local/cris/objcopy-cris - OBJCOPYFLAGS = -O binary --remove-section=.bss +diff -urN linux-2.6.25.7/arch/cris/Makefile linux-2.6.25.7.cris/arch/cris/Makefile +--- linux-2.6.25.7/arch/cris/Makefile 2008-06-16 22:24:36.000000000 +0200 ++++ linux-2.6.25.7.cris/arch/cris/Makefile 2008-06-24 13:22:48.000000000 +0200 +@@ -33,7 +33,7 @@ - quiet_cmd_image = BUILD $@ -Index: linux-2.6.25.1/arch/cris/boot/Makefile -=================================================================== ---- linux-2.6.25.1.orig/arch/cris/boot/Makefile 2008-04-17 03:49:44.000000000 +0100 -+++ linux-2.6.25.1/arch/cris/boot/Makefile 2008-05-03 10:05:56.000000000 +0100 -@@ -2,10 +2,10 @@ + LD = $(CROSS_COMPILE)ld -mcrislinux + +-OBJCOPYFLAGS := -O binary -R .note -R .comment -S ++OBJCOPYFLAGS := -O binary -R .bss -R .note -R .note.gnu.build-id -R .comment -S + + CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE) + +diff -urN linux-2.6.25.7/arch/cris/arch-v10/boot/Makefile linux-2.6.25.7.cris/arch/cris/arch-v10/boot/Makefile +--- linux-2.6.25.7/arch/cris/arch-v10/boot/Makefile 2008-06-16 22:24:36.000000000 +0200 ++++ linux-2.6.25.7.cris/arch/cris/arch-v10/boot/Makefile 2008-06-24 13:23:03.000000000 +0200 +@@ -2,9 +2,6 @@ # arch/cris/arch-v10/boot/Makefile # -OBJCOPY = objcopy-cris -+OBJCOPY = /usr/local/cris/objcopy-cris - OBJCOPYFLAGS = -O binary --remove-section=.bss - --subdir- := compressed rescue -+subdir- := compressed +-OBJCOPYFLAGS = -O binary --remove-section=.bss +- + subdir- := compressed rescue targets := Image - $(obj)/Image: vmlinux FORCE -@@ -14,7 +14,6 @@ +@@ -14,7 +11,6 @@ $(obj)/compressed/vmlinux: $(obj)/Image FORCE $(Q)$(MAKE) $(build)=$(obj)/compressed $@ @@ -48,38 +31,205 @@ Index: linux-2.6.25.1/arch/cris/boot/Makefile $(obj)/zImage: $(obj)/compressed/vmlinux @cp $< $@ -Index: linux-2.6.25.1/arch/cris/boot/compressed/Makefile -=================================================================== ---- linux-2.6.25.1.orig/arch/cris/boot/compressed/Makefile 2008-05-03 10:01:12.000000000 +0100 -+++ linux-2.6.25.1/arch/cris/boot/compressed/Makefile 2008-05-03 16:29:55.000000000 +0100 -@@ -2,9 +2,8 @@ +diff -urN linux-2.6.25.7/arch/cris/arch-v10/boot/compressed/Makefile linux-2.6.25.7.cris/arch/cris/arch-v10/boot/compressed/Makefile +--- linux-2.6.25.7/arch/cris/arch-v10/boot/compressed/Makefile 2008-06-16 22:24:36.000000000 +0200 ++++ linux-2.6.25.7.cris/arch/cris/arch-v10/boot/compressed/Makefile 2008-06-24 13:23:14.000000000 +0200 +@@ -2,13 +2,9 @@ # arch/cris/arch-v10/boot/compressed/Makefile # -CC = gcc-cris -melf $(LINUXINCLUDE) ccflags-y += -O2 -LD = ld-cris -+LD=/usr/local/cris/ld-cris ldflags-y += -T $(obj)/decompress.ld OBJECTS = $(obj)/head.o $(obj)/misc.o - OBJCOPY = /usr/local/cris/objcopy-cris -@@ -22,10 +21,10 @@ +-OBJCOPY = objcopy-cris +-OBJCOPYFLAGS = -O binary --remove-section=.bss + + quiet_cmd_image = BUILD $@ + cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@ +@@ -22,10 +18,10 @@ $(call if_changed,objcopy) $(obj)/head.o: $(obj)/head.S .config - @$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@ -+ /usr/local/cris/gcc-cris -melf $(LINUXINCLUDE) -D__ASSEMBLY__ -traditional -c $< -o $@ ++ @$(CC) -Iinclude -D__ASSEMBLY__ -traditional -Wa,--em=criself -c $< -o $@ $(obj)/misc.o: $(obj)/misc.c .config - @$(CC) -D__KERNEL__ -c $< -o $@ -+ /usr/local/cris/gcc-cris -melf $(LINUXINCLUDE) -D__KERNEL__ -c $< -o $@ ++ @$(CC) -Iinclude -D__KERNEL__ -Wa,--em=criself -c $< -o $@ $(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE $(call if_changed,image) -Index: linux-2.6.25.1/arch/cris/boot/compressed/misc.c -=================================================================== ---- linux-2.6.25.1.orig/arch/cris/boot/compressed/misc.c 2008-05-03 16:22:44.000000000 +0100 -+++ linux-2.6.25.1/arch/cris/boot/compressed/misc.c 2008-05-03 16:23:26.000000000 +0100 +diff -urN linux-2.6.25.7/arch/cris/arch-v10/boot/compressed/decompress.ld linux-2.6.25.7.cris/arch/cris/arch-v10/boot/compressed/decompress.ld +--- linux-2.6.25.7/arch/cris/arch-v10/boot/compressed/decompress.ld 2008-06-16 22:24:36.000000000 +0200 ++++ linux-2.6.25.7.cris/arch/cris/arch-v10/boot/compressed/decompress.ld 2008-06-24 12:57:25.000000000 +0200 +@@ -1,4 +1,4 @@ +-OUTPUT_FORMAT(elf32-us-cris) ++OUTPUT_FORMAT(elf32-cris) + + MEMORY + { +diff -urN linux-2.6.25.7/arch/cris/arch-v10/boot/compressed/head.S linux-2.6.25.7.cris/arch/cris/arch-v10/boot/compressed/head.S +--- linux-2.6.25.7/arch/cris/arch-v10/boot/compressed/head.S 2008-06-16 22:24:36.000000000 +0200 ++++ linux-2.6.25.7.cris/arch/cris/arch-v10/boot/compressed/head.S 2008-06-24 13:24:50.000000000 +0200 +@@ -10,13 +10,14 @@ + + #define ASSEMBLER_MACROS_ONLY + #include ++#include + + #define RAM_INIT_MAGIC 0x56902387 + #define COMMAND_LINE_MAGIC 0x87109563 + + ;; Exported symbols + +- .globl _input_data ++ .globl input_data + + + .text +@@ -26,7 +27,7 @@ + + ;; We need to initialze DRAM registers before we start using the DRAM + +- cmp.d RAM_INIT_MAGIC, r8 ; Already initialized? ++ cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized? + beq dram_init_finished + nop + +@@ -36,91 +37,91 @@ + + ;; Initiate the PA and PB ports + +- move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0 +- move.b r0, [R_PORT_PA_DATA] ++ move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0 ++ move.b $r0, [R_PORT_PA_DATA] + +- move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0 +- move.b r0, [R_PORT_PA_DIR] ++ move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0 ++ move.b $r0, [R_PORT_PA_DIR] + +- move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0 +- move.b r0, [R_PORT_PB_DATA] ++ move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0 ++ move.b $r0, [R_PORT_PB_DATA] + +- move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, r0 +- move.b r0, [R_PORT_PB_DIR] ++ 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 + ;; product and put the sp at the top for now. + +- move.d 0x40800000, sp ++ move.d 0x40800000, $sp + + ;; Figure out where the compressed piggyback image is + ;; in the flash (since we wont try to copy it to DRAM + ;; before unpacking). It is at _edata, but in flash. + ;; Use (_edata - basse) as offset to the current PC. + +-basse: move.d pc, r5 +- and.d 0x7fffffff, r5 ; strip any non-cache bit +- subq 2, r5 ; compensate for the move.d pc instr +- move.d r5, r0 ; save for later - flash address of 'basse' +- add.d _edata, r5 +- sub.d basse, r5 ; r5 = flash address of '_edata' ++basse: move.d $pc, $r5 ++ and.d 0x7fffffff, $r5 ; strip any non-cache bit ++ subq 2, $r5 ; compensate for the move.d pc instr ++ move.d $r5, $r0 ; save for later - flash address of 'basse' ++ add.d _edata, $r5 ++ sub.d basse, $r5 ; r5 = flash address of '_edata' + + ;; Copy text+data to DRAM + +- move.d basse, r1 ; destination +- move.d _edata, r2 ; end destination +-1: move.w [r0+], r3 +- move.w r3, [r1+] +- cmp.d r2, r1 ++ move.d basse, $r1 ; destination ++ move.d _edata, $r2 ; end destination ++1: move.w [$r0+], $r3 ++ move.w $r3, [$r1+] ++ cmp.d $r2, $r1 + bcs 1b + nop + +- move.d r5, [_input_data] ; for the decompressor ++ move.d $r5, [input_data] ; for the decompressor + + + ;; Clear the decompressors BSS (between _edata and _end) + +- moveq 0, r0 +- move.d _edata, r1 +- move.d _end, r2 +-1: move.w r0, [r1+] +- cmp.d r2, r1 ++ moveq 0, $r0 ++ move.d _edata, $r1 ++ move.d _end, $r2 ++1: move.w $r0, [$r1+] ++ cmp.d $r2, $r1 + bcs 1b + nop + + ;; Save command line magic and address. +- move.d _cmd_line_magic, $r12 ++ move.d cmd_line_magic, $r12 + move.d $r10, [$r12] +- move.d _cmd_line_addr, $r12 ++ move.d cmd_line_addr, $r12 + move.d $r11, [$r12] + + ;; Do the decompression and save compressed size in _inptr + +- jsr _decompress_kernel ++ 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 ++ move.d [input_data], $r9 ; flash address of compressed kernel ++ add.d [inptr], $r9 ; size of compressed kernel + + ;; Restore command line magic and address. +- move.d _cmd_line_magic, $r10 ++ move.d cmd_line_magic, $r10 + move.d [$r10], $r10 +- move.d _cmd_line_addr, $r11 ++ move.d cmd_line_addr, $r11 + move.d [$r11], $r11 + + ;; Enter the decompressed kernel +- move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized ++ move.d RAM_INIT_MAGIC, $r8 ; Tell kernel that DRAM is initialized + jump 0x40004000 ; kernel is linked to this address + + .data + +-_input_data: ++input_data: + .dword 0 ; used by the decompressor +-_cmd_line_magic: ++cmd_line_magic: + .dword 0 +-_cmd_line_addr: ++cmd_line_addr: + .dword 0 + #include "../../lib/hw_settings.S" +diff -urN linux-2.6.25.7/arch/cris/arch-v10/boot/compressed/misc.c linux-2.6.25.7.cris/arch/cris/arch-v10/boot/compressed/misc.c +--- linux-2.6.25.7/arch/cris/arch-v10/boot/compressed/misc.c 2008-06-16 22:24:36.000000000 +0200 ++++ linux-2.6.25.7.cris/arch/cris/arch-v10/boot/compressed/misc.c 2008-06-24 12:57:25.000000000 +0200 @@ -5,7 +5,7 @@ * adapted for Linux. * @@ -89,7 +239,7 @@ Index: linux-2.6.25.1/arch/cris/boot/compressed/misc.c * adaptation for Linux/CRIS Axis Communications AB, 1999 * */ -@@ -99,7 +99,7 @@ +@@ -99,12 +99,12 @@ static void gzip_mark(void **); static void gzip_release(void **); @@ -98,6 +248,13 @@ Index: linux-2.6.25.1/arch/cris/boot/compressed/misc.c /* the "heap" is put directly after the BSS ends, at end */ +-extern int end; +-static long free_mem_ptr = (long)&end; ++extern int _end; ++static long free_mem_ptr = (long)&_end; + + #include "../../../../../lib/inflate.c" + @@ -139,7 +139,7 @@ /* decompressor info and error messages to serial console */ @@ -120,7 +277,7 @@ Index: linux-2.6.25.1/arch/cris/boot/compressed/misc.c while(1); /* Halt */ } -@@ -25.17,14 +25.17,7 @@ +@@ -257,14 +257,7 @@ makecrc(); @@ -137,3 +294,16 @@ Index: linux-2.6.25.1/arch/cris/boot/compressed/misc.c - puts("Done. Now booting the kernel.\n"); + putstr("Done. Now booting the kernel.\n"); } +diff -urN linux-2.6.25.7/arch/cris/arch-v10/mm/init.c linux-2.6.25.7.cris/arch/cris/arch-v10/mm/init.c +--- linux-2.6.25.7/arch/cris/arch-v10/mm/init.c 2008-06-16 22:24:36.000000000 +0200 ++++ linux-2.6.25.7.cris/arch/cris/arch-v10/mm/init.c 2008-06-24 12:57:25.000000000 +0200 +@@ -184,6 +184,9 @@ + + free_area_init_node(0, &contig_page_data, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0); + } ++void free_initrd_mem(unsigned long start, unsigned long end) ++{ ++} + + /* Initialize remaps of some I/O-ports. It is important that this + * is called before any driver is initialized.