diff options
author | Pali Rohár <pali@kernel.org> | 2022-09-05 11:31:20 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-09-24 11:34:38 -0400 |
commit | 989cc40f806b68678e10203ec3b63d38d0fdd6eb (patch) | |
tree | d50599477f4272ec2815939caaea122ae290be90 /cmd | |
parent | 78b5243182be8fa222f6d496e7d49675fde4d09e (diff) | |
download | u-boot-989cc40f806b68678e10203ec3b63d38d0fdd6eb.zip u-boot-989cc40f806b68678e10203ec3b63d38d0fdd6eb.tar.gz u-boot-989cc40f806b68678e10203ec3b63d38d0fdd6eb.tar.bz2 |
serial: Call flush() before changing baudrate
Changing baudrate is a sensitive operation. To ensure that U-Boot messages
printed before changing baudrate are not lost, call new U-Boot console
flush() function.
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/load.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -83,6 +83,7 @@ static int do_load_serial(struct cmd_tbl *cmdtp, int flag, int argc, printf("## Switch baudrate to %d bps and press ENTER ...\n", load_baudrate); udelay(50000); + flush(); gd->baudrate = load_baudrate; serial_setbrg(); udelay(50000); @@ -126,6 +127,7 @@ static int do_load_serial(struct cmd_tbl *cmdtp, int flag, int argc, printf("## Switch baudrate to %d bps and press ESC ...\n", current_baudrate); udelay(50000); + flush(); gd->baudrate = current_baudrate; serial_setbrg(); udelay(50000); @@ -317,6 +319,7 @@ int do_save_serial(struct cmd_tbl *cmdtp, int flag, int argc, printf("## Switch baudrate to %d bps and press ESC ...\n", (int)current_baudrate); udelay(50000); + flush(); gd->baudrate = current_baudrate; serial_setbrg(); udelay(50000); @@ -471,6 +474,7 @@ static int do_load_serial_bin(struct cmd_tbl *cmdtp, int flag, int argc, printf("## Switch baudrate to %d bps and press ENTER ...\n", load_baudrate); udelay(50000); + flush(); gd->baudrate = load_baudrate; serial_setbrg(); udelay(50000); @@ -533,6 +537,7 @@ static int do_load_serial_bin(struct cmd_tbl *cmdtp, int flag, int argc, printf("## Switch baudrate to %d bps and press ESC ...\n", current_baudrate); udelay(50000); + flush(); gd->baudrate = current_baudrate; serial_setbrg(); udelay(50000); |