From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D1608C433EF for ; Mon, 7 Mar 2022 18:04:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 19C8982116; Mon, 7 Mar 2022 19:04:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="jC8Z9e27"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5A5DD811D8; Mon, 7 Mar 2022 19:04:03 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3351181D4B for ; Mon, 7 Mar 2022 19:03:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EA9A861295; Mon, 7 Mar 2022 18:03:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39BB1C340E9; Mon, 7 Mar 2022 18:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646676237; bh=iYrvKJ86fcIlpV1UoQcL3DcUeBQRdtBylf8OIMuBNEk=; h=From:To:Cc:Subject:Date:From; b=jC8Z9e276OUGbwTWZwRo1zvA3PQYd5AaiF31SqNJV5sXtlVjKFQN3G+uSiLq6TEf+ tUBgKkdr1mtgHfOluUv78KvI6xGvjXyYFLnZSP+w57/QR/g4f7K2tNKnp4ZxCd0vRN e940yE6RpdRfCto+F8LEdqYe5hZUak9iuaYXFys3qR/ryNvjqRd04M/wtuim4EMrbx IiUAtxYU2/tZDhy3/us7MrykWoi5HktehqPScG7m8gDF+Bf2qaP0WaHvto+tYTQE+h eeQ8ieXz8pJxAPTMOlP/QiBC0WDG03q5tVHKmUULHFiS785atGkOYD1zg7vLr113yR wjzTnfq3zoLEw== Received: by pali.im (Postfix) id 596E0133E; Mon, 7 Mar 2022 19:03:54 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Marcel Ziswiler , Tony Dinh Cc: u-boot@lists.denx.de Subject: [PATCH v2 1/3] tools: kwboot: Allow to specify custom baudrate only in supported operations Date: Mon, 7 Mar 2022 19:03:07 +0100 Message-Id: <20220307180309.31275-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean 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 --- 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