]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - tools/kwboot.c
Remove CONFIG_SYS_BOOTCOUNT_SINGLEWORD
[people/ms/u-boot.git] / tools / kwboot.c
index c5f4492b5f7ab3d4a3b1a609740316cebcb7dae5..8a421cda4ea5804224b02436be2ea0440a533715 100644 (file)
@@ -9,10 +9,14 @@
  *   2008. Chapter 24.2 "BootROM Firmware".
  */
 
+#include "kwbimage.h"
+#include "mkimage.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdarg.h>
+#include <image.h>
 #include <libgen.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -22,8 +26,6 @@
 #include <sys/mman.h>
 #include <sys/stat.h>
 
-#include "kwbimage.h"
-
 #ifdef __GNUC__
 #define PACKED __attribute((packed))
 #else
@@ -74,6 +76,7 @@ static int kwboot_verbose;
 
 static int msg_req_delay = KWBOOT_MSG_REQ_DELAY;
 static int msg_rsp_timeo = KWBOOT_MSG_RSP_TIMEO;
+static int blk_rsp_timeo = KWBOOT_BLK_RSP_TIMEO;
 
 static void
 kwboot_printv(const char *fmt, ...)
@@ -378,7 +381,7 @@ kwboot_xm_sendblock(int fd, struct kwboot_block *block)
                        break;
 
                do {
-                       rc = kwboot_tty_recv(fd, &c, 1, KWBOOT_BLK_RSP_TIMEO);
+                       rc = kwboot_tty_recv(fd, &c, 1, blk_rsp_timeo);
                        if (rc)
                                break;
 
@@ -674,7 +677,7 @@ static void
 kwboot_usage(FILE *stream, char *progname)
 {
        fprintf(stream,
-               "Usage: %s [-d | -a | -q <req-delay> | -s <resp-timeo> | -b <image> | -D <image> ] [ -t ] [-B <baud> ] <TTY>\n",
+               "Usage: %s [OPTIONS] [-b <image> | -D <image> ] [-B <baud> ] <TTY>\n",
                progname);
        fprintf(stream, "\n");
        fprintf(stream,
@@ -686,6 +689,8 @@ kwboot_usage(FILE *stream, char *progname)
        fprintf(stream, "  -a: use timings for Armada XP\n");
        fprintf(stream, "  -q <req-delay>:  use specific request-delay\n");
        fprintf(stream, "  -s <resp-timeo>: use specific response-timeout\n");
+       fprintf(stream,
+               "  -o <block-timeo>: use specific xmodem block timeout\n");
        fprintf(stream, "\n");
        fprintf(stream, "  -t: mini terminal\n");
        fprintf(stream, "\n");
@@ -718,7 +723,7 @@ main(int argc, char **argv)
        kwboot_verbose = isatty(STDOUT_FILENO);
 
        do {
-               int c = getopt(argc, argv, "hb:ptaB:dD:q:s:");
+               int c = getopt(argc, argv, "hb:ptaB:dD:q:s:o:");
                if (c < 0)
                        break;
 
@@ -758,6 +763,10 @@ main(int argc, char **argv)
                        msg_rsp_timeo = atoi(optarg);
                        break;
 
+               case 'o':
+                       blk_rsp_timeo = atoi(optarg);
+                       break;
+
                case 'B':
                        speed = kwboot_tty_speed(atoi(optarg));
                        if (speed == -1)