Merge branch 'master' of git://www.denx.de/git/u-boot-avr32
[platform/kernel/u-boot.git] / common / cmd_ide.c
index cac99d5..97a873d 100644 (file)
@@ -367,7 +367,7 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        image_header_t *hdr;
        int rcode = 0;
 #if defined(CONFIG_FIT)
-       const void *fit_hdr;
+       const void *fit_hdr = NULL;
 #endif
 
        show_boot_progress (41);
@@ -465,12 +465,6 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 #if defined(CONFIG_FIT)
        case IMAGE_FORMAT_FIT:
                fit_hdr = (const void *)addr;
-               if (!fit_check_format (fit_hdr)) {
-                       show_boot_progress (-140);
-                       puts ("** Bad FIT image format\n");
-                       return 1;
-               }
-               show_boot_progress (141);
                puts ("Fit image detected...\n");
 
                cnt = fit_get_size (fit_hdr);
@@ -496,8 +490,15 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 #if defined(CONFIG_FIT)
        /* This cannot be done earlier, we need complete FIT image in RAM first */
-       if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
-               fit_print_contents ((const void *)addr);
+       if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) {
+               if (!fit_check_format (fit_hdr)) {
+                       show_boot_progress (-140);
+                       puts ("** Bad FIT image format\n");
+                       return 1;
+               }
+               show_boot_progress (141);
+               fit_print_contents (fit_hdr);
+       }
 #endif
 
        /* Loading ok, update default load address */
@@ -1233,7 +1234,7 @@ static void ide_ident (block_dev_desc_t *dev_desc)
        dev_desc->blksz=ATA_BLOCKSIZE;
        dev_desc->lun=0; /* just to fill something in... */
 
-#if 0  /* only used to test the powersaving mode,
+#if 0  /* only used to test the powersaving mode,
         * if enabled, the drive goes after 5 sec
         * in standby mode */
        ide_outb (device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device));
@@ -1783,7 +1784,7 @@ unsigned char atapi_issue(int device,unsigned char* ccb,int ccblen, unsigned cha
        }
 
        output_data_shorts (device, (unsigned short *)ccb,ccblen/2); /* write command block */
-       /* ATAPI Command written wait for completition */
+       /* ATAPI Command written wait for completition */
        udelay (5000); /* device must set bsy */
 
        mask = ATA_STAT_DRQ|ATA_STAT_BUSY|ATA_STAT_ERR;
@@ -1852,7 +1853,7 @@ AI_OUT:
  * returns, an request_sense will be issued
  */
 
-#define ATAPI_DRIVE_NOT_READY  100
+#define ATAPI_DRIVE_NOT_READY  100
 #define ATAPI_UNIT_ATTN                10
 
 unsigned char atapi_issue_autoreq (int device,