]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_autoscript.c
Merge with /home/wd/git/u-boot/master
[karo-tx-uboot.git] / common / cmd_autoscript.c
index d3d04c3040a9e3ec06e9480a72a41f4057382a0e..e3253022dc92a08f8057af9d33472ff2ad1a0b92 100644 (file)
@@ -47,7 +47,6 @@
 #include <hush.h>
 #endif
 
-#define AUTOSCRIPT_MAGIC       0x09011962
 #if defined(CONFIG_AUTOSCRIPT) || \
         (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT )
 
@@ -69,7 +68,7 @@ autoscript (ulong addr)
        memmove (hdr, (char *)addr, sizeof(image_header_t));
 
        if (ntohl(hdr->ih_magic) != IH_MAGIC) {
-               printf ("Bad magic number\n");
+               puts ("Bad magic number\n");
                return 1;
        }
 
@@ -77,8 +76,8 @@ autoscript (ulong addr)
        hdr->ih_hcrc = 0;
        len = sizeof (image_header_t);
        data = (ulong)hdr;
-       if (crc32(0, (char *)data, len) != crc) {
-               printf ("Bad header crc\n");
+       if (crc32(0, (uchar *)data, len) != crc) {
+               puts ("Bad header crc\n");
                return 1;
        }
 
@@ -86,14 +85,14 @@ autoscript (ulong addr)
        len = ntohl(hdr->ih_size);
 
        if (verify) {
-               if (crc32(0, (char *)data, len) != ntohl(hdr->ih_dcrc)) {
-                       printf ("Bad data crc\n");
+               if (crc32(0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) {
+                       puts ("Bad data crc\n");
                        return 1;
                }
        }
 
        if (hdr->ih_type != IH_TYPE_SCRIPT) {
-               printf ("Bad image type\n");
+               puts ("Bad image type\n");
                return 1;
        }
 
@@ -101,7 +100,7 @@ autoscript (ulong addr)
        len_ptr = (ulong *)data;
 
        if ((len = ntohl(*len_ptr)) == 0) {
-               printf ("Empty Script\n");
+               puts ("Empty Script\n");
                return 1;
        }
 
@@ -172,8 +171,8 @@ do_autoscript (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 
 #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT)
-cmd_tbl_t U_BOOT_CMD(AUTOSCRIPT) = MK_CMD_ENTRY(
-       "autoscr", 2, 0,        do_autoscript,
+U_BOOT_CMD(
+       autoscr, 2, 0,  do_autoscript,
        "autoscr - run script from memory\n",
        "[addr] - run script starting at addr"
        " - A valid autoscr header must be present\n"