X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=common%2Fcmd_load.c;h=d043e6d7bcf2d6368ead958a89574720ce6c37d4;hb=8e3da9dd113699eed2fa05fcde3c55a2ff410913;hp=0ce949683e257a4488ac6f9e6e9c69f7ed0f56f6;hpb=aaf5e825606a70ddc8fca8e366d8c16a6fd3cc7c;p=oweals%2Fu-boot.git diff --git a/common/cmd_load.c b/common/cmd_load.c index 0ce949683e..d043e6d7bc 100644 --- a/common/cmd_load.c +++ b/common/cmd_load.c @@ -18,7 +18,7 @@ DECLARE_GLOBAL_DATA_PTR; #if defined(CONFIG_CMD_LOADB) -static ulong load_serial_ymodem(ulong offset); +static ulong load_serial_ymodem(ulong offset, int mode); #endif #if defined(CONFIG_CMD_LOADS) @@ -222,7 +222,7 @@ static int read_record(char *buf, ulong len) } /* Check for the console hangup (if any different from serial) */ - if (gd->jt[XF_getc] != getc) { + if (gd->jt->getc != getc) { if (ctrlc()) { return (-1); } @@ -462,7 +462,15 @@ static int do_load_serial_bin(cmd_tbl_t *cmdtp, int flag, int argc, offset, load_baudrate); - addr = load_serial_ymodem(offset); + addr = load_serial_ymodem(offset, xyzModem_ymodem); + + } else if (strcmp(argv[0],"loadx")==0) { + printf("## Ready for binary (xmodem) download " + "to 0x%08lX at %d bps...\n", + offset, + load_baudrate); + + addr = load_serial_ymodem(offset, xyzModem_xmodem); } else { @@ -942,7 +950,7 @@ static int getcxmodem(void) { return (getc()); return -1; } -static ulong load_serial_ymodem(ulong offset) +static ulong load_serial_ymodem(ulong offset, int mode) { int size; int err; @@ -953,7 +961,7 @@ static ulong load_serial_ymodem(ulong offset) ulong addr = 0; size = 0; - info.mode = xyzModem_ymodem; + info.mode = mode; res = xyzModem_stream_open(&info, &err); if (!res) { @@ -1055,6 +1063,14 @@ U_BOOT_CMD( " with offset 'off' and baudrate 'baud'" ); +U_BOOT_CMD( + loadx, 3, 0, do_load_serial_bin, + "load binary file over serial line (xmodem mode)", + "[ off ] [ baud ]\n" + " - load binary file over serial line" + " with offset 'off' and baudrate 'baud'" +); + U_BOOT_CMD( loady, 3, 0, do_load_serial_bin, "load binary file over serial line (ymodem mode)",