On Sun, 6 Mar 2022 13:38:30 +0100 Pali Rohár <p...@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 <p...@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