0455f1f44744ded15b374ef3babf39a610dc1b76
[openwrt/openwrt.git] / target / linux / etrax / patches / 100-compile_fixes.patch
1 Index: linux-2.6.25.4/arch/cris/arch-v10/boot/Makefile
2 ===================================================================
3 --- linux-2.6.25.4.orig/arch/cris/arch-v10/boot/Makefile
4 +++ linux-2.6.25.4/arch/cris/arch-v10/boot/Makefile
5 @@ -2,10 +2,10 @@
6 # arch/cris/arch-v10/boot/Makefile
7 #
8
9 -OBJCOPY = objcopy-cris
10 +OBJCOPY = /usr/local/cris/objcopy-cris
11 OBJCOPYFLAGS = -O binary --remove-section=.bss
12
13 -subdir- := compressed rescue
14 +subdir- := compressed
15 targets := Image
16
17 $(obj)/Image: vmlinux FORCE
18 @@ -14,7 +14,6 @@ $(obj)/Image: vmlinux FORCE
19
20 $(obj)/compressed/vmlinux: $(obj)/Image FORCE
21 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
22 - $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
23
24 $(obj)/zImage: $(obj)/compressed/vmlinux
25 @cp $< $@
26 Index: linux-2.6.25.4/arch/cris/arch-v10/boot/compressed/Makefile
27 ===================================================================
28 --- linux-2.6.25.4.orig/arch/cris/arch-v10/boot/compressed/Makefile
29 +++ linux-2.6.25.4/arch/cris/arch-v10/boot/compressed/Makefile
30 @@ -2,12 +2,11 @@
31 # arch/cris/arch-v10/boot/compressed/Makefile
32 #
33
34 -CC = gcc-cris -melf $(LINUXINCLUDE)
35 ccflags-y += -O2
36 -LD = ld-cris
37 +LD=/usr/local/cris/ld-cris
38 ldflags-y += -T $(obj)/decompress.ld
39 OBJECTS = $(obj)/head.o $(obj)/misc.o
40 -OBJCOPY = objcopy-cris
41 +OBJCOPY = /usr/local/cris/objcopy-cris
42 OBJCOPYFLAGS = -O binary --remove-section=.bss
43
44 quiet_cmd_image = BUILD $@
45 @@ -22,10 +21,10 @@ $(obj)/decompress.bin: $(obj)/decompress
46 $(call if_changed,objcopy)
47
48 $(obj)/head.o: $(obj)/head.S .config
49 - @$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
50 + /usr/local/cris/gcc-cris -melf $(LINUXINCLUDE) -D__ASSEMBLY__ -traditional -c $< -o $@
51
52 $(obj)/misc.o: $(obj)/misc.c .config
53 - @$(CC) -D__KERNEL__ -c $< -o $@
54 + /usr/local/cris/gcc-cris -melf $(LINUXINCLUDE) -D__KERNEL__ -c $< -o $@
55
56 $(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE
57 $(call if_changed,image)
58 Index: linux-2.6.25.4/arch/cris/arch-v10/boot/compressed/misc.c
59 ===================================================================
60 --- linux-2.6.25.4.orig/arch/cris/arch-v10/boot/compressed/misc.c
61 +++ linux-2.6.25.4/arch/cris/arch-v10/boot/compressed/misc.c
62 @@ -5,7 +5,7 @@
63 * adapted for Linux.
64 *
65 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
66 - * puts by Nick Holloway 1993, better puts by Martin Mares 1995
67 + * putstr by Nick Holloway 1993, better putstr by Martin Mares 1995
68 * adaptation for Linux/CRIS Axis Communications AB, 1999
69 *
70 */
71 @@ -99,7 +99,7 @@ static void error(char *m);
72 static void gzip_mark(void **);
73 static void gzip_release(void **);
74
75 -static void puts(const char *);
76 +static void putstr(const char *);
77
78 /* the "heap" is put directly after the BSS ends, at end */
79
80 @@ -139,7 +139,7 @@ static void gzip_release(void **ptr)
81 /* decompressor info and error messages to serial console */
82
83 static void
84 -puts(const char *s)
85 +putstr(const char *s)
86 {
87 #ifndef CONFIG_ETRAX_DEBUG_PORT_NULL
88 while(*s) {
89 @@ -209,9 +209,9 @@ flush_window()
90 static void
91 error(char *x)
92 {
93 - puts("\n\n");
94 - puts(x);
95 - puts("\n\n -- System halted\n");
96 + putstr("\n\n");
97 + putstr(x);
98 + putstr("\n\n -- System halted\n");
99
100 while(1); /* Halt */
101 }
102 @@ -257,14 +257,7 @@ decompress_kernel()
103
104 makecrc();
105
106 - __asm__ volatile ("move vr,%0" : "=rm" (revision));
107 - if (revision < 10)
108 - {
109 - puts("You need an ETRAX 100LX to run linux 2.6\n");
110 - while(1);
111 - }
112 -
113 - puts("Uncompressing Linux...\n");
114 + putstr("Uncompressing Linux...\n");
115 gunzip();
116 - puts("Done. Now booting the kernel.\n");
117 + putstr("Done. Now booting the kernel.\n");
118 }
119 Index: linux-2.6.25.4/arch/cris/arch-v10/mm/init.c
120 ===================================================================
121 --- linux-2.6.25.4.orig/arch/cris/arch-v10/mm/init.c
122 +++ linux-2.6.25.4/arch/cris/arch-v10/mm/init.c
123 @@ -184,6 +184,9 @@ paging_init(void)
124
125 free_area_init_node(0, &contig_page_data, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0);
126 }
127 +void free_initrd_mem(unsigned long start, unsigned long end)
128 +{
129 +}
130
131 /* Initialize remaps of some I/O-ports. It is important that this
132 * is called before any driver is initialized.