summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rbutil/mkamsboot/dualboot.S2
-rw-r--r--rbutil/mkamsboot/mkamsboot.c8
2 files changed, 4 insertions, 6 deletions
diff --git a/rbutil/mkamsboot/dualboot.S b/rbutil/mkamsboot/dualboot.S
index 786f610aef..471158e9a8 100644
--- a/rbutil/mkamsboot/dualboot.S
+++ b/rbutil/mkamsboot/dualboot.S
@@ -39,7 +39,7 @@ start:
ldr r1, uclunpack_size /* Source length */
sub r2, r0, r1 /* Source start - 1*/
- ldr r3, =DRAM_SIZE /* Destination end */
+ ldr r3, =(DRAM_SIZE-1) /* Destination end */
uclcopy:
ldrb r4, [r0], #-1
diff --git a/rbutil/mkamsboot/mkamsboot.c b/rbutil/mkamsboot/mkamsboot.c
index e617b1204a..7e72d6cc3c 100644
--- a/rbutil/mkamsboot/mkamsboot.c
+++ b/rbutil/mkamsboot/mkamsboot.c
@@ -279,8 +279,6 @@ int main(int argc, char* argv[])
unsigned char* buf;
int firmware_size;
off_t bootloader_size;
- uint32_t ucl_size;
- uint32_t ucl_paddedsize;
uint32_t sum,filesum;
uint8_t model_id;
int model;
@@ -419,15 +417,15 @@ int main(int argc, char* argv[])
in each image, along with the size in bytes */
/* UCL unpack function */
- put_uint32le(&buf[0x420], firmware_size);
+ put_uint32le(&buf[0x420], firmware_size - 1);
put_uint32le(&buf[0x424], sizeof(uclimg));
/* Compressed original firmware image */
- put_uint32le(&buf[0x428], firmware_size - sizeof(uclimg));
+ put_uint32le(&buf[0x428], firmware_size - sizeof(uclimg) - 1);
put_uint32le(&buf[0x42c], of_packedsize);
/* Compressed Rockbox image */
- put_uint32le(&buf[0x430], firmware_size - sizeof(uclimg) - of_packedsize);
+ put_uint32le(&buf[0x430], firmware_size - sizeof(uclimg) - of_packedsize - 1);
put_uint32le(&buf[0x434], rb_packedsize);