1 --- a/arch/cris/Makefile
2 +++ b/arch/cris/Makefile
3 @@ -33,7 +33,7 @@ endif
5 LD = $(CROSS_COMPILE)ld -mcrislinux
7 -OBJCOPYFLAGS := -O binary -R .note -R .comment -S
8 +OBJCOPYFLAGS := -O binary -R .bss -R .note -R .note.gnu.build-id -R .comment -S
10 CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
12 --- a/arch/cris/arch-v10/boot/Makefile
13 +++ b/arch/cris/arch-v10/boot/Makefile
15 # arch/cris/arch-v10/boot/Makefile
18 -OBJCOPY = objcopy-cris
19 -OBJCOPYFLAGS = -O binary --remove-section=.bss
21 subdir- := compressed rescue
24 @@ -14,7 +11,6 @@ $(obj)/Image: vmlinux FORCE
26 $(obj)/compressed/vmlinux: $(obj)/Image FORCE
27 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
28 - $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
30 $(obj)/zImage: $(obj)/compressed/vmlinux
32 --- a/arch/cris/arch-v10/boot/compressed/Makefile
33 +++ b/arch/cris/arch-v10/boot/compressed/Makefile
35 # arch/cris/arch-v10/boot/compressed/Makefile
38 -CC = gcc-cris -melf $(LINUXINCLUDE)
41 ldflags-y += -T $(obj)/decompress.ld
42 OBJECTS = $(obj)/head.o $(obj)/misc.o
43 -OBJCOPY = objcopy-cris
44 -OBJCOPYFLAGS = -O binary --remove-section=.bss
46 quiet_cmd_image = BUILD $@
47 cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@
48 @@ -22,10 +18,10 @@ $(obj)/decompress.bin: $(obj)/decompress
49 $(call if_changed,objcopy)
51 $(obj)/head.o: $(obj)/head.S .config
52 - @$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
53 + @$(CC) -Iinclude -D__ASSEMBLY__ -traditional -Wa,--em=criself -c $< -o $@
55 $(obj)/misc.o: $(obj)/misc.c .config
56 - @$(CC) -D__KERNEL__ -c $< -o $@
57 + @$(CC) -Iinclude -D__KERNEL__ -Wa,--em=criself -c $< -o $@
59 $(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE
60 $(call if_changed,image)
61 --- a/arch/cris/arch-v10/boot/compressed/decompress.ld
62 +++ b/arch/cris/arch-v10/boot/compressed/decompress.ld
64 -OUTPUT_FORMAT(elf32-us-cris)
65 +OUTPUT_FORMAT(elf32-cris)
69 --- a/arch/cris/arch-v10/boot/compressed/head.S
70 +++ b/arch/cris/arch-v10/boot/compressed/head.S
73 #define ASSEMBLER_MACROS_ONLY
74 #include <asm/arch/sv_addr_ag.h>
75 +#include <linux/autoconf.h>
77 #define RAM_INIT_MAGIC 0x56902387
78 #define COMMAND_LINE_MAGIC 0x87109563
89 ;; We need to initialze DRAM registers before we start using the DRAM
91 - cmp.d RAM_INIT_MAGIC, r8 ; Already initialized?
92 + cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized?
93 beq dram_init_finished
96 @@ -36,91 +37,91 @@ dram_init_finished:
98 ;; Initiate the PA and PB ports
100 - move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0
101 - move.b r0, [R_PORT_PA_DATA]
102 + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0
103 + move.b $r0, [R_PORT_PA_DATA]
105 - move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0
106 - move.b r0, [R_PORT_PA_DIR]
107 + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0
108 + move.b $r0, [R_PORT_PA_DIR]
110 - move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0
111 - move.b r0, [R_PORT_PB_DATA]
112 + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0
113 + move.b $r0, [R_PORT_PB_DATA]
115 - move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, r0
116 - move.b r0, [R_PORT_PB_DIR]
117 + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, $r0
118 + move.b $r0, [R_PORT_PB_DIR]
120 ;; Setup the stack to a suitably high address.
121 ;; We assume 8 MB is the minimum DRAM in an eLinux
122 ;; product and put the sp at the top for now.
124 - move.d 0x40800000, sp
125 + move.d 0x40800000, $sp
127 ;; Figure out where the compressed piggyback image is
128 ;; in the flash (since we wont try to copy it to DRAM
129 ;; before unpacking). It is at _edata, but in flash.
130 ;; Use (_edata - basse) as offset to the current PC.
132 -basse: move.d pc, r5
133 - and.d 0x7fffffff, r5 ; strip any non-cache bit
134 - subq 2, r5 ; compensate for the move.d pc instr
135 - move.d r5, r0 ; save for later - flash address of 'basse'
137 - sub.d basse, r5 ; r5 = flash address of '_edata'
138 +basse: move.d $pc, $r5
139 + and.d 0x7fffffff, $r5 ; strip any non-cache bit
140 + subq 2, $r5 ; compensate for the move.d pc instr
141 + move.d $r5, $r0 ; save for later - flash address of 'basse'
143 + sub.d basse, $r5 ; r5 = flash address of '_edata'
145 ;; Copy text+data to DRAM
147 - move.d basse, r1 ; destination
148 - move.d _edata, r2 ; end destination
152 + move.d basse, $r1 ; destination
153 + move.d _edata, $r2 ; end destination
154 +1: move.w [$r0+], $r3
160 - move.d r5, [_input_data] ; for the decompressor
161 + move.d $r5, [input_data] ; for the decompressor
164 ;; Clear the decompressors BSS (between _edata and _end)
174 +1: move.w $r0, [$r1+]
179 ;; Save command line magic and address.
180 - move.d _cmd_line_magic, $r12
181 + move.d cmd_line_magic, $r12
183 - move.d _cmd_line_addr, $r12
184 + move.d cmd_line_addr, $r12
187 ;; Do the decompression and save compressed size in _inptr
189 - jsr _decompress_kernel
190 + jsr decompress_kernel
192 ;; Put start address of root partition in r9 so the kernel can use it
193 ;; when mounting from flash
195 - move.d [_input_data], r9 ; flash address of compressed kernel
196 - add.d [_inptr], r9 ; size of compressed kernel
197 + move.d [input_data], $r9 ; flash address of compressed kernel
198 + add.d [inptr], $r9 ; size of compressed kernel
200 ;; Restore command line magic and address.
201 - move.d _cmd_line_magic, $r10
202 + move.d cmd_line_magic, $r10
204 - move.d _cmd_line_addr, $r11
205 + move.d cmd_line_addr, $r11
208 ;; Enter the decompressed kernel
209 - move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized
210 + move.d RAM_INIT_MAGIC, $r8 ; Tell kernel that DRAM is initialized
211 jump 0x40004000 ; kernel is linked to this address
217 .dword 0 ; used by the decompressor
224 #include "../../lib/hw_settings.S"
225 --- a/arch/cris/arch-v10/boot/compressed/misc.c
226 +++ b/arch/cris/arch-v10/boot/compressed/misc.c
230 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
231 - * puts by Nick Holloway 1993, better puts by Martin Mares 1995
232 + * putstr by Nick Holloway 1993, better putstr by Martin Mares 1995
233 * adaptation for Linux/CRIS Axis Communications AB, 1999
236 @@ -99,12 +99,12 @@ static void error(char *m);
237 static void gzip_mark(void **);
238 static void gzip_release(void **);
240 -static void puts(const char *);
241 +static void putstr(const char *);
243 /* the "heap" is put directly after the BSS ends, at end */
246 -static long free_mem_ptr = (long)&end;
248 +static long free_mem_ptr = (long)&_end;
250 #include "../../../../../lib/inflate.c"
252 @@ -139,7 +139,7 @@ static void gzip_release(void **ptr)
253 /* decompressor info and error messages to serial console */
257 +putstr(const char *s)
259 #ifndef CONFIG_ETRAX_DEBUG_PORT_NULL
261 @@ -209,9 +209,9 @@ flush_window()
267 - puts("\n\n -- System halted\n");
270 + putstr("\n\n -- System halted\n");
274 @@ -257,14 +257,7 @@ decompress_kernel()
278 - __asm__ volatile ("move vr,%0" : "=rm" (revision));
281 - puts("You need an ETRAX 100LX to run linux 2.6\n");
285 - puts("Uncompressing Linux...\n");
286 + putstr("Uncompressing Linux...\n");
288 - puts("Done. Now booting the kernel.\n");
289 + putstr("Done. Now booting the kernel.\n");
291 --- a/arch/cris/arch-v10/mm/init.c
292 +++ b/arch/cris/arch-v10/mm/init.c
293 @@ -184,6 +184,9 @@ paging_init(void)
295 free_area_init_node(0, &contig_page_data, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0);
297 +void free_initrd_mem(unsigned long start, unsigned long end)
301 /* Initialize remaps of some I/O-ports. It is important that this
302 * is called before any driver is initialized.