aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v10/boot
diff options
context:
space:
mode:
authorMikael Starvik <mikael.starvik@axis.com>2005-07-27 14:44:38 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-27 19:26:00 -0400
commit7cf32cad153d63ac4f6f2d5dd16ddd32ad72d578 (patch)
tree1072d64f49092ba87ff0d5079e37f58f646f7356 /arch/cris/arch-v10/boot
parent2e0cea1decf7f21df0496571c218df3b3b8cce99 (diff)
[PATCH] CRIS update: misc patches
* Start threads with IRQs enabled. * Move symbol exports to arch specific file. * Prepare for real command line in the future. * Handle csum for partition that crosses flash boundary. * Set utsname. Signed-off-by: Mikael Starvik <starvik@axis.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/cris/arch-v10/boot')
-rw-r--r--arch/cris/arch-v10/boot/compressed/head.S22
-rw-r--r--arch/cris/arch-v10/boot/rescue/head.S33
2 files changed, 46 insertions, 9 deletions
diff --git a/arch/cris/arch-v10/boot/compressed/head.S b/arch/cris/arch-v10/boot/compressed/head.S
index 4cbdd4b1d9d6..e73f44c998d9 100644
--- a/arch/cris/arch-v10/boot/compressed/head.S
+++ b/arch/cris/arch-v10/boot/compressed/head.S
@@ -13,7 +13,8 @@
13#include <asm/arch/sv_addr_ag.h> 13#include <asm/arch/sv_addr_ag.h>
14 14
15#define RAM_INIT_MAGIC 0x56902387 15#define RAM_INIT_MAGIC 0x56902387
16 16#define COMMAND_LINE_MAGIC 0x87109563
17
17 ;; Exported symbols 18 ;; Exported symbols
18 19
19 .globl _input_data 20 .globl _input_data
@@ -88,6 +89,12 @@ basse: move.d pc, r5
88 cmp.d r2, r1 89 cmp.d r2, r1
89 bcs 1b 90 bcs 1b
90 nop 91 nop
92
93 ;; Save command line magic and address.
94 move.d _cmd_line_magic, $r12
95 move.d $r10, [$r12]
96 move.d _cmd_line_addr, $r12
97 move.d $r11, [$r12]
91 98
92 ;; Do the decompression and save compressed size in _inptr 99 ;; Do the decompression and save compressed size in _inptr
93 100
@@ -98,7 +105,13 @@ basse: move.d pc, r5
98 105
99 move.d [_input_data], r9 ; flash address of compressed kernel 106 move.d [_input_data], r9 ; flash address of compressed kernel
100 add.d [_inptr], r9 ; size of compressed kernel 107 add.d [_inptr], r9 ; size of compressed kernel
101 108
109 ;; Restore command line magic and address.
110 move.d _cmd_line_magic, $r10
111 move.d [$r10], $r10
112 move.d _cmd_line_addr, $r11
113 move.d [$r11], $r11
114
102 ;; Enter the decompressed kernel 115 ;; Enter the decompressed kernel
103 move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized 116 move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized
104 jump 0x40004000 ; kernel is linked to this address 117 jump 0x40004000 ; kernel is linked to this address
@@ -107,5 +120,8 @@ basse: move.d pc, r5
107 120
108_input_data: 121_input_data:
109 .dword 0 ; used by the decompressor 122 .dword 0 ; used by the decompressor
110 123_cmd_line_magic:
124 .dword 0
125_cmd_line_addr:
126 .dword 0
111#include "../../lib/hw_settings.S" 127#include "../../lib/hw_settings.S"
diff --git a/arch/cris/arch-v10/boot/rescue/head.S b/arch/cris/arch-v10/boot/rescue/head.S
index 8689ea972c46..addb2194de0f 100644
--- a/arch/cris/arch-v10/boot/rescue/head.S
+++ b/arch/cris/arch-v10/boot/rescue/head.S
@@ -1,4 +1,4 @@
1/* $Id: head.S,v 1.6 2003/04/09 08:12:43 pkj Exp $ 1/* $Id: head.S,v 1.7 2005/03/07 12:11:06 starvik Exp $
2 * 2 *
3 * Rescue code, made to reside at the beginning of the 3 * Rescue code, made to reside at the beginning of the
4 * flash-memory. when it starts, it checks a partition 4 * flash-memory. when it starts, it checks a partition
@@ -121,12 +121,13 @@
121 ;; 0x80000000 if loaded in flash (as it should be) 121 ;; 0x80000000 if loaded in flash (as it should be)
122 ;; since etrax actually starts at address 2 when booting from flash, we 122 ;; since etrax actually starts at address 2 when booting from flash, we
123 ;; put a nop (2 bytes) here first so we dont accidentally skip the di 123 ;; put a nop (2 bytes) here first so we dont accidentally skip the di
124 124
125 nop 125 nop
126 di 126 di
127 127
128 jump in_cache ; enter cached area instead 128 jump in_cache ; enter cached area instead
129in_cache: 129in_cache:
130
130 131
131 ;; first put a jump test to give a possibility of upgrading the rescue code 132 ;; first put a jump test to give a possibility of upgrading the rescue code
132 ;; without erasing/reflashing the sector. we put a longword of -1 here and if 133 ;; without erasing/reflashing the sector. we put a longword of -1 here and if
@@ -325,9 +326,29 @@ flash_ok:
325 ;; result will be in r0 326 ;; result will be in r0
326checksum: 327checksum:
327 moveq 0, $r0 328 moveq 0, $r0
3281: addu.b [$r1+], $r0 329 moveq CONFIG_ETRAX_FLASH1_SIZE, $r6
329 subq 1, $r2 330
330 bne 1b 331 ;; If the first physical flash memory is exceeded wrap to the second one.
332 btstq 26, $r1 ; Are we addressing first flash?
333 bpl 1f
334 nop
335 clear.d $r6
336
3371: test.d $r6 ; 0 = no wrapping
338 beq 2f
339 nop
340 lslq 20, $r6 ; Convert MB to bytes
341 sub.d $r1, $r6
342
3432: addu.b [$r1+], $r0
344 subq 1, $r6 ; Flash memory left
345 beq 3f
346 subq 1, $r2 ; Length left
347 bne 2b
331 nop 348 nop
332 ret 349 ret
333 nop 350 nop
351
3523: move.d MEM_CSE1_START, $r1 ; wrap to second flash
353 ba 2b
354 nop