diff options
Diffstat (limited to 'utils/AMS/hacking/test.S')
-rw-r--r-- | utils/AMS/hacking/test.S | 21 |
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 */ |
19 | ucl_unpack: .word 0 /* Entry point (plus 1 - for thumb) of ucl_unpack */ | 19 | ucl_unpack: .word 0 /* Entry point (plus 1 - for thumb) of ucl_unpack after copy*/ |
20 | ucl_start: .word 0 /* Start of the ucl-compressed OF image */ | 20 | ucl_start: .word 0 /* Start of the ucl-compressed OF image after copy */ |
21 | ucl_size: .word 0 /* Length in bytes of the compressed OF image */ | 21 | ucl_size: .word 0 /* Length in bytes of the compressed OF image */ |
22 | 22 | copy_start: .word 0 /* Start of the copy of the ucl_unpack function */ | |
23 | copy_size: .word 0 /* uclunpack_size + ucl_paddedsize */ | ||
23 | 24 | ||
24 | start: | 25 | start: |
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 | ||
38 | memcpy: | 39 | memcpy: |
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 |