summaryrefslogtreecommitdiff
path: root/board/trab
diff options
context:
space:
mode:
Diffstat (limited to 'board/trab')
-rw-r--r--board/trab/auto_update.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/board/trab/auto_update.c b/board/trab/auto_update.c
index bd9ee0c..8f67535 100644
--- a/board/trab/auto_update.c
+++ b/board/trab/auto_update.c
@@ -211,6 +211,12 @@ au_check_cksum_valid(int idx, long nbytes)
image_header_t *hdr;
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
if (nbytes != image_get_image_size (hdr))
{
@@ -234,6 +240,13 @@ au_check_header_valid(int idx, long nbytes)
unsigned char buf[4];
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
+
/* check the easy ones first */
#undef CHECK_VALID_DEBUG
#ifdef CHECK_VALID_DEBUG
@@ -327,6 +340,12 @@ au_do_update(int idx, long sz)
uint nbytes;
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
/* disable the power switch */
*CPLD_VFD_BK |= POWER_OFF;
@@ -417,6 +436,13 @@ au_update_eeprom(int idx)
}
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
+
/* write the time field into EEPROM */
off = auee_off[idx].time;
val = image_get_time (hdr);