summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Ribalda Delgado <ricardo.ribalda@uam.es>2008-07-30 12:39:29 +0200
committerWolfgang Denk <wd@denx.de>2008-09-06 01:57:18 +0200
commit2b22d608f370565c87f55928b524207031419c11 (patch)
tree1984751a73295e46829f4d1e4af5553a0bd5700a
parente90fb6afab2c0c074dfb67bacb4de179eb188a24 (diff)
downloadu-boot-imx-2b22d608f370565c87f55928b524207031419c11.zip
u-boot-imx-2b22d608f370565c87f55928b524207031419c11.tar.gz
u-boot-imx-2b22d608f370565c87f55928b524207031419c11.tar.bz2
loads: allow negative offsets
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
-rw-r--r--common/cmd_load.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/cmd_load.c b/common/cmd_load.c
index f2b73bd..1351fe2 100644
--- a/common/cmd_load.c
+++ b/common/cmd_load.c
@@ -38,7 +38,7 @@ static ulong load_serial_ymodem (ulong offset);
#endif
#if defined(CONFIG_CMD_LOADS)
-static ulong load_serial (ulong offset);
+static ulong load_serial (long offset);
static int read_record (char *buf, ulong len);
# if defined(CONFIG_CMD_SAVES)
static int save_serial (ulong offset, ulong size);
@@ -53,7 +53,7 @@ static int do_echo = 1;
#if defined(CONFIG_CMD_LOADS)
int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
- ulong offset = 0;
+ long offset = 0;
ulong addr;
int i;
char *env_echo;
@@ -72,7 +72,7 @@ int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#ifdef CFG_LOADS_BAUD_CHANGE
if (argc >= 2) {
- offset = simple_strtoul(argv[1], NULL, 16);
+ offset = simple_strtol(argv[1], NULL, 16);
}
if (argc == 3) {
load_baudrate = (int)simple_strtoul(argv[2], NULL, 10);
@@ -95,7 +95,7 @@ int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
#else /* ! CFG_LOADS_BAUD_CHANGE */
if (argc == 2) {
- offset = simple_strtoul(argv[1], NULL, 16);
+ offset = simple_strtol(argv[1], NULL, 16);
}
#endif /* CFG_LOADS_BAUD_CHANGE */
@@ -141,7 +141,7 @@ int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
static ulong
-load_serial (ulong offset)
+load_serial (long offset)
{
char record[SREC_MAXRECLEN + 1]; /* buffer for one S-Record */
char binbuf[SREC_MAXBINLEN]; /* buffer for binary data */