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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0ACDC433F5 for ; Mon, 8 Nov 2021 17:13:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3529B61165 for ; Mon, 8 Nov 2021 17:13:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3529B61165 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E0281838E5; Mon, 8 Nov 2021 18:13:12 +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="ln1hXTpY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0270383904; Mon, 8 Nov 2021 18:13:09 +0100 (CET) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 322E2838D9 for ; Mon, 8 Nov 2021 18:12:57 +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=kabel@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id E795B61165; Mon, 8 Nov 2021 17:12:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636391575; bh=fSf5cKqsBESzB+Tt3ky7P8857ru3XJrvT/Uss9LBnUY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ln1hXTpYiDzTKR6FD768Cf5La/2WmHYfPd2EVHNMKRL/j1yk05Pw6N2t3UM34al54 jdncRvKkfhsfFYU59OUFzo/ihjOqjxFpaOpnOa7JrwU9xXfI8vpyRqYfXt7RCRiEho blx+7gN2T5f/H0Zu1ivVF2I1DiuGn8TWHbtks4d95i0IJo4/8V9lwUNyqWgsJj6ujk LdBw9yzCnLhL/AKHXD/lw1X+KIj2iZ+xqKiur+xVVgwfhfjSHQDu+F14aLBJ67g6Dh cNGcEUo20g8g8Jv/jZByUlIW0/1KDNWy8VHRzaVYZidGVsTjVNPlKJ3OAyZwAob28i iyhmNERsRA3fw== From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: Stefan Roese Cc: u-boot@lists.denx.de, =?UTF-8?q?Pali=20Roh=C3=A1r?= , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 01/11] tools: kwbimage: Add support for new commands UART_PORT and UART_MPP Date: Mon, 8 Nov 2021 18:12:41 +0100 Message-Id: <20211108171251.25382-2-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211108171251.25382-1-kabel@kernel.org> References: <20211108171251.25382-1-kabel@kernel.org> 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.34 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.2 at phobos.denx.de X-Virus-Status: Clean From: Pali Rohár These two commands allow to specify custom setting of UART port used for printing BootROM messages. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún --- tools/kwbimage.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/kwbimage.c b/tools/kwbimage.c index 67c0c628ae..f24d49496b 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -101,6 +101,8 @@ enum image_cfg_type { IMAGE_CFG_DATA, IMAGE_CFG_DATA_DELAY, IMAGE_CFG_BAUDRATE, + IMAGE_CFG_UART_PORT, + IMAGE_CFG_UART_MPP, IMAGE_CFG_DEBUG, IMAGE_CFG_KAK, IMAGE_CFG_CSK, @@ -129,6 +131,8 @@ static const char * const id_strs[] = { [IMAGE_CFG_DATA] = "DATA", [IMAGE_CFG_DATA_DELAY] = "DATA_DELAY", [IMAGE_CFG_BAUDRATE] = "BAUDRATE", + [IMAGE_CFG_UART_PORT] = "UART_PORT", + [IMAGE_CFG_UART_MPP] = "UART_MPP", [IMAGE_CFG_DEBUG] = "DEBUG", [IMAGE_CFG_KAK] = "KAK", [IMAGE_CFG_CSK] = "CSK", @@ -161,6 +165,8 @@ struct image_cfg_element { struct ext_hdr_v0_reg regdata; unsigned int regdata_delay; unsigned int baudrate; + unsigned int uart_port; + unsigned int uart_mpp; unsigned int debug; const char *key_name; int csk_idx; @@ -1239,7 +1245,13 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params, main_hdr->nandbadblklocation = e->nandbadblklocation; e = image_find_option(IMAGE_CFG_BAUDRATE); if (e) - main_hdr->options = baudrate_to_option(e->baudrate); + main_hdr->options |= baudrate_to_option(e->baudrate); + e = image_find_option(IMAGE_CFG_UART_PORT); + if (e) + main_hdr->options |= (e->uart_port & 3) << 3; + e = image_find_option(IMAGE_CFG_UART_MPP); + if (e) + main_hdr->options |= (e->uart_mpp & 7) << 5; e = image_find_option(IMAGE_CFG_DEBUG); if (e) main_hdr->flags = e->debug ? 0x1 : 0; @@ -1441,6 +1453,12 @@ static int image_create_config_parse_oneline(char *line, case IMAGE_CFG_BAUDRATE: el->baudrate = strtoul(value1, NULL, 10); break; + case IMAGE_CFG_UART_PORT: + el->uart_port = strtoul(value1, NULL, 16); + break; + case IMAGE_CFG_UART_MPP: + el->uart_mpp = strtoul(value1, NULL, 16); + break; case IMAGE_CFG_DEBUG: el->debug = strtoul(value1, NULL, 10); break; -- 2.32.0