summaryrefslogtreecommitdiff
path: root/utils/AMS/hacking/test.S
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2008-10-02 12:37:47 +0000
committerDave Chapman <dave@dchapman.com>2008-10-02 12:37:47 +0000
commitc2933cd46e7a84df24acf488249f62f9ec090759 (patch)
tree34a0850ee83e61b890fcd74856f79ada9c2187b9 /utils/AMS/hacking/test.S
parentd1d8b4ca555b47f190a075efb83f66738477b485 (diff)
downloadrockbox-c2933cd46e7a84df24acf488249f62f9ec090759.tar.gz
rockbox-c2933cd46e7a84df24acf488249f62f9ec090759.zip
Remove the dependency on sufficient free space in the padding at the end of the firmware block by storing the ucl unpack function in the main firmware block, immediately before the compressed firmware image. Also simplify the memcpy function in test.S. This has been tested successfully on a Clip.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18682 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/AMS/hacking/test.S')
-rw-r--r--utils/AMS/hacking/test.S21
1 files changed, 10 insertions, 11 deletions
diff --git a/utils/AMS/hacking/test.S b/utils/AMS/hacking/test.S
index 79d23deb6a..a4757b44ce 100644
--- a/utils/AMS/hacking/test.S
+++ b/utils/AMS/hacking/test.S
@@ -16,10 +16,11 @@
16.word 0 16.word 0
17 17
18/* These values are filled in by mkamsboot - don't move them from offset 0x20 */ 18/* These values are filled in by mkamsboot - don't move them from offset 0x20 */
19ucl_unpack: .word 0 /* Entry point (plus 1 - for thumb) of ucl_unpack */ 19ucl_unpack: .word 0 /* Entry point (plus 1 - for thumb) of ucl_unpack after copy*/
20ucl_start: .word 0 /* Start of the ucl-compressed OF image */ 20ucl_start: .word 0 /* Start of the ucl-compressed OF image after copy */
21ucl_size: .word 0 /* Length in bytes of the compressed OF image */ 21ucl_size: .word 0 /* Length in bytes of the compressed OF image */
22 22copy_start: .word 0 /* Start of the copy of the ucl_unpack function */
23copy_size: .word 0 /* uclunpack_size + ucl_paddedsize */
23 24
24start: 25start:
25 /* A delay loop - just to prove we're running */ 26 /* A delay loop - just to prove we're running */
@@ -29,25 +30,23 @@ loop: subs r1, r1, #1
29 30
30 /* First copy the compressed firmware to unused RAM */ 31 /* First copy the compressed firmware to unused RAM */
31 32
32 ldr r0, ucl_start /* Source */ 33 ldr r0, copy_start /* Source */
33 ldr r1, ucl_size /* Source length */ 34 ldr r1, copy_size /* Source length */
34 35
35 mov r2, #0x40000 /* Destination end */ 36 mov r2, #0x40000 /* Destination end */
36 sub r2, r2, r1 37 sub r2, r2, r1
37 38
38memcpy: 39memcpy:
39 ldrb r3, [r0] 40 ldrb r3, [r0], #1
40 strb r3, [r2] 41 strb r3, [r2], #1
41 adds r0, r0, #1
42 adds r2, r2, #1
43 cmp r2, #0x40000 /* Stop when we reached dest_end */ 42 cmp r2, #0x40000 /* Stop when we reached dest_end */
44 bne memcpy 43 bne memcpy
45 44
46 sub r0, r2, r1 /* Point to the compressed firmware */
47
48 /* Call the ucl decompress function, which will branch to 0x0 */ 45 /* Call the ucl decompress function, which will branch to 0x0 */
49 /* on completion */ 46 /* on completion */
50 47
48 ldr r0, ucl_start /* Address of compressed image */
49 ldr r1, ucl_size /* Compressed size */
51 mov r2, #0 /* Destination */ 50 mov r2, #0 /* Destination */
52 51
53 ldr r3, ucl_unpack 52 ldr r3, ucl_unpack