[PATCH] tools: kwboot: Allow to specify custom baudrate only in supported operations

Stefan Roese sr at denx.de
Mon Mar 7 15:35:59 CET 2022


On 3/6/22 14:05, Marek Behún wrote:
> On Sun,  6 Mar 2022 13:38:30 +0100
> Pali Rohár <pali at 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 at 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


More information about the U-Boot mailing list