Merge branch 'next' of git://git.denx.de/u-boot-avr32
[platform/kernel/u-boot.git] / common / cmd_doc.c
index 83aba37..a55ca41 100644 (file)
 #include <linux/mtd/nftl.h>
 #include <linux/mtd/doc2000.h>
 
+/*
+ * ! BROKEN !
+ *
+ * TODO: must be implemented and tested by someone with HW
+ */
+#if 0
 #ifdef CFG_DOC_SUPPORT_2000
 #define DoC_is_2000(doc) (doc->ChipID == DOC_ChipID_Doc2k)
 #else
@@ -206,7 +212,7 @@ int do_docboot (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 (34);
@@ -275,12 +281,6 @@ int do_docboot (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 (-130);
-                       puts ("** Bad FIT image format\n");
-                       return 1;
-               }
-               show_boot_progress (131);
                puts ("Fit image detected...\n");
 
                cnt = fit_get_size (fit_hdr);
@@ -304,8 +304,15 @@ int do_docboot (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 (-130);
+                       puts ("** Bad FIT image format\n");
+                       return 1;
+               }
+               show_boot_progress (131);
+               fit_print_contents (fit_hdr);
+       }
 #endif
 
        /* Loading ok, update default load address */
@@ -1628,3 +1635,6 @@ void doc_probe(unsigned long physadr)
                puts ("No DiskOnChip found\n");
        }
 }
+#else
+void doc_probe(unsigned long physadr) {}
+#endif