public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] tools: kwboot: Allow to specify custom baudrate only in supported operations
@ 2022-03-06 12:38 Pali Rohár
  2022-03-06 13:05 ` Marek Behún
  0 siblings, 1 reply; 3+ messages in thread
From: Pali Rohár @ 2022-03-06 12:38 UTC (permalink / raw)
  To: Stefan Roese, Marek Behún; +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 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/kwboot.c b/tools/kwboot.c
index 69d1be0f4823..f975c4a6c6ca 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -2128,6 +2128,10 @@ main(int argc, char **argv)
 	if (!bootmsg && !term && !debugmsg && !imgpath)
 		goto usage;
 
+	/* boot and debug message use baudrate 115200 */
+	if (((bootmsg && !imgpath) || debugmsg) && baudrate != 115200)
+		goto usage;
+
 	ttypath = argv[optind++];
 
 	if (optind != argc)
-- 
2.20.1


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

* Re: [PATCH] tools: kwboot: Allow to specify custom baudrate only in supported operations
  2022-03-06 12:38 [PATCH] tools: kwboot: Allow to specify custom baudrate only in supported operations Pali Rohár
@ 2022-03-06 13:05 ` Marek Behún
  2022-03-07 14:35   ` Stefan Roese
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Behún @ 2022-03-06 13:05 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Stefan Roese, u-boot

On Sun,  6 Mar 2022 13:38:30 +0100
Pali Rohár <pali@kernel.org> wrote:

> 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 | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tools/kwboot.c b/tools/kwboot.c
> index 69d1be0f4823..f975c4a6c6ca 100644
> --- a/tools/kwboot.c
> +++ b/tools/kwboot.c
> @@ -2128,6 +2128,10 @@ main(int argc, char **argv)
>  	if (!bootmsg && !term && !debugmsg && !imgpath)
>  		goto usage;
>  
> +	/* boot and debug message use baudrate 115200 */
> +	if (((bootmsg && !imgpath) || debugmsg) && baudrate != 115200)
> +		goto usage;

Maybe this should print an actual error message describing the problem?
Otherwise the user might not understand why they are getting usage...

Marek

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

* Re: [PATCH] tools: kwboot: Allow to specify custom baudrate only in supported operations
  2022-03-06 13:05 ` Marek Behún
@ 2022-03-07 14:35   ` Stefan Roese
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2022-03-07 14:35 UTC (permalink / raw)
  To: Marek Behún, Pali Rohár; +Cc: u-boot

On 3/6/22 14:05, Marek Behún wrote:
> On Sun,  6 Mar 2022 13:38:30 +0100
> Pali Rohár <pali@kernel.org> wrote:
> 
>> 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 | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/tools/kwboot.c b/tools/kwboot.c
>> index 69d1be0f4823..f975c4a6c6ca 100644
>> --- a/tools/kwboot.c
>> +++ b/tools/kwboot.c
>> @@ -2128,6 +2128,10 @@ main(int argc, char **argv)
>>   	if (!bootmsg && !term && !debugmsg && !imgpath)
>>   		goto usage;
>>   
>> +	/* boot and debug message use baudrate 115200 */
>> +	if (((bootmsg && !imgpath) || debugmsg) && baudrate != 115200)
>> +		goto usage;
> 
> Maybe this should print an actual error message describing the problem?
> Otherwise the user might not understand why they are getting usage...

I agree. Such more detailed infos are always helpful.

Thanks,
Stefan

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-06 12:38 [PATCH] tools: kwboot: Allow to specify custom baudrate only in supported operations Pali Rohár
2022-03-06 13:05 ` Marek Behún
2022-03-07 14:35   ` Stefan Roese

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