1 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/Makefile linux-2.6.19.2/arch/cris/arch-v10/boot/Makefile
2 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/Makefile 2007-05-28 16:28:34.000000000 +0200
3 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/Makefile 2007-05-28 17:24:26.000000000 +0200
5 OBJCOPY = /usr/local/cris/objcopy-cris
6 OBJCOPYFLAGS = -O binary --remove-section=.bss
8 -subdir- := compressed rescue
12 $(obj)/Image: vmlinux FORCE
15 $(obj)/compressed/vmlinux: $(obj)/Image FORCE
16 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
17 - $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
19 $(obj)/zImage: $(obj)/compressed/vmlinux
21 + @cp $(obj)/compressed/vmlinux $(obj)/zImage_custom
22 + @cp $(obj)/compressed/vmlinux_MCM $(obj)/zImage_MCM
23 + @cp $(obj)/compressed/vmlinux_416 $(obj)/zImage_416
24 + @cp $(obj)/compressed/vmlinux_816 $(obj)/zImage_816
25 + @cp $(obj)/compressed/vmlinux_832 $(obj)/zImage_832
26 @echo ' Kernel: $@ is ready'
27 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/Makefile linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/Makefile
28 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/Makefile 2007-05-28 16:28:34.000000000 +0200
29 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/Makefile 2007-05-28 17:03:02.000000000 +0200
32 $(obj)/decompress.o: $(OBJECTS) FORCE
34 + $(LD) $(LDFLAGS) arch/cris/boot/compressed/head_MCM.o arch/cris/boot/compressed/misc.o -o arch/cris/boot/compressed/decompress_MCM.o
35 + $(LD) $(LDFLAGS) arch/cris/boot/compressed/head_416.o arch/cris/boot/compressed/misc.o -o arch/cris/boot/compressed/decompress_416.o
36 + $(LD) $(LDFLAGS) arch/cris/boot/compressed/head_816.o arch/cris/boot/compressed/misc.o -o arch/cris/boot/compressed/decompress_816.o
37 + $(LD) $(LDFLAGS) arch/cris/boot/compressed/head_832.o arch/cris/boot/compressed/misc.o -o arch/cris/boot/compressed/decompress_832.o
39 $(obj)/decompress.bin: $(obj)/decompress.o FORCE
40 $(call if_changed,objcopy)
41 + $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/decompress_MCM.o $(obj)/decompress_MCM.bin
42 + $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/decompress_416.o $(obj)/decompress_416.bin
43 + $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/decompress_816.o $(obj)/decompress_816.bin
44 + $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/decompress_832.o $(obj)/decompress_832.bin
46 +$(obj)/head.o: $(obj)/head.S .config FORCE
47 + /usr/local/cris/gcc-cris -melf -Iinclude -include include/linux/autoconf.h -D__ASSEMBLY__ -traditional -c $< -o $@
48 + /usr/local/cris/gcc-cris -melf -Iinclude -include include/linux/autoconf.h -D__ASSEMBLY__ -traditional -c arch/cris/boot/compressed/head_MCM.S -o arch/cris/boot/compressed/head_MCM.o
49 + /usr/local/cris/gcc-cris -melf -Iinclude -include include/linux/autoconf.h -D__ASSEMBLY__ -traditional -c arch/cris/boot/compressed/head_416.S -o arch/cris/boot/compressed/head_416.o
50 + /usr/local/cris/gcc-cris -melf -Iinclude -include include/linux/autoconf.h -D__ASSEMBLY__ -traditional -c arch/cris/boot/compressed/head_816.S -o arch/cris/boot/compressed/head_816.o
51 + /usr/local/cris/gcc-cris -melf -Iinclude -include include/linux/autoconf.h -D__ASSEMBLY__ -traditional -c arch/cris/boot/compressed/head_832.S -o arch/cris/boot/compressed/head_832.o
53 -$(obj)/head.o: $(obj)/head.S .config
54 - /usr/local/cris/gcc-cris -melf $(LINUXINCLUDE) -D__ASSEMBLY__ -traditional -c $< -o $@
56 -$(obj)/misc.o: $(obj)/misc.c .config
57 +$(obj)/misc.o: $(obj)/misc.c .config FORCE
58 /usr/local/cris/gcc-cris -melf $(LINUXINCLUDE) -D__KERNEL__ -c $< -o $@
60 $(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE
61 $(call if_changed,image)
62 + cat $(obj)/decompress_MCM.bin $(obj)/piggy.gz > $(obj)/vmlinux_MCM
63 + cat $(obj)/decompress_416.bin $(obj)/piggy.gz > $(obj)/vmlinux_416
64 + cat $(obj)/decompress_816.bin $(obj)/piggy.gz > $(obj)/vmlinux_816
65 + cat $(obj)/decompress_832.bin $(obj)/piggy.gz > $(obj)/vmlinux_832
67 $(obj)/piggy.gz: $(obj)/../Image FORCE
68 $(call if_changed,gzip)
69 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/dram_init.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/dram_init.S
70 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/dram_init.S 1970-01-01 01:00:00.000000000 +0100
71 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/dram_init.S 2007-05-28 16:42:15.000000000 +0200
73 +/* $Id: dram_init.S,v 1.5 2006/10/13 12:43:11 starvik Exp $
75 + * DRAM/SDRAM initialization - alter with care
76 + * This file is intended to be included from other assembler files
78 + * Note: This file may not modify r9 because r9 is used to carry
79 + * information from the decompresser to the kernel
81 + * Copyright (C) 2000, 2001 Axis Communications AB
83 + * Authors: Mikael Starvik (starvik@axis.com)
85 + * $Log: dram_init.S,v $
86 + * Revision 1.5 2006/10/13 12:43:11 starvik
89 + * Revision 1.4 2003/09/22 09:21:59 starvik
90 + * Decompresser is linked to 0x407xxxxx and sdram commands are at 0x000xxxxx
91 + * so we need to mask off 12 bits.
93 + * Revision 1.3 2003/03/31 09:38:37 starvik
94 + * Corrected calculation of end of sdram init commands
96 + * Revision 1.2 2002/11/19 13:33:29 starvik
97 + * Changes from Linux 2.4
99 + * Revision 1.13 2002/10/30 07:42:28 starvik
100 + * Always read SDRAM command sequence from flash
102 + * Revision 1.12 2002/08/09 11:37:37 orjanf
103 + * Added double initialization work-around for Samsung SDRAMs.
105 + * Revision 1.11 2002/06/04 11:43:21 starvik
106 + * Check if mrs_data is specified in kernelconfig (necessary for MCM)
108 + * Revision 1.10 2001/10/04 12:00:21 martinnn
109 + * Added missing underscores.
111 + * Revision 1.9 2001/10/01 14:47:35 bjornw
112 + * Added register prefixes and removed underscores
114 + * Revision 1.8 2001/05/15 07:12:45 hp
115 + * Copy warning from head.S about r8 and r9
117 + * Revision 1.7 2001/04/18 12:05:39 bjornw
118 + * Fixed comments, and explicitely include config.h to be sure its there
120 + * Revision 1.6 2001/04/10 06:20:16 starvik
121 + * Delay should be 200us, not 200ns
123 + * Revision 1.5 2001/04/09 06:01:13 starvik
124 + * Added support for 100 MHz SDRAMs
126 + * Revision 1.4 2001/03/26 14:24:01 bjornw
127 + * Namechange of some config options
129 + * Revision 1.3 2001/03/23 08:29:41 starvik
130 + * Corrected calculation of mrs_data
132 + * Revision 1.2 2001/02/08 15:20:00 starvik
133 + * Corrected SDRAM initialization
134 + * Should now be included as inline
136 + * Revision 1.1 2001/01/29 13:08:02 starvik
138 + * This file should be included from all assembler files that needs to
139 + * initialize DRAM/SDRAM.
143 +/* Just to be certain the config file is included, we include it here
144 + * explicitely instead of depending on it being included in the file that
149 + ;; WARNING! The registers r8 and r9 are used as parameters carrying
150 + ;; information from the decompressor (if the kernel was compressed).
151 + ;; They should not be used in the code below.
153 +#ifndef CONFIG_SVINTO_SIM
154 + move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0
155 + move.d $r0, [R_WAITSTATES]
157 + move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0
158 + move.d $r0, [R_BUS_CONFIG]
160 +#ifndef CONFIG_ETRAX_SDRAM
161 + move.d CONFIG_ETRAX_DEF_R_DRAM_CONFIG, $r0
162 + move.d $r0, [R_DRAM_CONFIG]
164 + move.d CONFIG_ETRAX_DEF_R_DRAM_TIMING, $r0
165 + move.d $r0, [R_DRAM_TIMING]
167 + ;; Samsung SDRAMs seem to require to be initialized twice to work properly.
171 + ; Refer to ETRAX 100LX Designers Reference for a description of SDRAM initialization
173 + ; Bank configuration
174 + move.d CONFIG_ETRAX_DEF_R_SDRAM_CONFIG, $r0
175 + move.d $r0, [R_SDRAM_CONFIG]
177 + ; Calculate value of mrs_data
178 + ; CAS latency = 2 && bus_width = 32 => 0x40
179 + ; CAS latency = 3 && bus_width = 32 => 0x60
180 + ; CAS latency = 2 && bus_width = 16 => 0x20
181 + ; CAS latency = 3 && bus_width = 16 => 0x30
183 + ; Check if value is already supplied in kernel config
184 + move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r2
185 + and.d 0x00ff0000, $r2
189 + move.d 0x40, $r2 ; Assume 32 bits and CAS latency = 2
190 + move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1
192 + and.d 0x03, $r1 ; Get CAS latency
193 + and.d 0x1000, $r3 ; 50 or 100 MHz?
197 + cmp.d 0x00, $r1 ; CAS latency = 2?
200 + or.d 0x20, $r2 ; CAS latency = 3
204 + cmp.d 0x01, $r1 ; CAS latency = 2?
207 + or.d 0x20, $r2 ; CAS latency = 3
209 + move.d CONFIG_ETRAX_DEF_R_SDRAM_CONFIG, $r1
210 + and.d 0x800000, $r1 ; DRAM width is bit 23
213 + lsrq 1, $r2 ; 16 bits. Shift down value.
215 + ; Set timing parameters. Starts master clock
217 + move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1
218 + and.d 0x8000f9ff, $r1 ; Make sure mrs data and command is 0
219 + or.d 0x80000000, $r1 ; Make sure sdram enable bit is set
221 + or.d 0x0000c000, $r1 ; ref = disable
222 + lslq 16, $r2 ; mrs data starts at bit 16
224 + move.d $r1, [R_SDRAM_TIMING]
231 + ; Issue initialization command sequence
232 + move.d _sdram_commands_start, $r2
233 + and.d 0x000fffff, $r2 ; Make sure commands are read from flash
234 + move.d _sdram_commands_end, $r3
235 + and.d 0x000fffff, $r3
238 + lslq 9, $r4 ; Command starts at bit 9
240 + move.d $r4, [R_SDRAM_TIMING]
241 + nop ; Wait five nop cycles between each command
249 + move.d $r5, [R_SDRAM_TIMING]
253 + ba _sdram_commands_end
256 +_sdram_commands_start:
257 + .byte 3 ; Precharge
277 +_sdram_commands_end:
280 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/dram_init_416.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/dram_init_416.S
281 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/dram_init_416.S 1970-01-01 01:00:00.000000000 +0100
282 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/dram_init_416.S 2007-05-28 20:02:25.000000000 +0200
284 +/* $Id: dram_init.S,v 1.5 2006/10/13 12:43:11 starvik Exp $
286 + * DRAM/SDRAM initialization - alter with care
287 + * This file is intended to be included from other assembler files
289 + * Note: This file may not modify r9 because r9 is used to carry
290 + * information from the decompresser to the kernel
292 + * Copyright (C) 2000, 2001 Axis Communications AB
294 + * Authors: Mikael Starvik (starvik@axis.com)
296 + * $Log: dram_init.S,v $
297 + * Revision 1.5 2006/10/13 12:43:11 starvik
300 + * Revision 1.4 2003/09/22 09:21:59 starvik
301 + * Decompresser is linked to 0x407xxxxx and sdram commands are at 0x000xxxxx
302 + * so we need to mask off 12 bits.
304 + * Revision 1.3 2003/03/31 09:38:37 starvik
305 + * Corrected calculation of end of sdram init commands
307 + * Revision 1.2 2002/11/19 13:33:29 starvik
308 + * Changes from Linux 2.4
310 + * Revision 1.13 2002/10/30 07:42:28 starvik
311 + * Always read SDRAM command sequence from flash
313 + * Revision 1.12 2002/08/09 11:37:37 orjanf
314 + * Added double initialization work-around for Samsung SDRAMs.
316 + * Revision 1.11 2002/06/04 11:43:21 starvik
317 + * Check if mrs_data is specified in kernelconfig (necessary for MCM)
319 + * Revision 1.10 2001/10/04 12:00:21 martinnn
320 + * Added missing underscores.
322 + * Revision 1.9 2001/10/01 14:47:35 bjornw
323 + * Added register prefixes and removed underscores
325 + * Revision 1.8 2001/05/15 07:12:45 hp
326 + * Copy warning from head.S about r8 and r9
328 + * Revision 1.7 2001/04/18 12:05:39 bjornw
329 + * Fixed comments, and explicitely include config.h to be sure its there
331 + * Revision 1.6 2001/04/10 06:20:16 starvik
332 + * Delay should be 200us, not 200ns
334 + * Revision 1.5 2001/04/09 06:01:13 starvik
335 + * Added support for 100 MHz SDRAMs
337 + * Revision 1.4 2001/03/26 14:24:01 bjornw
338 + * Namechange of some config options
340 + * Revision 1.3 2001/03/23 08:29:41 starvik
341 + * Corrected calculation of mrs_data
343 + * Revision 1.2 2001/02/08 15:20:00 starvik
344 + * Corrected SDRAM initialization
345 + * Should now be included as inline
347 + * Revision 1.1 2001/01/29 13:08:02 starvik
349 + * This file should be included from all assembler files that needs to
350 + * initialize DRAM/SDRAM.
354 +/* Just to be certain the config file is included, we include it here
355 + * explicitely instead of depending on it being included in the file that
360 + ;; WARNING! The registers r8 and r9 are used as parameters carrying
361 + ;; information from the decompressor (if the kernel was compressed).
362 + ;; They should not be used in the code below.
364 +#ifndef CONFIG_SVINTO_SIM
365 + move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0
366 + move.d $r0, [R_WAITSTATES]
368 + move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0
369 + move.d $r0, [R_BUS_CONFIG]
371 +#ifndef CONFIG_ETRAX_SDRAM
372 + move.d CONFIG_ETRAX_DEF_R_DRAM_CONFIG, $r0
373 + move.d $r0, [R_DRAM_CONFIG]
375 + move.d CONFIG_ETRAX_DEF_R_DRAM_TIMING, $r0
376 + move.d $r0, [R_DRAM_TIMING]
378 + ;; Samsung SDRAMs seem to require to be initialized twice to work properly.
382 + ; Refer to ETRAX 100LX Designers Reference for a description of SDRAM initialization
384 + ; Bank configuration
385 + move.d 0x09603636, $r0
386 + move.d $r0, [R_SDRAM_CONFIG]
388 + ; Calculate value of mrs_data
389 + ; CAS latency = 2 && bus_width = 32 => 0x40
390 + ; CAS latency = 3 && bus_width = 32 => 0x60
391 + ; CAS latency = 2 && bus_width = 16 => 0x20
392 + ; CAS latency = 3 && bus_width = 16 => 0x30
394 + ; Check if value is already supplied in kernel config
395 + move.d 0x80008002, $r2
396 + and.d 0x00ff0000, $r2
400 + move.d 0x40, $r2 ; Assume 32 bits and CAS latency = 2
401 + move.d 0x80008002, $r1
403 + and.d 0x03, $r1 ; Get CAS latency
404 + and.d 0x1000, $r3 ; 50 or 100 MHz?
408 + cmp.d 0x00, $r1 ; CAS latency = 2?
411 + or.d 0x20, $r2 ; CAS latency = 3
415 + cmp.d 0x01, $r1 ; CAS latency = 2?
418 + or.d 0x20, $r2 ; CAS latency = 3
420 + move.d 0x09603636, $r1
421 + and.d 0x800000, $r1 ; DRAM width is bit 23
424 + lsrq 1, $r2 ; 16 bits. Shift down value.
426 + ; Set timing parameters. Starts master clock
428 + move.d 0x80008002, $r1
429 + and.d 0x8000f9ff, $r1 ; Make sure mrs data and command is 0
430 + or.d 0x80000000, $r1 ; Make sure sdram enable bit is set
432 + or.d 0x0000c000, $r1 ; ref = disable
433 + lslq 16, $r2 ; mrs data starts at bit 16
435 + move.d $r1, [R_SDRAM_TIMING]
442 + ; Issue initialization command sequence
443 + move.d _sdram_commands_start, $r2
444 + and.d 0x000fffff, $r2 ; Make sure commands are read from flash
445 + move.d _sdram_commands_end, $r3
446 + and.d 0x000fffff, $r3
449 + lslq 9, $r4 ; Command starts at bit 9
451 + move.d $r4, [R_SDRAM_TIMING]
452 + nop ; Wait five nop cycles between each command
460 + move.d $r5, [R_SDRAM_TIMING]
464 + ba _sdram_commands_end
467 +_sdram_commands_start:
468 + .byte 3 ; Precharge
488 +_sdram_commands_end:
491 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/dram_init_816.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/dram_init_816.S
492 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/dram_init_816.S 1970-01-01 01:00:00.000000000 +0100
493 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/dram_init_816.S 2007-05-28 20:04:05.000000000 +0200
495 +/* $Id: dram_init.S,v 1.5 2006/10/13 12:43:11 starvik Exp $
497 + * DRAM/SDRAM initialization - alter with care
498 + * This file is intended to be included from other assembler files
500 + * Note: This file may not modify r9 because r9 is used to carry
501 + * information from the decompresser to the kernel
503 + * Copyright (C) 2000, 2001 Axis Communications AB
505 + * Authors: Mikael Starvik (starvik@axis.com)
507 + * $Log: dram_init.S,v $
508 + * Revision 1.5 2006/10/13 12:43:11 starvik
511 + * Revision 1.4 2003/09/22 09:21:59 starvik
512 + * Decompresser is linked to 0x407xxxxx and sdram commands are at 0x000xxxxx
513 + * so we need to mask off 12 bits.
515 + * Revision 1.3 2003/03/31 09:38:37 starvik
516 + * Corrected calculation of end of sdram init commands
518 + * Revision 1.2 2002/11/19 13:33:29 starvik
519 + * Changes from Linux 2.4
521 + * Revision 1.13 2002/10/30 07:42:28 starvik
522 + * Always read SDRAM command sequence from flash
524 + * Revision 1.12 2002/08/09 11:37:37 orjanf
525 + * Added double initialization work-around for Samsung SDRAMs.
527 + * Revision 1.11 2002/06/04 11:43:21 starvik
528 + * Check if mrs_data is specified in kernelconfig (necessary for MCM)
530 + * Revision 1.10 2001/10/04 12:00:21 martinnn
531 + * Added missing underscores.
533 + * Revision 1.9 2001/10/01 14:47:35 bjornw
534 + * Added register prefixes and removed underscores
536 + * Revision 1.8 2001/05/15 07:12:45 hp
537 + * Copy warning from head.S about r8 and r9
539 + * Revision 1.7 2001/04/18 12:05:39 bjornw
540 + * Fixed comments, and explicitely include config.h to be sure its there
542 + * Revision 1.6 2001/04/10 06:20:16 starvik
543 + * Delay should be 200us, not 200ns
545 + * Revision 1.5 2001/04/09 06:01:13 starvik
546 + * Added support for 100 MHz SDRAMs
548 + * Revision 1.4 2001/03/26 14:24:01 bjornw
549 + * Namechange of some config options
551 + * Revision 1.3 2001/03/23 08:29:41 starvik
552 + * Corrected calculation of mrs_data
554 + * Revision 1.2 2001/02/08 15:20:00 starvik
555 + * Corrected SDRAM initialization
556 + * Should now be included as inline
558 + * Revision 1.1 2001/01/29 13:08:02 starvik
560 + * This file should be included from all assembler files that needs to
561 + * initialize DRAM/SDRAM.
565 +/* Just to be certain the config file is included, we include it here
566 + * explicitely instead of depending on it being included in the file that
571 + ;; WARNING! The registers r8 and r9 are used as parameters carrying
572 + ;; information from the decompressor (if the kernel was compressed).
573 + ;; They should not be used in the code below.
575 +#ifndef CONFIG_SVINTO_SIM
576 + move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0
577 + move.d $r0, [R_WAITSTATES]
579 + move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0
580 + move.d $r0, [R_BUS_CONFIG]
582 +#ifndef CONFIG_ETRAX_SDRAM
583 + move.d CONFIG_ETRAX_DEF_R_DRAM_CONFIG, $r0
584 + move.d $r0, [R_DRAM_CONFIG]
586 + move.d CONFIG_ETRAX_DEF_R_DRAM_TIMING, $r0
587 + move.d $r0, [R_DRAM_TIMING]
589 + ;; Samsung SDRAMs seem to require to be initialized twice to work properly.
593 + ; Refer to ETRAX 100LX Designers Reference for a description of SDRAM initialization
595 + ; Bank configuration
596 + move.d 0x09603636, $r0
597 + move.d $r0, [R_SDRAM_CONFIG]
599 + ; Calculate value of mrs_data
600 + ; CAS latency = 2 && bus_width = 32 => 0x40
601 + ; CAS latency = 3 && bus_width = 32 => 0x60
602 + ; CAS latency = 2 && bus_width = 16 => 0x20
603 + ; CAS latency = 3 && bus_width = 16 => 0x30
605 + ; Check if value is already supplied in kernel config
606 + move.d 0x80008002, $r2
607 + and.d 0x00ff0000, $r2
611 + move.d 0x40, $r2 ; Assume 32 bits and CAS latency = 2
612 + move.d 0x80008002, $r1
614 + and.d 0x03, $r1 ; Get CAS latency
615 + and.d 0x1000, $r3 ; 50 or 100 MHz?
619 + cmp.d 0x00, $r1 ; CAS latency = 2?
622 + or.d 0x20, $r2 ; CAS latency = 3
626 + cmp.d 0x01, $r1 ; CAS latency = 2?
629 + or.d 0x20, $r2 ; CAS latency = 3
631 + move.d 0x09603636, $r1
632 + and.d 0x800000, $r1 ; DRAM width is bit 23
635 + lsrq 1, $r2 ; 16 bits. Shift down value.
637 + ; Set timing parameters. Starts master clock
639 + move.d 0x80008002, $r1
640 + and.d 0x8000f9ff, $r1 ; Make sure mrs data and command is 0
641 + or.d 0x80000000, $r1 ; Make sure sdram enable bit is set
643 + or.d 0x0000c000, $r1 ; ref = disable
644 + lslq 16, $r2 ; mrs data starts at bit 16
646 + move.d $r1, [R_SDRAM_TIMING]
653 + ; Issue initialization command sequence
654 + move.d _sdram_commands_start, $r2
655 + and.d 0x000fffff, $r2 ; Make sure commands are read from flash
656 + move.d _sdram_commands_end, $r3
657 + and.d 0x000fffff, $r3
660 + lslq 9, $r4 ; Command starts at bit 9
662 + move.d $r4, [R_SDRAM_TIMING]
663 + nop ; Wait five nop cycles between each command
671 + move.d $r5, [R_SDRAM_TIMING]
675 + ba _sdram_commands_end
678 +_sdram_commands_start:
679 + .byte 3 ; Precharge
699 +_sdram_commands_end:
702 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/dram_init_832.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/dram_init_832.S
703 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/dram_init_832.S 1970-01-01 01:00:00.000000000 +0100
704 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/dram_init_832.S 2007-05-28 20:04:57.000000000 +0200
706 +/* $Id: dram_init.S,v 1.5 2006/10/13 12:43:11 starvik Exp $
708 + * DRAM/SDRAM initialization - alter with care
709 + * This file is intended to be included from other assembler files
711 + * Note: This file may not modify r9 because r9 is used to carry
712 + * information from the decompresser to the kernel
714 + * Copyright (C) 2000, 2001 Axis Communications AB
716 + * Authors: Mikael Starvik (starvik@axis.com)
718 + * $Log: dram_init.S,v $
719 + * Revision 1.5 2006/10/13 12:43:11 starvik
722 + * Revision 1.4 2003/09/22 09:21:59 starvik
723 + * Decompresser is linked to 0x407xxxxx and sdram commands are at 0x000xxxxx
724 + * so we need to mask off 12 bits.
726 + * Revision 1.3 2003/03/31 09:38:37 starvik
727 + * Corrected calculation of end of sdram init commands
729 + * Revision 1.2 2002/11/19 13:33:29 starvik
730 + * Changes from Linux 2.4
732 + * Revision 1.13 2002/10/30 07:42:28 starvik
733 + * Always read SDRAM command sequence from flash
735 + * Revision 1.12 2002/08/09 11:37:37 orjanf
736 + * Added double initialization work-around for Samsung SDRAMs.
738 + * Revision 1.11 2002/06/04 11:43:21 starvik
739 + * Check if mrs_data is specified in kernelconfig (necessary for MCM)
741 + * Revision 1.10 2001/10/04 12:00:21 martinnn
742 + * Added missing underscores.
744 + * Revision 1.9 2001/10/01 14:47:35 bjornw
745 + * Added register prefixes and removed underscores
747 + * Revision 1.8 2001/05/15 07:12:45 hp
748 + * Copy warning from head.S about r8 and r9
750 + * Revision 1.7 2001/04/18 12:05:39 bjornw
751 + * Fixed comments, and explicitely include config.h to be sure its there
753 + * Revision 1.6 2001/04/10 06:20:16 starvik
754 + * Delay should be 200us, not 200ns
756 + * Revision 1.5 2001/04/09 06:01:13 starvik
757 + * Added support for 100 MHz SDRAMs
759 + * Revision 1.4 2001/03/26 14:24:01 bjornw
760 + * Namechange of some config options
762 + * Revision 1.3 2001/03/23 08:29:41 starvik
763 + * Corrected calculation of mrs_data
765 + * Revision 1.2 2001/02/08 15:20:00 starvik
766 + * Corrected SDRAM initialization
767 + * Should now be included as inline
769 + * Revision 1.1 2001/01/29 13:08:02 starvik
771 + * This file should be included from all assembler files that needs to
772 + * initialize DRAM/SDRAM.
776 +/* Just to be certain the config file is included, we include it here
777 + * explicitely instead of depending on it being included in the file that
782 + ;; WARNING! The registers r8 and r9 are used as parameters carrying
783 + ;; information from the decompressor (if the kernel was compressed).
784 + ;; They should not be used in the code below.
786 +#ifndef CONFIG_SVINTO_SIM
787 + move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0
788 + move.d $r0, [R_WAITSTATES]
790 + move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0
791 + move.d $r0, [R_BUS_CONFIG]
793 +#ifndef CONFIG_ETRAX_SDRAM
794 + move.d CONFIG_ETRAX_DEF_R_DRAM_CONFIG, $r0
795 + move.d $r0, [R_DRAM_CONFIG]
797 + move.d CONFIG_ETRAX_DEF_R_DRAM_TIMING, $r0
798 + move.d $r0, [R_DRAM_TIMING]
800 + ;; Samsung SDRAMs seem to require to be initialized twice to work properly.
804 + ; Refer to ETRAX 100LX Designers Reference for a description of SDRAM initialization
806 + ; Bank configuration
807 + move.d 0x09603737, $r0
808 + move.d $r0, [R_SDRAM_CONFIG]
810 + ; Calculate value of mrs_data
811 + ; CAS latency = 2 && bus_width = 32 => 0x40
812 + ; CAS latency = 3 && bus_width = 32 => 0x60
813 + ; CAS latency = 2 && bus_width = 16 => 0x20
814 + ; CAS latency = 3 && bus_width = 16 => 0x30
816 + ; Check if value is already supplied in kernel config
817 + move.d 0x80008002, $r2
818 + and.d 0x00ff0000, $r2
822 + move.d 0x40, $r2 ; Assume 32 bits and CAS latency = 2
823 + move.d 0x80008002, $r1
825 + and.d 0x03, $r1 ; Get CAS latency
826 + and.d 0x1000, $r3 ; 50 or 100 MHz?
830 + cmp.d 0x00, $r1 ; CAS latency = 2?
833 + or.d 0x20, $r2 ; CAS latency = 3
837 + cmp.d 0x01, $r1 ; CAS latency = 2?
840 + or.d 0x20, $r2 ; CAS latency = 3
842 + move.d 0x09603737, $r1
843 + and.d 0x800000, $r1 ; DRAM width is bit 23
846 + lsrq 1, $r2 ; 16 bits. Shift down value.
848 + ; Set timing parameters. Starts master clock
850 + move.d 0x80008002, $r1
851 + and.d 0x8000f9ff, $r1 ; Make sure mrs data and command is 0
852 + or.d 0x80000000, $r1 ; Make sure sdram enable bit is set
854 + or.d 0x0000c000, $r1 ; ref = disable
855 + lslq 16, $r2 ; mrs data starts at bit 16
857 + move.d $r1, [R_SDRAM_TIMING]
864 + ; Issue initialization command sequence
865 + move.d _sdram_commands_start, $r2
866 + and.d 0x000fffff, $r2 ; Make sure commands are read from flash
867 + move.d _sdram_commands_end, $r3
868 + and.d 0x000fffff, $r3
871 + lslq 9, $r4 ; Command starts at bit 9
873 + move.d $r4, [R_SDRAM_TIMING]
874 + nop ; Wait five nop cycles between each command
882 + move.d $r5, [R_SDRAM_TIMING]
886 + ba _sdram_commands_end
889 +_sdram_commands_start:
890 + .byte 3 ; Precharge
910 +_sdram_commands_end:
913 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/dram_init_MCM.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/dram_init_MCM.S
914 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/dram_init_MCM.S 1970-01-01 01:00:00.000000000 +0100
915 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/dram_init_MCM.S 2007-05-28 20:03:13.000000000 +0200
917 +/* $Id: dram_init.S,v 1.5 2006/10/13 12:43:11 starvik Exp $
919 + * DRAM/SDRAM initialization - alter with care
920 + * This file is intended to be included from other assembler files
922 + * Note: This file may not modify r9 because r9 is used to carry
923 + * information from the decompresser to the kernel
925 + * Copyright (C) 2000, 2001 Axis Communications AB
927 + * Authors: Mikael Starvik (starvik@axis.com)
929 + * $Log: dram_init.S,v $
930 + * Revision 1.5 2006/10/13 12:43:11 starvik
933 + * Revision 1.4 2003/09/22 09:21:59 starvik
934 + * Decompresser is linked to 0x407xxxxx and sdram commands are at 0x000xxxxx
935 + * so we need to mask off 12 bits.
937 + * Revision 1.3 2003/03/31 09:38:37 starvik
938 + * Corrected calculation of end of sdram init commands
940 + * Revision 1.2 2002/11/19 13:33:29 starvik
941 + * Changes from Linux 2.4
943 + * Revision 1.13 2002/10/30 07:42:28 starvik
944 + * Always read SDRAM command sequence from flash
946 + * Revision 1.12 2002/08/09 11:37:37 orjanf
947 + * Added double initialization work-around for Samsung SDRAMs.
949 + * Revision 1.11 2002/06/04 11:43:21 starvik
950 + * Check if mrs_data is specified in kernelconfig (necessary for MCM)
952 + * Revision 1.10 2001/10/04 12:00:21 martinnn
953 + * Added missing underscores.
955 + * Revision 1.9 2001/10/01 14:47:35 bjornw
956 + * Added register prefixes and removed underscores
958 + * Revision 1.8 2001/05/15 07:12:45 hp
959 + * Copy warning from head.S about r8 and r9
961 + * Revision 1.7 2001/04/18 12:05:39 bjornw
962 + * Fixed comments, and explicitely include config.h to be sure its there
964 + * Revision 1.6 2001/04/10 06:20:16 starvik
965 + * Delay should be 200us, not 200ns
967 + * Revision 1.5 2001/04/09 06:01:13 starvik
968 + * Added support for 100 MHz SDRAMs
970 + * Revision 1.4 2001/03/26 14:24:01 bjornw
971 + * Namechange of some config options
973 + * Revision 1.3 2001/03/23 08:29:41 starvik
974 + * Corrected calculation of mrs_data
976 + * Revision 1.2 2001/02/08 15:20:00 starvik
977 + * Corrected SDRAM initialization
978 + * Should now be included as inline
980 + * Revision 1.1 2001/01/29 13:08:02 starvik
982 + * This file should be included from all assembler files that needs to
983 + * initialize DRAM/SDRAM.
987 +/* Just to be certain the config file is included, we include it here
988 + * explicitely instead of depending on it being included in the file that
993 + ;; WARNING! The registers r8 and r9 are used as parameters carrying
994 + ;; information from the decompressor (if the kernel was compressed).
995 + ;; They should not be used in the code below.
997 +#ifndef CONFIG_SVINTO_SIM
998 + move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0
999 + move.d $r0, [R_WAITSTATES]
1001 + move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0
1002 + move.d $r0, [R_BUS_CONFIG]
1004 +#ifndef CONFIG_ETRAX_SDRAM
1005 + move.d CONFIG_ETRAX_DEF_R_DRAM_CONFIG, $r0
1006 + move.d $r0, [R_DRAM_CONFIG]
1008 + move.d CONFIG_ETRAX_DEF_R_DRAM_TIMING, $r0
1009 + move.d $r0, [R_DRAM_TIMING]
1011 + ;; Samsung SDRAMs seem to require to be initialized twice to work properly.
1015 + ; Refer to ETRAX 100LX Designers Reference for a description of SDRAM initialization
1017 + ; Bank configuration
1018 + move.d 0x09603636, $r0
1019 + move.d $r0, [R_SDRAM_CONFIG]
1021 + ; Calculate value of mrs_data
1022 + ; CAS latency = 2 && bus_width = 32 => 0x40
1023 + ; CAS latency = 3 && bus_width = 32 => 0x60
1024 + ; CAS latency = 2 && bus_width = 16 => 0x20
1025 + ; CAS latency = 3 && bus_width = 16 => 0x30
1027 + ; Check if value is already supplied in kernel config
1028 + move.d 0x80608002, $r2
1029 + and.d 0x00ff0000, $r2
1033 + move.d 0x40, $r2 ; Assume 32 bits and CAS latency = 2
1034 + move.d 0x80608002, $r1
1036 + and.d 0x03, $r1 ; Get CAS latency
1037 + and.d 0x1000, $r3 ; 50 or 100 MHz?
1041 + cmp.d 0x00, $r1 ; CAS latency = 2?
1044 + or.d 0x20, $r2 ; CAS latency = 3
1048 + cmp.d 0x01, $r1 ; CAS latency = 2?
1051 + or.d 0x20, $r2 ; CAS latency = 3
1053 + move.d 0x09603636, $r1
1054 + and.d 0x800000, $r1 ; DRAM width is bit 23
1057 + lsrq 1, $r2 ; 16 bits. Shift down value.
1059 + ; Set timing parameters. Starts master clock
1061 + move.d 0x80608002, $r1
1062 + and.d 0x8000f9ff, $r1 ; Make sure mrs data and command is 0
1063 + or.d 0x80000000, $r1 ; Make sure sdram enable bit is set
1065 + or.d 0x0000c000, $r1 ; ref = disable
1066 + lslq 16, $r2 ; mrs data starts at bit 16
1068 + move.d $r1, [R_SDRAM_TIMING]
1075 + ; Issue initialization command sequence
1076 + move.d _sdram_commands_start, $r2
1077 + and.d 0x000fffff, $r2 ; Make sure commands are read from flash
1078 + move.d _sdram_commands_end, $r3
1079 + and.d 0x000fffff, $r3
1081 + move.b [$r2+], $r4
1082 + lslq 9, $r4 ; Command starts at bit 9
1084 + move.d $r4, [R_SDRAM_TIMING]
1085 + nop ; Wait five nop cycles between each command
1093 + move.d $r5, [R_SDRAM_TIMING]
1097 + ba _sdram_commands_end
1100 +_sdram_commands_start:
1101 + .byte 3 ; Precharge
1121 +_sdram_commands_end:
1124 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/head_416.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/head_416.S
1125 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/head_416.S 1970-01-01 01:00:00.000000000 +0100
1126 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/head_416.S 2007-05-28 17:16:28.000000000 +0200
1129 + * arch/cris/boot/compressed/head.S
1131 + * Copyright (C) 1999, 2001 Axis Communications AB
1133 + * Code that sets up the DRAM registers, calls the
1134 + * decompressor to unpack the piggybacked kernel, and jumps.
1138 +#define ASSEMBLER_MACROS_ONLY
1139 +#include <asm/arch/sv_addr_ag.h>
1141 +#define RAM_INIT_MAGIC 0x56902387
1142 +#define COMMAND_LINE_MAGIC 0x87109563
1144 + ;; Exported symbols
1146 + .globl _input_data
1154 +;; We need to initialze DRAM registers before we start using the DRAM
1156 + cmp.d RAM_INIT_MAGIC, r8 ; Already initialized?
1157 + beq dram_init_finished
1160 +#include "dram_init_416.S"
1162 +dram_init_finished:
1164 + ;; Initiate the PA and PB ports
1166 + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0
1167 + move.b r0, [R_PORT_PA_DATA]
1169 + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0
1170 + move.b r0, [R_PORT_PA_DIR]
1172 + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0
1173 + move.b r0, [R_PORT_PB_DATA]
1175 + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, r0
1176 + move.b r0, [R_PORT_PB_DIR]
1178 + ;; Setup the stack to a suitably high address.
1179 + ;; We assume 8 MB is the minimum DRAM in an eLinux
1180 + ;; product and put the sp at the top for now.
1182 + move.d 0x40800000, sp
1184 + ;; Figure out where the compressed piggyback image is
1185 + ;; in the flash (since we wont try to copy it to DRAM
1186 + ;; before unpacking). It is at _edata, but in flash.
1187 + ;; Use (_edata - basse) as offset to the current PC.
1189 +basse: move.d pc, r5
1190 + and.d 0x7fffffff, r5 ; strip any non-cache bit
1191 + subq 2, r5 ; compensate for the move.d pc instr
1192 + move.d r5, r0 ; save for later - flash address of 'basse'
1194 + sub.d basse, r5 ; r5 = flash address of '_edata'
1196 + ;; Copy text+data to DRAM
1198 + move.d basse, r1 ; destination
1199 + move.d _edata, r2 ; end destination
1200 +1: move.w [r0+], r3
1206 + move.d r5, [_input_data] ; for the decompressor
1209 + ;; Clear the decompressors BSS (between _edata and _end)
1214 +1: move.w r0, [r1+]
1219 + ;; Save command line magic and address.
1220 + move.d _cmd_line_magic, $r12
1221 + move.d $r10, [$r12]
1222 + move.d _cmd_line_addr, $r12
1223 + move.d $r11, [$r12]
1225 + ;; Do the decompression and save compressed size in _inptr
1227 + jsr _decompress_kernel
1229 + ;; Put start address of root partition in r9 so the kernel can use it
1230 + ;; when mounting from flash
1232 + move.d [_input_data], r9 ; flash address of compressed kernel
1233 + add.d [_inptr], r9 ; size of compressed kernel
1235 + ;; Restore command line magic and address.
1236 + move.d _cmd_line_magic, $r10
1237 + move.d [$r10], $r10
1238 + move.d _cmd_line_addr, $r11
1239 + move.d [$r11], $r11
1241 + ;; Enter the decompressed kernel
1242 + move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized
1243 + jump 0x40004000 ; kernel is linked to this address
1248 + .dword 0 ; used by the decompressor
1253 +#include "hw_settings_416.S"
1254 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/head_816.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/head_816.S
1255 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/head_816.S 1970-01-01 01:00:00.000000000 +0100
1256 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/head_816.S 2007-05-28 17:16:58.000000000 +0200
1259 + * arch/cris/boot/compressed/head.S
1261 + * Copyright (C) 1999, 2001 Axis Communications AB
1263 + * Code that sets up the DRAM registers, calls the
1264 + * decompressor to unpack the piggybacked kernel, and jumps.
1268 +#define ASSEMBLER_MACROS_ONLY
1269 +#include <asm/arch/sv_addr_ag.h>
1271 +#define RAM_INIT_MAGIC 0x56902387
1272 +#define COMMAND_LINE_MAGIC 0x87109563
1274 + ;; Exported symbols
1276 + .globl _input_data
1284 +;; We need to initialze DRAM registers before we start using the DRAM
1286 + cmp.d RAM_INIT_MAGIC, r8 ; Already initialized?
1287 + beq dram_init_finished
1290 +#include "dram_init_816.S"
1292 +dram_init_finished:
1294 + ;; Initiate the PA and PB ports
1296 + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0
1297 + move.b r0, [R_PORT_PA_DATA]
1299 + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0
1300 + move.b r0, [R_PORT_PA_DIR]
1302 + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0
1303 + move.b r0, [R_PORT_PB_DATA]
1305 + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, r0
1306 + move.b r0, [R_PORT_PB_DIR]
1308 + ;; Setup the stack to a suitably high address.
1309 + ;; We assume 8 MB is the minimum DRAM in an eLinux
1310 + ;; product and put the sp at the top for now.
1312 + move.d 0x40800000, sp
1314 + ;; Figure out where the compressed piggyback image is
1315 + ;; in the flash (since we wont try to copy it to DRAM
1316 + ;; before unpacking). It is at _edata, but in flash.
1317 + ;; Use (_edata - basse) as offset to the current PC.
1319 +basse: move.d pc, r5
1320 + and.d 0x7fffffff, r5 ; strip any non-cache bit
1321 + subq 2, r5 ; compensate for the move.d pc instr
1322 + move.d r5, r0 ; save for later - flash address of 'basse'
1324 + sub.d basse, r5 ; r5 = flash address of '_edata'
1326 + ;; Copy text+data to DRAM
1328 + move.d basse, r1 ; destination
1329 + move.d _edata, r2 ; end destination
1330 +1: move.w [r0+], r3
1336 + move.d r5, [_input_data] ; for the decompressor
1339 + ;; Clear the decompressors BSS (between _edata and _end)
1344 +1: move.w r0, [r1+]
1349 + ;; Save command line magic and address.
1350 + move.d _cmd_line_magic, $r12
1351 + move.d $r10, [$r12]
1352 + move.d _cmd_line_addr, $r12
1353 + move.d $r11, [$r12]
1355 + ;; Do the decompression and save compressed size in _inptr
1357 + jsr _decompress_kernel
1359 + ;; Put start address of root partition in r9 so the kernel can use it
1360 + ;; when mounting from flash
1362 + move.d [_input_data], r9 ; flash address of compressed kernel
1363 + add.d [_inptr], r9 ; size of compressed kernel
1365 + ;; Restore command line magic and address.
1366 + move.d _cmd_line_magic, $r10
1367 + move.d [$r10], $r10
1368 + move.d _cmd_line_addr, $r11
1369 + move.d [$r11], $r11
1371 + ;; Enter the decompressed kernel
1372 + move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized
1373 + jump 0x40004000 ; kernel is linked to this address
1378 + .dword 0 ; used by the decompressor
1383 +#include "hw_settings_816.S"
1384 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/head_832.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/head_832.S
1385 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/head_832.S 1970-01-01 01:00:00.000000000 +0100
1386 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/head_832.S 2007-05-28 17:17:12.000000000 +0200
1389 + * arch/cris/boot/compressed/head.S
1391 + * Copyright (C) 1999, 2001 Axis Communications AB
1393 + * Code that sets up the DRAM registers, calls the
1394 + * decompressor to unpack the piggybacked kernel, and jumps.
1398 +#define ASSEMBLER_MACROS_ONLY
1399 +#include <asm/arch/sv_addr_ag.h>
1401 +#define RAM_INIT_MAGIC 0x56902387
1402 +#define COMMAND_LINE_MAGIC 0x87109563
1404 + ;; Exported symbols
1406 + .globl _input_data
1414 +;; We need to initialze DRAM registers before we start using the DRAM
1416 + cmp.d RAM_INIT_MAGIC, r8 ; Already initialized?
1417 + beq dram_init_finished
1420 +#include "dram_init_832.S"
1422 +dram_init_finished:
1424 + ;; Initiate the PA and PB ports
1426 + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0
1427 + move.b r0, [R_PORT_PA_DATA]
1429 + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0
1430 + move.b r0, [R_PORT_PA_DIR]
1432 + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0
1433 + move.b r0, [R_PORT_PB_DATA]
1435 + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, r0
1436 + move.b r0, [R_PORT_PB_DIR]
1438 + ;; Setup the stack to a suitably high address.
1439 + ;; We assume 8 MB is the minimum DRAM in an eLinux
1440 + ;; product and put the sp at the top for now.
1442 + move.d 0x40800000, sp
1444 + ;; Figure out where the compressed piggyback image is
1445 + ;; in the flash (since we wont try to copy it to DRAM
1446 + ;; before unpacking). It is at _edata, but in flash.
1447 + ;; Use (_edata - basse) as offset to the current PC.
1449 +basse: move.d pc, r5
1450 + and.d 0x7fffffff, r5 ; strip any non-cache bit
1451 + subq 2, r5 ; compensate for the move.d pc instr
1452 + move.d r5, r0 ; save for later - flash address of 'basse'
1454 + sub.d basse, r5 ; r5 = flash address of '_edata'
1456 + ;; Copy text+data to DRAM
1458 + move.d basse, r1 ; destination
1459 + move.d _edata, r2 ; end destination
1460 +1: move.w [r0+], r3
1466 + move.d r5, [_input_data] ; for the decompressor
1469 + ;; Clear the decompressors BSS (between _edata and _end)
1474 +1: move.w r0, [r1+]
1479 + ;; Save command line magic and address.
1480 + move.d _cmd_line_magic, $r12
1481 + move.d $r10, [$r12]
1482 + move.d _cmd_line_addr, $r12
1483 + move.d $r11, [$r12]
1485 + ;; Do the decompression and save compressed size in _inptr
1487 + jsr _decompress_kernel
1489 + ;; Put start address of root partition in r9 so the kernel can use it
1490 + ;; when mounting from flash
1492 + move.d [_input_data], r9 ; flash address of compressed kernel
1493 + add.d [_inptr], r9 ; size of compressed kernel
1495 + ;; Restore command line magic and address.
1496 + move.d _cmd_line_magic, $r10
1497 + move.d [$r10], $r10
1498 + move.d _cmd_line_addr, $r11
1499 + move.d [$r11], $r11
1501 + ;; Enter the decompressed kernel
1502 + move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized
1503 + jump 0x40004000 ; kernel is linked to this address
1508 + .dword 0 ; used by the decompressor
1513 +#include "hw_settings_832.S"
1514 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/head_MCM.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/head_MCM.S
1515 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/head_MCM.S 1970-01-01 01:00:00.000000000 +0100
1516 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/head_MCM.S 2007-05-28 17:17:51.000000000 +0200
1519 + * arch/cris/boot/compressed/head.S
1521 + * Copyright (C) 1999, 2001 Axis Communications AB
1523 + * Code that sets up the DRAM registers, calls the
1524 + * decompressor to unpack the piggybacked kernel, and jumps.
1528 +#define ASSEMBLER_MACROS_ONLY
1529 +#include <asm/arch/sv_addr_ag.h>
1531 +#define RAM_INIT_MAGIC 0x56902387
1532 +#define COMMAND_LINE_MAGIC 0x87109563
1534 + ;; Exported symbols
1536 + .globl _input_data
1544 +;; We need to initialze DRAM registers before we start using the DRAM
1546 + cmp.d RAM_INIT_MAGIC, r8 ; Already initialized?
1547 + beq dram_init_finished
1550 +#include "dram_init_MCM.S"
1552 +dram_init_finished:
1554 + ;; Initiate the PA and PB ports
1556 + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0
1557 + move.b r0, [R_PORT_PA_DATA]
1559 + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0
1560 + move.b r0, [R_PORT_PA_DIR]
1562 + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0
1563 + move.b r0, [R_PORT_PB_DATA]
1565 + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, r0
1566 + move.b r0, [R_PORT_PB_DIR]
1568 + ;; Setup the stack to a suitably high address.
1569 + ;; We assume 8 MB is the minimum DRAM in an eLinux
1570 + ;; product and put the sp at the top for now.
1572 + move.d 0x40800000, sp
1574 + ;; Figure out where the compressed piggyback image is
1575 + ;; in the flash (since we wont try to copy it to DRAM
1576 + ;; before unpacking). It is at _edata, but in flash.
1577 + ;; Use (_edata - basse) as offset to the current PC.
1579 +basse: move.d pc, r5
1580 + and.d 0x7fffffff, r5 ; strip any non-cache bit
1581 + subq 2, r5 ; compensate for the move.d pc instr
1582 + move.d r5, r0 ; save for later - flash address of 'basse'
1584 + sub.d basse, r5 ; r5 = flash address of '_edata'
1586 + ;; Copy text+data to DRAM
1588 + move.d basse, r1 ; destination
1589 + move.d _edata, r2 ; end destination
1590 +1: move.w [r0+], r3
1596 + move.d r5, [_input_data] ; for the decompressor
1599 + ;; Clear the decompressors BSS (between _edata and _end)
1604 +1: move.w r0, [r1+]
1609 + ;; Save command line magic and address.
1610 + move.d _cmd_line_magic, $r12
1611 + move.d $r10, [$r12]
1612 + move.d _cmd_line_addr, $r12
1613 + move.d $r11, [$r12]
1615 + ;; Do the decompression and save compressed size in _inptr
1617 + jsr _decompress_kernel
1619 + ;; Put start address of root partition in r9 so the kernel can use it
1620 + ;; when mounting from flash
1622 + move.d [_input_data], r9 ; flash address of compressed kernel
1623 + add.d [_inptr], r9 ; size of compressed kernel
1625 + ;; Restore command line magic and address.
1626 + move.d _cmd_line_magic, $r10
1627 + move.d [$r10], $r10
1628 + move.d _cmd_line_addr, $r11
1629 + move.d [$r11], $r11
1631 + ;; Enter the decompressed kernel
1632 + move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized
1633 + jump 0x40004000 ; kernel is linked to this address
1638 + .dword 0 ; used by the decompressor
1643 +#include "hw_settings_MCM.S"
1644 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings.S
1645 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings.S 1970-01-01 01:00:00.000000000 +0100
1646 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings.S 2007-05-28 17:14:14.000000000 +0200
1649 + * $Id: hw_settings.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $
1651 + * This table is used by some tools to extract hardware parameters.
1652 + * The table should be included in the kernel and the decompressor.
1653 + * Don't forget to update the tools if you change this table.
1655 + * Copyright (C) 2001 Axis Communications AB
1657 + * Authors: Mikael Starvik (starvik@axis.com)
1660 +#define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \
1661 + (CONFIG_ETRAX_DEF_R_PORT_PA_DATA))
1662 +#define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \
1663 + (CONFIG_ETRAX_DEF_R_PORT_PB_DIR << 8) | \
1664 + (CONFIG_ETRAX_DEF_R_PORT_PB_DATA))
1666 + .ascii "HW_PARAM_MAGIC" ; Magic number
1667 + .dword 0xc0004000 ; Kernel start address
1670 +#ifdef CONFIG_ETRAX_DEBUG_PORT0
1672 +#elif defined(CONFIG_ETRAX_DEBUG_PORT1)
1674 +#elif defined(CONFIG_ETRAX_DEBUG_PORT2)
1676 +#elif defined(CONFIG_ETRAX_DEBUG_PORT3)
1679 + .dword 4 ; No debug
1682 + ; SDRAM or EDO DRAM?
1683 +#ifdef CONFIG_ETRAX_SDRAM
1690 + .dword R_WAITSTATES
1691 + .dword CONFIG_ETRAX_DEF_R_WAITSTATES
1692 + .dword R_BUS_CONFIG
1693 + .dword CONFIG_ETRAX_DEF_R_BUS_CONFIG
1694 +#ifdef CONFIG_ETRAX_SDRAM
1695 + .dword R_SDRAM_CONFIG
1696 + .dword CONFIG_ETRAX_DEF_R_SDRAM_CONFIG
1697 + .dword R_SDRAM_TIMING
1698 + .dword CONFIG_ETRAX_DEF_R_SDRAM_TIMING
1700 + .dword R_DRAM_CONFIG
1701 + .dword CONFIG_ETRAX_DEF_R_DRAM_CONFIG
1702 + .dword R_DRAM_TIMING
1703 + .dword CONFIG_ETRAX_DEF_R_DRAM_TIMING
1705 + .dword R_PORT_PA_SET
1706 + .dword PA_SET_VALUE
1707 + .dword R_PORT_PB_SET
1708 + .dword PB_SET_VALUE
1709 + .dword 0 ; No more register values
1710 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_416.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_416.S
1711 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_416.S 1970-01-01 01:00:00.000000000 +0100
1712 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_416.S 2007-05-28 20:12:02.000000000 +0200
1715 + * $Id: hw_settings.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $
1717 + * This table is used by some tools to extract hardware parameters.
1718 + * The table should be included in the kernel and the decompressor.
1719 + * Don't forget to update the tools if you change this table.
1721 + * Copyright (C) 2001 Axis Communications AB
1723 + * Authors: Mikael Starvik (starvik@axis.com)
1726 +#define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \
1727 + (CONFIG_ETRAX_DEF_R_PORT_PA_DATA))
1728 +#define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \
1729 + (CONFIG_ETRAX_DEF_R_PORT_PB_DIR << 8) | \
1730 + (CONFIG_ETRAX_DEF_R_PORT_PB_DATA))
1732 + .ascii "HW_PARAM_MAGIC" ; Magic number
1733 + .dword 0xc0004000 ; Kernel start address
1736 +#ifdef CONFIG_ETRAX_DEBUG_PORT0
1738 +#elif defined(CONFIG_ETRAX_DEBUG_PORT1)
1740 +#elif defined(CONFIG_ETRAX_DEBUG_PORT2)
1742 +#elif defined(CONFIG_ETRAX_DEBUG_PORT3)
1745 + .dword 4 ; No debug
1748 + ; SDRAM or EDO DRAM?
1749 +#ifdef CONFIG_ETRAX_SDRAM
1756 + .dword R_WAITSTATES
1757 + .dword CONFIG_ETRAX_DEF_R_WAITSTATES
1758 + .dword R_BUS_CONFIG
1759 + .dword CONFIG_ETRAX_DEF_R_BUS_CONFIG
1760 +#ifdef CONFIG_ETRAX_SDRAM
1761 + .dword R_SDRAM_CONFIG
1763 + .dword R_SDRAM_TIMING
1766 + .dword R_DRAM_CONFIG
1767 + .dword CONFIG_ETRAX_DEF_R_DRAM_CONFIG
1768 + .dword R_DRAM_TIMING
1769 + .dword CONFIG_ETRAX_DEF_R_DRAM_TIMING
1771 + .dword R_PORT_PA_SET
1772 + .dword PA_SET_VALUE
1773 + .dword R_PORT_PB_SET
1774 + .dword PB_SET_VALUE
1775 + .dword 0 ; No more register values
1776 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_816.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_816.S
1777 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_816.S 1970-01-01 01:00:00.000000000 +0100
1778 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_816.S 2007-05-28 20:12:29.000000000 +0200
1781 + * $Id: hw_settings.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $
1783 + * This table is used by some tools to extract hardware parameters.
1784 + * The table should be included in the kernel and the decompressor.
1785 + * Don't forget to update the tools if you change this table.
1787 + * Copyright (C) 2001 Axis Communications AB
1789 + * Authors: Mikael Starvik (starvik@axis.com)
1792 +#define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \
1793 + (CONFIG_ETRAX_DEF_R_PORT_PA_DATA))
1794 +#define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \
1795 + (CONFIG_ETRAX_DEF_R_PORT_PB_DIR << 8) | \
1796 + (CONFIG_ETRAX_DEF_R_PORT_PB_DATA))
1798 + .ascii "HW_PARAM_MAGIC" ; Magic number
1799 + .dword 0xc0004000 ; Kernel start address
1802 +#ifdef CONFIG_ETRAX_DEBUG_PORT0
1804 +#elif defined(CONFIG_ETRAX_DEBUG_PORT1)
1806 +#elif defined(CONFIG_ETRAX_DEBUG_PORT2)
1808 +#elif defined(CONFIG_ETRAX_DEBUG_PORT3)
1811 + .dword 4 ; No debug
1814 + ; SDRAM or EDO DRAM?
1815 +#ifdef CONFIG_ETRAX_SDRAM
1822 + .dword R_WAITSTATES
1823 + .dword CONFIG_ETRAX_DEF_R_WAITSTATES
1824 + .dword R_BUS_CONFIG
1825 + .dword CONFIG_ETRAX_DEF_R_BUS_CONFIG
1826 +#ifdef CONFIG_ETRAX_SDRAM
1827 + .dword R_SDRAM_CONFIG
1829 + .dword R_SDRAM_TIMING
1832 + .dword R_DRAM_CONFIG
1833 + .dword CONFIG_ETRAX_DEF_R_DRAM_CONFIG
1834 + .dword R_DRAM_TIMING
1835 + .dword CONFIG_ETRAX_DEF_R_DRAM_TIMING
1837 + .dword R_PORT_PA_SET
1838 + .dword PA_SET_VALUE
1839 + .dword R_PORT_PB_SET
1840 + .dword PB_SET_VALUE
1841 + .dword 0 ; No more register values
1842 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_832.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_832.S
1843 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_832.S 1970-01-01 01:00:00.000000000 +0100
1844 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_832.S 2007-05-28 20:12:55.000000000 +0200
1847 + * $Id: hw_settings.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $
1849 + * This table is used by some tools to extract hardware parameters.
1850 + * The table should be included in the kernel and the decompressor.
1851 + * Don't forget to update the tools if you change this table.
1853 + * Copyright (C) 2001 Axis Communications AB
1855 + * Authors: Mikael Starvik (starvik@axis.com)
1858 +#define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \
1859 + (CONFIG_ETRAX_DEF_R_PORT_PA_DATA))
1860 +#define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \
1861 + (CONFIG_ETRAX_DEF_R_PORT_PB_DIR << 8) | \
1862 + (CONFIG_ETRAX_DEF_R_PORT_PB_DATA))
1864 + .ascii "HW_PARAM_MAGIC" ; Magic number
1865 + .dword 0xc0004000 ; Kernel start address
1868 +#ifdef CONFIG_ETRAX_DEBUG_PORT0
1870 +#elif defined(CONFIG_ETRAX_DEBUG_PORT1)
1872 +#elif defined(CONFIG_ETRAX_DEBUG_PORT2)
1874 +#elif defined(CONFIG_ETRAX_DEBUG_PORT3)
1877 + .dword 4 ; No debug
1880 + ; SDRAM or EDO DRAM?
1881 +#ifdef CONFIG_ETRAX_SDRAM
1888 + .dword R_WAITSTATES
1889 + .dword CONFIG_ETRAX_DEF_R_WAITSTATES
1890 + .dword R_BUS_CONFIG
1891 + .dword CONFIG_ETRAX_DEF_R_BUS_CONFIG
1892 +#ifdef CONFIG_ETRAX_SDRAM
1893 + .dword R_SDRAM_CONFIG
1894 + .dword CONFIG_ETRAX_DEF_R_SDRAM_CONFIG
1895 + .dword R_SDRAM_TIMING
1896 + .dword CONFIG_ETRAX_DEF_R_SDRAM_TIMING
1898 + .dword R_DRAM_CONFIG
1900 + .dword R_DRAM_TIMING
1903 + .dword R_PORT_PA_SET
1904 + .dword PA_SET_VALUE
1905 + .dword R_PORT_PB_SET
1906 + .dword PB_SET_VALUE
1907 + .dword 0 ; No more register values
1908 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_MCM.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_MCM.S
1909 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_MCM.S 1970-01-01 01:00:00.000000000 +0100
1910 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_MCM.S 2007-05-28 20:11:31.000000000 +0200
1913 + * $Id: hw_settings.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $
1915 + * This table is used by some tools to extract hardware parameters.
1916 + * The table should be included in the kernel and the decompressor.
1917 + * Don't forget to update the tools if you change this table.
1919 + * Copyright (C) 2001 Axis Communications AB
1921 + * Authors: Mikael Starvik (starvik@axis.com)
1924 +#define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \
1925 + (CONFIG_ETRAX_DEF_R_PORT_PA_DATA))
1926 +#define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \
1927 + (CONFIG_ETRAX_DEF_R_PORT_PB_DIR << 8) | \
1928 + (CONFIG_ETRAX_DEF_R_PORT_PB_DATA))
1930 + .ascii "HW_PARAM_MAGIC" ; Magic number
1931 + .dword 0xc0004000 ; Kernel start address
1934 +#ifdef CONFIG_ETRAX_DEBUG_PORT0
1936 +#elif defined(CONFIG_ETRAX_DEBUG_PORT1)
1938 +#elif defined(CONFIG_ETRAX_DEBUG_PORT2)
1940 +#elif defined(CONFIG_ETRAX_DEBUG_PORT3)
1943 + .dword 4 ; No debug
1946 + ; SDRAM or EDO DRAM?
1947 +#ifdef CONFIG_ETRAX_SDRAM
1954 + .dword R_WAITSTATES
1955 + .dword CONFIG_ETRAX_DEF_R_WAITSTATES
1956 + .dword R_BUS_CONFIG
1957 + .dword CONFIG_ETRAX_DEF_R_BUS_CONFIG
1958 +#ifdef CONFIG_ETRAX_SDRAM
1959 + .dword R_SDRAM_CONFIG
1961 + .dword R_SDRAM_TIMING
1964 + .dword R_DRAM_CONFIG
1965 + .dword CONFIG_ETRAX_DEF_R_DRAM_CONFIG
1966 + .dword R_DRAM_TIMING
1967 + .dword CONFIG_ETRAX_DEF_R_DRAM_TIMING
1969 + .dword R_PORT_PA_SET
1970 + .dword PA_SET_VALUE
1971 + .dword R_PORT_PB_SET
1972 + .dword PB_SET_VALUE
1973 + .dword 0 ; No more register values