dm36x: revert cache disable patch
[oweals/u-boot.git] / board / mcc200 / auto_update.c
index 8b520c859942f9a95e6cd71b72b2d5307cc20dbe..49213d0b388f87f07d38c28d2cf61ae6ed525c20 100644 (file)
@@ -25,7 +25,7 @@
 #include <usb.h>
 #include <part.h>
 
-#ifdef CFG_HUSH_PARSER
+#ifdef CONFIG_SYS_HUSH_PARSER
 #include <hush.h>
 #endif
 
@@ -40,8 +40,8 @@
 #error "must define CONFIG_USB_STORAGE"
 #endif
 
-#ifndef CFG_HUSH_PARSER
-#error "must define CFG_HUSH_PARSER"
+#ifndef CONFIG_SYS_HUSH_PARSER
+#error "must define CONFIG_SYS_HUSH_PARSER"
 #endif
 
 #if !defined(CONFIG_CMD_FAT)
@@ -143,6 +143,12 @@ int au_check_cksum_valid(int idx, long nbytes)
        image_header_t *hdr;
 
        hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+       if (genimg_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)) {
                printf ("Image %s bad total SIZE\n", aufile[idx]);
@@ -162,6 +168,13 @@ int au_check_header_valid(int idx, long nbytes)
        unsigned long checksum, fsize;
 
        hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+       if (genimg_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
@@ -233,6 +246,12 @@ int au_do_update(int idx, long sz)
        uint nbytes;
 
        hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
+#endif
 
        /* execute a script */
        if (image_check_type (hdr, IH_TYPE_SCRIPT)) {
@@ -472,7 +491,7 @@ int do_auto_update(void)
                        aufile[i], sz, image_get_header_size ());
 
                if (sz != ausize[i]) {
-                       printf ("%s: size %d read %d?\n", aufile[i], ausize[i], sz);
+                       printf ("%s: size %ld read %ld?\n", aufile[i], ausize[i], sz);
                        continue;
                }