]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/trab/auto_update.c
rename CFG_ macros to CONFIG_SYS
[karo-tx-uboot.git] / board / trab / auto_update.c
index 8f6753592b6fb08f6543bfdcdc03386f4cd22681..99327906b8339ef1fa032f8bc6ff6759377fa09f 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/byteorder.h>
 #include <usb.h>
 
-#ifdef CFG_HUSH_PARSER
+#ifdef CONFIG_SYS_HUSH_PARSER
 #include <hush.h>
 #endif
 
@@ -42,8 +42,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)
@@ -212,20 +212,18 @@ au_check_cksum_valid(int idx, long nbytes)
 
        hdr = (image_header_t *)LOAD_ADDR;
 #if defined(CONFIG_FIT)
-       if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+       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))
-       {
+       if (nbytes != image_get_image_size (hdr)) {
                printf ("Image %s bad total SIZE\n", aufile[idx]);
                return -1;
        }
        /* check the data CRC */
        if (!image_check_dcrc (hdr)) {
-       {
                printf ("Image %s bad data checksum\n", aufile[idx]);
                return -1;
        }
@@ -241,7 +239,7 @@ au_check_header_valid(int idx, long nbytes)
 
        hdr = (image_header_t *)LOAD_ADDR;
 #if defined(CONFIG_FIT)
-       if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
                puts ("Non legacy image format not supported\n");
                return -1;
        }
@@ -255,13 +253,11 @@ au_check_header_valid(int idx, long nbytes)
        printf("size %#x %#lx ", image_get_data_size (hdr), nbytes);
        printf("type %#x %#x ", image_get_type (hdr), IH_TYPE_KERNEL);
 #endif
-       if (nbytes < image_get_header_size ())
-       {
+       if (nbytes < image_get_header_size ()) {
                printf ("Image %s bad header SIZE\n", aufile[idx]);
                return -1;
        }
-       if (!image_check_magic (hdr) || !image_check_arch (hdr, IH_ARCH_ARM))
-       {
+       if (!image_check_magic (hdr) || !image_check_arch (hdr, IH_ARCH_ARM)) {
                printf ("Image %s bad MAGIC or ARCH\n", aufile[idx]);
                return -1;
        }
@@ -271,7 +267,8 @@ au_check_header_valid(int idx, long nbytes)
                return -1;
        }
        /* check the type - could do this all in one gigantic if() */
-       if ((idx == IDX_FIRMWARE) && !image_check_type (hdr, IH_TYPE_FIRMWARE)) {
+       if ((idx == IDX_FIRMWARE) &&
+               !image_check_type (hdr, IH_TYPE_FIRMWARE)) {
                printf ("Image %s wrong type\n", aufile[idx]);
                return -1;
        }
@@ -284,13 +281,12 @@ au_check_header_valid(int idx, long nbytes)
                return -1;
        }
        if ((idx == IDX_APP) && !image_check_type (hdr, IH_TYPE_RAMDISK)
-           && !image_check_type (hdr, FILESYSTEM)) {
+               && !image_check_type (hdr, IH_TYPE_FILESYSTEM)) {
                printf ("Image %s wrong type\n", aufile[idx]);
                return -1;
        }
        if ((idx == IDX_PREPARE || idx == IDX_PREINST || idx == IDX_POSTINST)
-               && !image_check_type (hdr, IH_TYPE_SCRIPT))
-       {
+               && !image_check_type (hdr, IH_TYPE_SCRIPT)) {
                printf ("Image %s wrong type\n", aufile[idx]);
                return -1;
        }
@@ -341,7 +337,7 @@ au_do_update(int idx, long sz)
 
        hdr = (image_header_t *)LOAD_ADDR;
 #if defined(CONFIG_FIT)
-       if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
                puts ("Non legacy image format not supported\n");
                return -1;
        }
@@ -437,7 +433,7 @@ 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) {
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
                puts ("Non legacy image format not supported\n");
                return -1;
        }