summaryrefslogtreecommitdiff
path: root/rbutil/mktccboot/mktccboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/mktccboot/mktccboot.c')
-rw-r--r--rbutil/mktccboot/mktccboot.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/rbutil/mktccboot/mktccboot.c b/rbutil/mktccboot/mktccboot.c
index 432bc03213..7103f23895 100644
--- a/rbutil/mktccboot/mktccboot.c
+++ b/rbutil/mktccboot/mktccboot.c
@@ -175,6 +175,12 @@ error:
175 return NULL; 175 return NULL;
176} 176}
177 177
178/* A CRC test in order to reject non OF file */
179int test_firmware_tcc(unsigned char* buf, int length)
180{
181 return telechips_test_crc(buf, length);
182}
183
178#ifndef LIB 184#ifndef LIB
179int main(int argc, char *argv[]) 185int main(int argc, char *argv[])
180{ 186{
@@ -185,7 +191,7 @@ int main(int argc, char *argv[])
185 unsigned char *boot_buf = NULL; 191 unsigned char *boot_buf = NULL;
186 unsigned char* image = NULL; 192 unsigned char* image = NULL;
187 int ret = 0; 193 int ret = 0;
188 194
189 if(argc < 3) { 195 if(argc < 3) {
190 usage(); 196 usage();
191 } 197 }
@@ -202,6 +208,14 @@ int main(int argc, char *argv[])
202 goto error_exit; 208 goto error_exit;
203 } 209 }
204 210
211 /* Validate input file */
212 if (test_firmware_tcc(of_buf, of_size))
213 {
214 printf("[ERR] Unknown OF file used, aborting\n");
215 ret = 2;
216 goto error_exit;
217 }
218
205 boot_buf = file_read(bootfile, &boot_size); 219 boot_buf = file_read(bootfile, &boot_size);
206 if (!boot_buf) 220 if (!boot_buf)
207 { 221 {