diff options
author | Florian Fainelli <florian@openwrt.org> | 2007-03-26 07:32:10 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2007-03-26 07:32:10 +0000 |
commit | 0bc2ef44fca165c83c4372cd8cfde5ad93524e0f (patch) | |
tree | ed167fa9e9f43744ad7ad709509d12c1a2eea834 /target/linux/adm5120-2.6/image/lzma-loader/src/head.S | |
parent | 640ac733dabdc208aa25b896e06c3957fda0286e (diff) | |
download | upstream-0bc2ef44fca165c83c4372cd8cfde5ad93524e0f.tar.gz upstream-0bc2ef44fca165c83c4372cd8cfde5ad93524e0f.tar.bz2 upstream-0bc2ef44fca165c83c4372cd8cfde5ad93524e0f.zip |
Preserve fw_arg0-3 to allow runtime bootloader detection (Gabor Juhos)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6711 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/adm5120-2.6/image/lzma-loader/src/head.S')
-rw-r--r-- | target/linux/adm5120-2.6/image/lzma-loader/src/head.S | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/target/linux/adm5120-2.6/image/lzma-loader/src/head.S b/target/linux/adm5120-2.6/image/lzma-loader/src/head.S index 9bfbd53d51..7f0e9adc0d 100644 --- a/target/linux/adm5120-2.6/image/lzma-loader/src/head.S +++ b/target/linux/adm5120-2.6/image/lzma-loader/src/head.S @@ -1,3 +1,6 @@ +/* Copyright 2007 Gabor Juhos */ +/* keep original values of the a0,a1,a2,a3 registers */ +/* cache manipulation adapted from Broadcom code */ /* Copyright 2005 Oleg I. Vdovikin (oleg@cs.msu.su) */ /* cache manipulation adapted from Broadcom code */ /* idea taken from original bunzip2 decompressor code */ @@ -40,18 +43,17 @@ .set noreorder /* Copy decompressor code to the right place */ - li t2, BZ_TEXT_START - add a0, t2, 0 - la a1, code_start - la a2, code_stop + li t0, BZ_TEXT_START + + la t1, code_start + la t2, code_stop $L1: - lw t0, 0(a1) - sw t0, 0(a0) - add a1, 4 - add a0, 4 - blt a1, a2, $L1 - nop - + lw t3, 0(t1) + sw t3, 0(t0) + add t1, 4 + blt t1, t2, $L1 + add t0, 4 + /* At this point we need to invalidate dcache and */ /* icache before jumping to new code */ @@ -145,11 +147,20 @@ nodc: addu t0,s3 noic: - move a0,s3 /* icache line size */ - move a1,s4 /* icache size */ - move a2,s1 /* dcache line size */ - jal t2 - move a3,s2 /* dcache size */ + li t0, BZ_TEXT_START + + addiu sp, -32 /* reserve stack for parameters */ +#if 0 + sw a0, 0(sp) + sw a1, 4(sp) + sw a2, 8(sp) + sw a3, 12(sp) +#endif + sw s3, 16(sp) /* icache line size */ + sw s4, 20(sp) /* icache size */ + sw s1, 24(sp) /* dcache line size */ + jr t0 + sw s2, 28(sp) /* dcache size */ .set reorder END(startup) |