diff options
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/mkamsboot/Makefile | 32 | ||||
-rw-r--r-- | rbutil/mkamsboot/mkamsboot.c | 9 |
2 files changed, 21 insertions, 20 deletions
diff --git a/rbutil/mkamsboot/Makefile b/rbutil/mkamsboot/Makefile index 93a25aee00..287ea9b72f 100644 --- a/rbutil/mkamsboot/Makefile +++ b/rbutil/mkamsboot/Makefile | |||
@@ -10,8 +10,8 @@ LIBUCL=../../tools/ucl/src/libucl.a | |||
10 | # | 10 | # |
11 | # If anyone reading this wants to improve this makefile, please do! | 11 | # If anyone reading this wants to improve this makefile, please do! |
12 | 12 | ||
13 | BOOTIMAGES = bootimg_clip.o bootimg_e200v2.o bootimg_m200v2.o bootimg_fuze.o | 13 | BOOTIMAGES = bootimg_clip.o bootimg_e200v2.o bootimg_m200v4.o bootimg_fuze.o |
14 | BOOTHEADERS = bootimg_clip.h bootimg_e200v2.h bootimg_m200v2.h bootimg_fuze.h | 14 | BOOTHEADERS = bootimg_clip.h bootimg_e200v2.h bootimg_m200v4.h bootimg_fuze.h |
15 | 15 | ||
16 | CLIPFILES = dualboot-clip.o dualboot-clip.elf dualboot-clip.o \ | 16 | CLIPFILES = dualboot-clip.o dualboot-clip.elf dualboot-clip.o \ |
17 | dualboot-clip.bin bootimg_clip.c bootimg_clip.h | 17 | dualboot-clip.bin bootimg_clip.c bootimg_clip.h |
@@ -19,8 +19,8 @@ CLIPFILES = dualboot-clip.o dualboot-clip.elf dualboot-clip.o \ | |||
19 | E200V2FILES = dualboot-e200v2.o dualboot-e200v2.elf dualboot-e200v2.o \ | 19 | E200V2FILES = dualboot-e200v2.o dualboot-e200v2.elf dualboot-e200v2.o \ |
20 | dualboot-e200v2.bin bootimg_e200v2.c bootimg_e200v2.h | 20 | dualboot-e200v2.bin bootimg_e200v2.c bootimg_e200v2.h |
21 | 21 | ||
22 | M200V2FILES = dualboot-m200v2.o dualboot-m200v2.elf dualboot-m200v2.o \ | 22 | M200V4FILES = dualboot-m200v4.o dualboot-m200v4.elf dualboot-m200v4.o \ |
23 | dualboot-m200v2.bin bootimg_m200v2.c bootimg_m200v2.h | 23 | dualboot-m200v4.bin bootimg_m200v4.c bootimg_m200v4.h |
24 | 24 | ||
25 | FUZEFILES = dualboot-fuze.o dualboot-fuze.elf dualboot-fuze.o \ | 25 | FUZEFILES = dualboot-fuze.o dualboot-fuze.elf dualboot-fuze.o \ |
26 | dualboot-fuze.bin bootimg_fuze.c bootimg_fuze.h | 26 | dualboot-fuze.bin bootimg_fuze.c bootimg_fuze.h |
@@ -93,22 +93,22 @@ bootimg_e200v2.c bootimg_e200v2.h: dualboot-e200v2.bin bin2c | |||
93 | bootimg_e200v2.o: bootimg_e200v2.c | 93 | bootimg_e200v2.o: bootimg_e200v2.c |
94 | gcc -c -o bootimg_e200v2.o bootimg_e200v2.c | 94 | gcc -c -o bootimg_e200v2.o bootimg_e200v2.c |
95 | 95 | ||
96 | # M200V2 | 96 | # M200V4 |
97 | 97 | ||
98 | dualboot-m200v2.o: dualboot.S | 98 | dualboot-m200v4.o: dualboot.S |
99 | arm-elf-gcc -DSANSA_M200V2 -c -o dualboot-m200v2.o dualboot.S | 99 | arm-elf-gcc -DSANSA_M200V4 -c -o dualboot-m200v4.o dualboot.S |
100 | 100 | ||
101 | dualboot-m200v2.elf: dualboot-m200v2.o | 101 | dualboot-m200v4.elf: dualboot-m200v4.o |
102 | arm-elf-ld -e 0 -Ttext=0 -o dualboot-m200v2.elf dualboot-m200v2.o | 102 | arm-elf-ld -e 0 -Ttext=0 -o dualboot-m200v4.elf dualboot-m200v4.o |
103 | 103 | ||
104 | dualboot-m200v2.bin: dualboot-m200v2.elf | 104 | dualboot-m200v4.bin: dualboot-m200v4.elf |
105 | arm-elf-objcopy -O binary dualboot-m200v2.elf dualboot-m200v2.bin | 105 | arm-elf-objcopy -O binary dualboot-m200v4.elf dualboot-m200v4.bin |
106 | 106 | ||
107 | bootimg_m200v2.c bootimg_m200v2.h: dualboot-m200v2.bin bin2c | 107 | bootimg_m200v4.c bootimg_m200v4.h: dualboot-m200v4.bin bin2c |
108 | ./bin2c dualboot-m200v2.bin bootimg_m200v2 | 108 | ./bin2c dualboot-m200v4.bin bootimg_m200v4 |
109 | 109 | ||
110 | bootimg_m200v2.o: bootimg_m200v2.c | 110 | bootimg_m200v4.o: bootimg_m200v4.c |
111 | gcc -c -o bootimg_m200v2.o bootimg_m200v2.c | 111 | gcc -c -o bootimg_m200v4.o bootimg_m200v4.c |
112 | 112 | ||
113 | # Rules for the ucl unpack function | 113 | # Rules for the ucl unpack function |
114 | nrv2e_d8.o: nrv2e_d8.S | 114 | nrv2e_d8.o: nrv2e_d8.S |
@@ -134,4 +134,4 @@ bin2c: bin2c.c | |||
134 | clean: | 134 | clean: |
135 | rm -f mkamsboot mkamsboot.o nrv2e_d8.o nrv2e_d8.elf nrv2e_d8.bin *~ \ | 135 | rm -f mkamsboot mkamsboot.o nrv2e_d8.o nrv2e_d8.elf nrv2e_d8.bin *~ \ |
136 | bin2c uclimg.c uclimg.h uclimg.o md5.o \ | 136 | bin2c uclimg.c uclimg.h uclimg.o md5.o \ |
137 | $(BOOTIMAGES) $(CLIPFILES) $(E200V2FILES) $(M200V2FILES) $(FUZEFILES) | 137 | $(BOOTIMAGES) $(CLIPFILES) $(E200V2FILES) $(M200V4FILES) $(FUZEFILES) |
diff --git a/rbutil/mkamsboot/mkamsboot.c b/rbutil/mkamsboot/mkamsboot.c index 476bdf2158..e9438b317d 100644 --- a/rbutil/mkamsboot/mkamsboot.c +++ b/rbutil/mkamsboot/mkamsboot.c | |||
@@ -92,7 +92,7 @@ execution to the uncompressed firmware. | |||
92 | #include "bootimg_clip.h" | 92 | #include "bootimg_clip.h" |
93 | #include "bootimg_e200v2.h" | 93 | #include "bootimg_e200v2.h" |
94 | #include "bootimg_fuze.h" | 94 | #include "bootimg_fuze.h" |
95 | #include "bootimg_m200v2.h" | 95 | #include "bootimg_m200v4.h" |
96 | 96 | ||
97 | /* Win32 compatibility */ | 97 | /* Win32 compatibility */ |
98 | #ifndef O_BINARY | 98 | #ifndef O_BINARY |
@@ -130,7 +130,7 @@ static const unsigned char* bootloaders[] = | |||
130 | bootimg_clip, | 130 | bootimg_clip, |
131 | NULL, | 131 | NULL, |
132 | bootimg_e200v2, | 132 | bootimg_e200v2, |
133 | bootimg_m200v2, | 133 | bootimg_m200v4, |
134 | NULL | 134 | NULL |
135 | }; | 135 | }; |
136 | 136 | ||
@@ -140,7 +140,7 @@ static const int bootloader_sizes[] = | |||
140 | sizeof(bootimg_clip), | 140 | sizeof(bootimg_clip), |
141 | 0, | 141 | 0, |
142 | sizeof(bootimg_e200v2), | 142 | sizeof(bootimg_e200v2), |
143 | sizeof(bootimg_m200v2), | 143 | sizeof(bootimg_m200v4), |
144 | 0 | 144 | 0 |
145 | }; | 145 | }; |
146 | 146 | ||
@@ -485,7 +485,8 @@ int main(int argc, char* argv[]) | |||
485 | } | 485 | } |
486 | 486 | ||
487 | 487 | ||
488 | /* TODO: Do some more sanity checks on the OF image. Some images (like m200v2) dont have a checksum at the end, only padding (0xdeadbeef). */ | 488 | /* TODO: Do some more sanity checks on the OF image. Some images (like |
489 | m200v4) dont have a checksum at the end, only padding (0xdeadbeef). */ | ||
489 | checksum = get_uint32le(buf + len - 4); | 490 | checksum = get_uint32le(buf + len - 4); |
490 | if (checksum != 0xefbeadde && checksum != calc_checksum(buf, len - 4)) { | 491 | if (checksum != 0xefbeadde && checksum != calc_checksum(buf, len - 4)) { |
491 | 492 | ||