]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - lib_arm/armlinux.c
* Code cleanup:
[people/ms/u-boot.git] / lib_arm / armlinux.c
index 2fb8db87107546832c511140d862031f0a47a0cd..8e06bd642774f2e518dd9a870d587ecbf4d432c0 100644 (file)
 
 #include <common.h>
 #include <command.h>
-#include <cmd_boot.h>
 #include <image.h>
 #include <zlib.h>
 #include <asm/byteorder.h>
+#ifdef CONFIG_HAS_DATAFLASH
+#include <dataflash.h>
+#endif
 
 #include <asm/setup.h>
 #define tag_size(type)  ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
 #define tag_next(t)     ((struct tag *)((u32 *)(t) + (t)->hdr.size))
 
+/*cmd_boot.c*/
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+
 #if defined (CONFIG_SETUP_MEMORY_TAGS) || \
     defined (CONFIG_CMDLINE_TAG) || \
     defined (CONFIG_INITRD_TAG) || \
@@ -94,6 +99,11 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        printf ("## Loading Ramdisk Image at %08lx ...\n", addr);
 
        /* Copy header so we can blank CRC field for re-calculation */
+#ifdef CONFIG_HAS_DATAFLASH
+       if (addr_dataflash(addr)){
+               read_dataflash(addr, sizeof(image_header_t), (char *)&header);
+       } else
+#endif
        memcpy (&header, (char *)addr, sizeof(image_header_t));
 
        if (ntohl(hdr->ih_magic) != IH_MAGIC) {
@@ -121,6 +131,13 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        data = addr + sizeof(image_header_t);
        len  = ntohl(hdr->ih_size);
 
+#ifdef CONFIG_HAS_DATAFLASH
+       if (addr_dataflash(addr)){
+               read_dataflash(data, len, (char *)CFG_LOAD_ADDR);
+               data = CFG_LOAD_ADDR;
+       }
+#endif
+
        if (verify) {
            ulong csum = 0;
 
@@ -128,7 +145,7 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
            csum = crc32 (0, (char *)data, len);
            if (csum != ntohl(hdr->ih_dcrc)) {
                printf ("Bad Data CRC\n");
-               SHOW_BOOT_PROGRESS (-12);
+               SHOW_BOOT_PROGRESS (-12);
                do_reset (cmdtp, flag, argc, argv);
            }
            printf ("OK\n");
@@ -170,7 +187,7 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        /*
         * no initrd image
         */
-        SHOW_BOOT_PROGRESS (14);
+       SHOW_BOOT_PROGRESS (14);
 
        data = 0;
     }