1 --- a/arch/cris/arch-v10/boot/Makefile
2 +++ b/arch/cris/arch-v10/boot/Makefile
4 # arch/cris/arch-v10/boot/Makefile
7 -OBJCOPY = objcopy-cris
8 OBJCOPYFLAGS = -O binary --remove-section=.bss
10 subdir- := compressed rescue
13 $(obj)/compressed/vmlinux: $(obj)/Image FORCE
14 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
15 - $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
17 $(obj)/zImage: $(obj)/compressed/vmlinux
19 --- a/arch/cris/arch-v10/boot/compressed/Makefile
20 +++ b/arch/cris/arch-v10/boot/compressed/Makefile
22 # arch/cris/arch-v10/boot/compressed/Makefile
25 -CC = gcc-cris -melf $(LINUXINCLUDE)
28 +LD = $(CROSS_COMPILE)ld -m criself
29 ldflags-y += -T $(obj)/decompress.ld
30 OBJECTS = $(obj)/head.o $(obj)/misc.o
31 -OBJCOPY = objcopy-cris
32 OBJCOPYFLAGS = -O binary --remove-section=.bss
34 quiet_cmd_image = BUILD $@
36 $(call if_changed,objcopy)
38 $(obj)/head.o: $(obj)/head.S .config
39 - @$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
40 + @$(CC) -D__ASSEMBLY__ -traditional -Wa,--em=criself -c $< -o $@
42 $(obj)/misc.o: $(obj)/misc.c .config
43 - @$(CC) -D__KERNEL__ -c $< -o $@
44 + @$(CC) -D__KERNEL__ -Wa,--em=criself -c $< -o $@
46 $(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE
47 $(call if_changed,image)
48 --- a/arch/cris/arch-v10/boot/compressed/misc.c
49 +++ b/arch/cris/arch-v10/boot/compressed/misc.c
53 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
54 - * puts by Nick Holloway 1993, better puts by Martin Mares 1995
55 + * putstr by Nick Holloway 1993, better putstr by Martin Mares 1995
56 * adaptation for Linux/CRIS Axis Communications AB, 1999
60 static void gzip_mark(void **);
61 static void gzip_release(void **);
63 -static void puts(const char *);
64 +static void putstr(const char *);
66 /* the "heap" is put directly after the BSS ends, at end */
69 -static long free_mem_ptr = (long)&end;
71 +static long free_mem_ptr = (long)&_end;
73 #include "../../../../../lib/inflate.c"
76 /* decompressor info and error messages to serial console */
80 +putstr(const char *s)
82 #ifndef CONFIG_ETRAX_DEBUG_PORT_NULL
90 - puts("\n\n -- System halted\n");
93 + putstr("\n\n -- System halted\n");
101 - __asm__ volatile ("move vr,%0" : "=rm" (revision));
104 - puts("You need an ETRAX 100LX to run linux 2.6\n");
108 - puts("Uncompressing Linux...\n");
109 + putstr("Uncompressing Linux...\n");
111 - puts("Done. Now booting the kernel.\n");
112 + putstr("Done. Now booting the kernel.\n");
114 --- a/arch/cris/arch-v10/mm/init.c
115 +++ b/arch/cris/arch-v10/mm/init.c
118 free_area_init_node(0, &contig_page_data, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0);
120 +void free_initrd_mem(unsigned long start, unsigned long end)
124 /* Initialize remaps of some I/O-ports. It is important that this
125 * is called before any driver is initialized.
126 --- a/arch/cris/arch-v10/boot/compressed/head.S
127 +++ b/arch/cris/arch-v10/boot/compressed/head.S
130 #define ASSEMBLER_MACROS_ONLY
131 #include <asm/arch/sv_addr_ag.h>
132 +#include <linux/autoconf.h>
134 #define RAM_INIT_MAGIC 0x56902387
135 #define COMMAND_LINE_MAGIC 0x87109563
146 ;; We need to initialze DRAM registers before we start using the DRAM
148 - cmp.d RAM_INIT_MAGIC, r8 ; Already initialized?
149 + cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized?
150 beq dram_init_finished
155 ;; Initiate the PA and PB ports
157 - move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0
158 - move.b r0, [R_PORT_PA_DATA]
159 + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0
160 + move.b $r0, [R_PORT_PA_DATA]
162 - move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0
163 - move.b r0, [R_PORT_PA_DIR]
164 + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0
165 + move.b $r0, [R_PORT_PA_DIR]
167 - move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0
168 - move.b r0, [R_PORT_PB_DATA]
169 + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0
170 + move.b $r0, [R_PORT_PB_DATA]
172 - move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, r0
173 - move.b r0, [R_PORT_PB_DIR]
174 + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, $r0
175 + move.b $r0, [R_PORT_PB_DIR]
177 ;; Setup the stack to a suitably high address.
178 ;; We assume 8 MB is the minimum DRAM in an eLinux
179 ;; product and put the sp at the top for now.
181 - move.d 0x40800000, sp
182 + move.d 0x40800000, $sp
184 ;; Figure out where the compressed piggyback image is
185 ;; in the flash (since we wont try to copy it to DRAM
186 ;; before unpacking). It is at _edata, but in flash.
187 ;; Use (_edata - basse) as offset to the current PC.
189 -basse: move.d pc, r5
190 - and.d 0x7fffffff, r5 ; strip any non-cache bit
191 - subq 2, r5 ; compensate for the move.d pc instr
192 - move.d r5, r0 ; save for later - flash address of 'basse'
194 - sub.d basse, r5 ; r5 = flash address of '_edata'
195 +basse: move.d $pc, $r5
196 + and.d 0x7fffffff, $r5 ; strip any non-cache bit
197 + subq 2, $r5 ; compensate for the move.d pc instr
198 + move.d $r5, $r0 ; save for later - flash address of 'basse'
200 + sub.d basse, $r5 ; r5 = flash address of '_edata'
202 ;; Copy text+data to DRAM
204 - move.d basse, r1 ; destination
205 - move.d _edata, r2 ; end destination
209 + move.d basse, $r1 ; destination
210 + move.d _edata, $r2 ; end destination
211 +1: move.w [$r0+], $r3
217 - move.d r5, [_input_data] ; for the decompressor
218 + move.d $r5, [input_data] ; for the decompressor
221 ;; Clear the decompressors BSS (between _edata and _end)
231 +1: move.w $r0, [$r1+]
236 ;; Save command line magic and address.
237 - move.d _cmd_line_magic, $r12
238 + move.d cmd_line_magic, $r12
240 - move.d _cmd_line_addr, $r12
241 + move.d cmd_line_addr, $r12
244 ;; Do the decompression and save compressed size in _inptr
246 - jsr _decompress_kernel
247 + jsr decompress_kernel
249 ;; Put start address of root partition in r9 so the kernel can use it
250 ;; when mounting from flash
252 - move.d [_input_data], r9 ; flash address of compressed kernel
253 - add.d [_inptr], r9 ; size of compressed kernel
254 + move.d [input_data], $r9 ; flash address of compressed kernel
255 + add.d [inptr], $r9 ; size of compressed kernel
257 ;; Restore command line magic and address.
258 - move.d _cmd_line_magic, $r10
259 + move.d cmd_line_magic, $r10
261 - move.d _cmd_line_addr, $r11
262 + move.d cmd_line_addr, $r11
265 ;; Enter the decompressed kernel
266 - move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized
267 + move.d RAM_INIT_MAGIC, $r8 ; Tell kernel that DRAM is initialized
268 jump 0x40004000 ; kernel is linked to this address
274 .dword 0 ; used by the decompressor
281 #include "../../lib/hw_settings.S"
282 --- a/arch/cris/arch-v10/boot/compressed/decompress.ld
283 +++ b/arch/cris/arch-v10/boot/compressed/decompress.ld
285 -OUTPUT_FORMAT(elf32-us-cris)
286 +OUTPUT_FORMAT(elf32-cris)