9
0
Fork 0

Fix the options and protocols used by the loadx command.

From 3cd970250ff17ac406e46e18ebb26aa35949d1db Mon Sep 17 00:00:00 2001
From: Owen Kirby <osk@exegin.com>
Date: Thu, 8 May 2014 13:27:11 -0700
Subject: [PATCH] Fix the options and protocols used by the loadx command.

It seems like the loadx command was improperly copy/pasted from the loady
implementation, and was trying to load files using the ymodem protocol. This
patch should fix the command so that it uses xmodem, implements the -t option
and outputs the correct baudrate being used.

Signed-off-by: Owen Kirby <osk@exegin.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Owen Kirby 2014-05-08 13:36:14 -07:00 committed by Sascha Hauer
parent 73ebc58ed1
commit 7b0260afdf
1 changed files with 5 additions and 5 deletions

View File

@ -156,7 +156,7 @@ static int do_loadx(int argc, char *argv[])
char *output_file = NULL, *cname = NULL;
struct console_device *cdev = NULL;
while ((opt = getopt(argc, argv, "f:b:o:c")) > 0) {
while ((opt = getopt(argc, argv, "f:b:t:o:c")) > 0) {
switch (opt) {
case 'f':
output_file = optarg;
@ -211,12 +211,12 @@ static int do_loadx(int argc, char *argv[])
}
current_baudrate = console_change_speed(cdev, load_baudrate);
printf("## Ready for binary (X-Modem) download "
printf("## Ready for binary (xmodem) download "
"to 0x%08lX offset on %s device at %d bps...\n", offset,
output_file, load_baudrate);
rcode = do_load_serial_ymodem(cdev);
output_file, load_baudrate ? load_baudrate : current_baudrate);
rcode = do_load_serial_xmodem(cdev, ofd);
if (rcode < 0) {
printf("## Binary (kermit) download aborted (%d)\n", rcode);
printf("## Binary (xmodem) download aborted (%d)\n", rcode);
rcode = 1;
}
console_change_speed(cdev, current_baudrate);