summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-06-08 20:22:34 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-06-09 09:22:14 +0200
commite8b94fdfb661fa6b77fdbe6d3ff657c8fa3fbb83 (patch)
tree22825a3bc3ca29b06851c8a0f79e795e53b13015 /commands
parent7cf221db7c4483458c39b4e7f030f7f584b1ae9e (diff)
downloadbarebox-e8b94fdfb661fa6b77fdbe6d3ff657c8fa3fbb83.tar.gz
barebox-e8b94fdfb661fa6b77fdbe6d3ff657c8fa3fbb83.tar.xz
loadb: Use console_set_baudrate
No Need to do this manually Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/loadb.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/commands/loadb.c b/commands/loadb.c
index 8294f39c13..acc3cd4a51 100644
--- a/commands/loadb.c
+++ b/commands/loadb.c
@@ -660,17 +660,9 @@ static int do_load_serial_bin(int argc, char *argv[])
}
}
- if (load_baudrate != current_baudrate) {
- printf("## Switch baudrate to %d bps and press ENTER ...\n",
- load_baudrate);
- udelay(50000);
- cdev->setbrg(cdev, load_baudrate);
- udelay(50000);
- for (;;) {
- if (getc() == '\r')
- break;
- }
- }
+ ret = console_set_baudrate(cdev, load_baudrate);
+ if (ret)
+ return ret;
printf("## Ready for binary (kermit) download "
"to 0x%08lX offset on %s device at %d bps...\n", offset,
@@ -681,17 +673,9 @@ static int do_load_serial_bin(int argc, char *argv[])
rcode = 1;
}
- if (load_baudrate != current_baudrate) {
- printf("## Switch baudrate to %d bps and press ESC ...\n",
- current_baudrate);
- udelay(50000);
- cdev->setbrg(cdev, current_baudrate);
- udelay(50000);
- for (;;) {
- if (getc() == 0x1B) /* ESC */
- break;
- }
- }
+ ret = console_set_baudrate(cdev, current_baudrate);
+ if (ret)
+ return ret;
close(ofd);
ofd = 0;