public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2 1/3] tools: kwboot: Allow to specify custom baudrate only in supported operations
@ 2022-03-07 18:03 Pali Rohár
  2022-03-07 18:03 ` [PATCH v2 2/3] tools: kwboot: Check if baudrate value is supported before sending image Pali Rohár
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Pali Rohár @ 2022-03-07 18:03 UTC (permalink / raw)
  To: Stefan Roese, Marek Behún, Marcel Ziswiler, Tony Dinh; +Cc: u-boot

Custom baudrate different than 115200 may be specified only when kwboot is
not going to send boot/debug message pattern or when it is going to send
boot message pattern with image file (in which case baudrate change happens
after sending kwbimage header). BootROM detects boot/debug message pattern
only at baudrate 115200.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 tools/kwboot.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/kwboot.c b/tools/kwboot.c
index 69d1be0f4823..986f27c2012a 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -2133,6 +2133,12 @@ main(int argc, char **argv)
 	if (optind != argc)
 		goto usage;
 
+	/* boot and debug message use baudrate 115200 */
+	if (((bootmsg && !imgpath) || debugmsg) && baudrate != 115200) {
+		fprintf(stderr, "Baudrate other than 115200 cannot be used for this operation.\n");
+		goto usage;
+	}
+
 	tty = kwboot_open_tty(ttypath, imgpath ? 115200 : baudrate);
 	if (tty < 0) {
 		perror(ttypath);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-03-14 15:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-07 18:03 [PATCH v2 1/3] tools: kwboot: Allow to specify custom baudrate only in supported operations Pali Rohár
2022-03-07 18:03 ` [PATCH v2 2/3] tools: kwboot: Check if baudrate value is supported before sending image Pali Rohár
2022-03-08 12:15   ` Stefan Roese
2022-03-07 18:03 ` [PATCH v2 3/3] tools: kwboot: Allow to mix positional arguments with option -b Pali Rohár
2022-03-08  5:23   ` Tony Dinh
2022-03-08 19:22     ` Pali Rohár
2022-03-09  5:51       ` Stefan Roese
2022-03-08 12:15   ` Stefan Roese
2022-03-14 15:23   ` Stefan Roese
2022-03-08 12:14 ` [PATCH v2 1/3] tools: kwboot: Allow to specify custom baudrate only in supported operations Stefan Roese
2022-03-14 15:19 ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox