From patchwork Tue Apr 25 12:04:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkatesh Yadav Abbarapu X-Patchwork-Id: 1773393 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=uH0UQ32q; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5M1H6V5Jz23v2 for ; Tue, 25 Apr 2023 22:36:03 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7B82886247; Tue, 25 Apr 2023 14:35:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="uH0UQ32q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4223986245; Tue, 25 Apr 2023 14:05:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2060d.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::60d]) (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 80D0D8623B for ; Tue, 25 Apr 2023 14:05:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=venkatesh.abbarapu@amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hfq5b6vaxI9+7QODFdOapEA14iPswKjil5OlvMGZny3pzL8B8jU7NYIIYtu+GnlRAioCWBXgBNlVgpteFcCz+b6kkStZ5BGHRu9lc+04XcfIxg8UG0t0q/lmFMexcd169bCTuQ/NYyHUiJr6/d0zUshPV/kPxstVH/zPM9Dfk6OTVjuATUPDiKWqPstdmcbHvRx3VBGqp068Hj0Td0Jj9AKThxYFxcVe/747j+B84lfxMI3lbsk71Tfpl18mfCqILGQui2sLH+WxD6a1CkG/g0w8tifFhX4gElBDP4qo1klzrNfaIDatDE/TcXaE2I1kWfsJDaI+1LRtFsWY3RZTFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y3w/dqqFz207ES1ptTzCMdZM8BTeXhX00a1QQpYf+ic=; b=NOT1iSuHWPHFp0ek00hv2amnSycdzvKo9DM/R3fzyW3Arm3ZJ+HleUZmkX24QiNz5ECdSR0ErZHIrWgQsqzN+SZjg88o0Y1F4Wzaj8/7wUihjRpM/f9faVZQrSbY6foSe+nNijbVJUKnzA4VxPXc/B2prs1fkR27mq2JTPVBqm18qkXjwlLCBeklOo99Xl4qIwD2TvDIxNSi6cbA3aXz+pK8o+t9oPoBqZig/RxocP0ZsSBexjiN2xc5ZVNZ/yheFrNvzeyvmpsaWcoKFIwofWqKfm2fMTylSX593jjXmKx4DFKGEn9yk/GlASJ0kNBuUdafRKof71y+1L/uP6xr+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y3w/dqqFz207ES1ptTzCMdZM8BTeXhX00a1QQpYf+ic=; b=uH0UQ32qO0gIAQaW/pgUVVVop+tOnDMHIIjJ4gVOc9lO4Y1JD8kZ/yLU2T75SuxpiYGnpD/jY0lcMu93f3rMQHP+qo9WtuA78m82HbFhEMvrEj1Ku2e+9O7qnPM1PRcnKmuenhubOlNHIVVINlmge0lyCO2Jufseq/wR4fAJWx8= Received: from DM5PR08CA0048.namprd08.prod.outlook.com (2603:10b6:4:60::37) by DM4PR12MB6037.namprd12.prod.outlook.com (2603:10b6:8:b0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Tue, 25 Apr 2023 12:05:15 +0000 Received: from DM6NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:4:60:cafe::65) by DM5PR08CA0048.outlook.office365.com (2603:10b6:4:60::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34 via Frontend Transport; Tue, 25 Apr 2023 12:05:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT021.mail.protection.outlook.com (10.13.173.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6340.20 via Frontend Transport; Tue, 25 Apr 2023 12:05:14 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 25 Apr 2023 07:05:10 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 25 Apr 2023 05:05:09 -0700 Received: from xhdvabbarap40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34 via Frontend Transport; Tue, 25 Apr 2023 07:05:08 -0500 From: Venkatesh Yadav Abbarapu To: CC: , , , "Algapally Santosh Sagar" Subject: [PATCH v3 1/2] serial: zynqmp: Fetch baudrate from dtb and update Date: Tue, 25 Apr 2023 17:34:58 +0530 Message-ID: <20230425120459.13413-2-venkatesh.abbarapu@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230425120459.13413-1-venkatesh.abbarapu@amd.com> References: <20230425120459.13413-1-venkatesh.abbarapu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT021:EE_|DM4PR12MB6037:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b7b79fa-adf9-429c-f030-08db458553e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HbdyzaZozJpFnTGZpBWT1gZpjdfMEvPa2kxuYTALjIWBQPiEg2YURqpPDBcWKlcEs914OhcoXEY9gEsXEFM9sv2VQSnUHr2B4wEk3fy7DG6cENTRGO0EIKRVQjAG0BsjW1nRcJL4uN64eVRI85nbUqCpzswydmtJ3V6kBr+brFMHviAxGE3zosV6ie/KcLLZbpdFdb0to7t9aYUuLllxbbL23nnwe7Q6eHqLyB73g48qWZFfS3z3im+TyFsFoyh9q+eR8a3sLue3m41VgYT5UxHN8RjQnEi0xbSEyDTTd7WnOaoG3jCwKkogPpAxAUiaO8Od9JUcN3DPDvkNbl6CXGZPRGPP/SEW5I4+RzURmX+g+Me4XEryo7TgHWRdlY8WkwOtVVaSNkK5JTpptC+EZhm1s3+wUwOAKyOCvaNcGjWDHpttt5p7A2hd83Z9K2DeNoUeCLBq38dDUejiURAeFxTF81OTmdG2BnO9qAt5eu2MimhC4e0Nj8JQIq0mx6xg1fpyg9IQYkaStEoa337aPf8OqyOFU8Xi70go4lx/lC3owLCDITP/mLPu+MohmR5AWcVI5jMSL9Sa3LwQjnGOQ+54dL5TweDFtRsVo3ZnyR4fLQk/T+QfTefTgi4RrjBYp7ML+5wAKhqHW84r/6mGus74t1qSP7zHdEMHTsVixyZC4CMOh4tO2wUjqeZw8ngMqK/bo3Sv8EtvRhh4JlUgy25hR9cIo2JVJ/uFRnPQc7M= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(346002)(136003)(396003)(376002)(451199021)(40470700004)(46966006)(36840700001)(336012)(426003)(40460700003)(186003)(2616005)(1076003)(26005)(8676002)(8936002)(316002)(54906003)(5660300002)(41300700001)(82310400005)(86362001)(36756003)(82740400003)(4326008)(70586007)(6916009)(70206006)(81166007)(356005)(6666004)(47076005)(40480700001)(36860700001)(478600001)(2906002)(15650500001)(83380400001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 12:05:14.2952 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b7b79fa-adf9-429c-f030-08db458553e7 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6037 X-Mailman-Approved-At: Tue, 25 Apr 2023 14:35:28 +0200 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.8 at phobos.denx.de X-Virus-Status: Clean From: Algapally Santosh Sagar The baudrate configured in .config is taken by default by serial. If change of baudrate is required then the .config needs to changed and u-boot recompilation is required or the u-boot environment needs to be updated. To avoid this, support is added to fetch the baudrate directly from the device tree file and update. The serial, prints the log with the configured baudrate in the dtb. The commit c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for $fdtfile env variable") is taken as reference for changing the default environment variable. The default environment stores the default baudrate value, When default baudrate and dtb baudrate are not same glitches are seen on the serial. So, the environment also needs to be updated with the dtb baudrate to avoid the glitches on the serial. Signed-off-by: Algapally Santosh Sagar Signed-off-by: Venkatesh Yadav Abbarapu --- drivers/serial/serial-uclass.c | 32 +++++++++++++++++++++++++++ include/env_default.h | 7 ++++-- include/env_internal.h | 2 +- include/fdtdec.h | 8 +++++++ include/serial.h | 1 + lib/fdtdec.c | 40 ++++++++++++++++++++++++++++++++++ 6 files changed, 87 insertions(+), 3 deletions(-) diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 067fae2614..d77d3bda36 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -154,12 +154,44 @@ static void serial_find_console_or_panic(void) } #endif /* CONFIG_SERIAL_PRESENT */ +#ifdef CONFIG_SERIAL_DT_BAUD +int serial_get_valid_baudrate(int baud) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(baudrate_table); ++i) { + if (baud == baudrate_table[i]) + return 0; + } + + return -EINVAL; +} +#endif + /* Called prior to relocation */ int serial_init(void) { #if CONFIG_IS_ENABLED(SERIAL_PRESENT) serial_find_console_or_panic(); gd->flags |= GD_FLG_SERIAL_READY; +#ifdef CONFIG_SERIAL_DT_BAUD + int ret = 0; + char *ptr = &default_environment[0]; + + /* + * Fetch the baudrate from the dtb and update the value in the + * default environment. + */ + ret = fdtdec_get_baud_from_dtb(gd->fdt_blob); + if (ret != -EINVAL && ret != -EFAULT) { + gd->baudrate = ret; + + while (*ptr != '\0' && *(ptr + 1) != '\0') + ptr++; + ptr += 2; + sprintf(ptr, "baudrate=%d", gd->baudrate); + } +#endif serial_setbrg(); #endif diff --git a/include/env_default.h b/include/env_default.h index c0df39d62f..4f286ffc9e 100644 --- a/include/env_default.h +++ b/include/env_default.h @@ -23,7 +23,7 @@ env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = { { #elif defined(DEFAULT_ENV_INSTANCE_STATIC) static char default_environment[] = { -#elif defined(DEFAULT_ENV_IS_RW) +#elif defined(CONFIG_DEFAULT_ENV_IS_RW) char default_environment[] = { #else const char default_environment[] = { @@ -44,7 +44,7 @@ const char default_environment[] = { #if defined(CONFIG_BOOTDELAY) "bootdelay=" __stringify(CONFIG_BOOTDELAY) "\0" #endif -#if defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0) +#if !defined(CONFIG_SERIAL_DT_BAUD) && defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0) "baudrate=" __stringify(CONFIG_BAUDRATE) "\0" #endif #ifdef CONFIG_LOADS_ECHO @@ -120,6 +120,9 @@ const char default_environment[] = { #endif #ifdef CFG_EXTRA_ENV_SETTINGS CFG_EXTRA_ENV_SETTINGS +#endif +#ifdef CONFIG_SERIAL_DT_BAUD + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" #endif "\0" #else /* CONFIG_USE_DEFAULT_ENV_FILE */ diff --git a/include/env_internal.h b/include/env_internal.h index 6a69494646..fcb464263f 100644 --- a/include/env_internal.h +++ b/include/env_internal.h @@ -89,7 +89,7 @@ typedef struct environment_s { extern env_t embedded_environment; #endif /* ENV_IS_EMBEDDED */ -#ifdef DEFAULT_ENV_IS_RW +#ifdef CONFIG_DEFAULT_ENV_IS_RW extern char default_environment[]; #else extern const char default_environment[]; diff --git a/include/fdtdec.h b/include/fdtdec.h index aa61a0fca1..48937a7a46 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -657,6 +657,14 @@ int fdtdec_get_alias_seq(const void *blob, const char *base, int node, */ int fdtdec_get_alias_highest_id(const void *blob, const char *base); +/** + * Get baudrate from the dtb + * + * @param blob Device tree blob (if NULL, then error is returned) + * @return Baud rate value, or -ve error . + */ +int fdtdec_get_baud_from_dtb(const void *blob); + /** * Get a property from the /chosen node * diff --git a/include/serial.h b/include/serial.h index 42bdf3759c..48834b517c 100644 --- a/include/serial.h +++ b/include/serial.h @@ -337,6 +337,7 @@ int serial_setconfig(struct udevice *dev, uint config); */ int serial_getinfo(struct udevice *dev, struct serial_device_info *info); +int serial_get_valid_baudrate(int baud); void atmel_serial_initialize(void); void mcf_serial_initialize(void); void mpc85xx_serial_initialize(void); diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 0827e16859..2fcc12148e 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -570,6 +570,46 @@ int fdtdec_get_alias_highest_id(const void *blob, const char *base) return max; } +#ifdef CONFIG_SERIAL_DT_BAUD +int fdtdec_get_baud_from_dtb(const void *blob) +{ + const char *str, *p, *baud_start; + u32 baud; + + if (!blob) + return -EFAULT; + + str = fdtdec_get_chosen_prop(blob, "stdout-path"); + if (!str) + return -EINVAL; + + p = strchr(str, ':'); + if (!p) + return -EINVAL; + + baud = 0; + baud_start = p + 1; + while (*baud_start != '\0') { + /* + * Uart binding is {{{...}}} + * So the baudrate either is the whole string, or + * ends in the parity characters. + */ + if (*baud_start == 'n' || *baud_start == 'o' || + *baud_start == 'e') + break; + + baud = baud * 10 + (*baud_start - '0'); + baud_start++; + } + + if (serial_get_valid_baudrate(baud) == -EINVAL) + return -EINVAL; + + return baud; +} +#endif + const char *fdtdec_get_chosen_prop(const void *blob, const char *name) { int chosen_node; From patchwork Tue Apr 25 12:04:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkatesh Yadav Abbarapu X-Patchwork-Id: 1773392 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=aYEZrJlq; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5M112dg1z23v2 for ; Tue, 25 Apr 2023 22:35:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B647A86237; Tue, 25 Apr 2023 14:35:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="aYEZrJlq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9291B86245; Tue, 25 Apr 2023 14:05:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20608.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::608]) (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 BC4FB86246 for ; Tue, 25 Apr 2023 14:05:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=venkatesh.abbarapu@amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bcCLvXhiqE/wvNLIuZpDxqP3fwXvOA7sYQoG9ksZpZPP0xSwjcQBakwS+YUw1ubTDgD35sYp8zlUwPOE7zAznKO5aj6+WqJFScwvwTFarzQ1S1NQw6gke5Z3H8CascNWaoXbALZTKAH9Qz0+UBhKxyK9zjiMRIKUKiowRQLDXcT6naU8AgeDFH1yrt4vGC2lcK1PXyuJ1TL4AP81r32Qmdn2lh69R8hk9F/xEPnhHqNMvViKp6bxPeCowQhWyZyFcvy3uNVhfxgNx1cMC0odTdA86zSXNzICOOKFDwnoo360ZFFdWxSOFAdY9qLJnj9iZ+24+ji/s3rKpTiXdJI7wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WOdGHU099MtEqL5jQjnFRb5Z5OYh3Pl0de2QUa++fUI=; b=Fe1JRKfwnwCaG9Q8gcbuAGQKNeuh21yEjNoxPrk30YgI/m6jn/tZfzZEwTuWHjS5K0eB8UV8wmu05fZZ6vkoJR+de9f+dW9YTfJ1ZyRdJsKiB+NhdAngpNOP/UpUJAyRim2bkznfMVcvsHa7wRf+Yayafk/hQYcny3O/jzLRqVRfIplzJTKDoltUm7LV1X33n/mUqHZxYYyTMmKzoCcUDXytaxAZd33strfzAA++o/tYE+SgnvcJB9LfSDsQBJ46eLwV3ElYjiH8wKtNiLtdNa1g70rcRF4zSPpOk7McdP33nN4u0D+ZiGBlgXghVN44v7Xm6RvFeTtKzDrGVywrzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WOdGHU099MtEqL5jQjnFRb5Z5OYh3Pl0de2QUa++fUI=; b=aYEZrJlq+sTYHQuqop+hf5LFMlTcHycNSyhIaVKPcImRDezMUZ1uETGdAsvjaxHKemuVxt4yDF8cY2UI3UIrU9KNATKaH/6Z3QKolmU1iuZ/pxaM+dNko+hJC0CXjVRZVvXBVYt8dMosvBtucsaBfbF2BJmCQIPrT2skaEhtVFM= Received: from DM5PR08CA0027.namprd08.prod.outlook.com (2603:10b6:4:60::16) by SN7PR12MB7881.namprd12.prod.outlook.com (2603:10b6:806:34a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 12:05:16 +0000 Received: from DM6NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:4:60:cafe::60) by DM5PR08CA0027.outlook.office365.com (2603:10b6:4:60::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.20 via Frontend Transport; Tue, 25 Apr 2023 12:05:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT021.mail.protection.outlook.com (10.13.173.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6340.20 via Frontend Transport; Tue, 25 Apr 2023 12:05:16 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 25 Apr 2023 07:05:12 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 25 Apr 2023 05:05:11 -0700 Received: from xhdvabbarap40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34 via Frontend Transport; Tue, 25 Apr 2023 07:05:10 -0500 From: Venkatesh Yadav Abbarapu To: CC: , , , "Algapally Santosh Sagar" Subject: [PATCH v3 2/2] configs: Add support in Kconfig and convert for armada boards Date: Tue, 25 Apr 2023 17:34:59 +0530 Message-ID: <20230425120459.13413-3-venkatesh.abbarapu@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230425120459.13413-1-venkatesh.abbarapu@amd.com> References: <20230425120459.13413-1-venkatesh.abbarapu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT021:EE_|SN7PR12MB7881:EE_ X-MS-Office365-Filtering-Correlation-Id: 162010cc-8728-449a-eed4-08db45855530 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n4vb+BKolNtxJqAgoNQ9tK59SBEmoouMfnucA959zzbYHWcXwC2BBZWhI7Ds2Mt34Hy7RR9IlKhocvVCPCUxdqcz1Dpd7MPU+O8Ox4Sl3liXQDXjcv7PL5KR5uPP6smqfWfd6R5imLjwNvhXcyUbKYNVcJxC2t5ydgXTdXgY7qTRNbnWXa9GpYFmffeS68yZ5LE8Iho2aU/5ocya/XJhxtZCNQQVifOSPmB2UzmLPV4qq28E1cY798HUfcL4GxRRHpeWgwmqIPZ1PEklkRbFEnweVyvK+zKrpiGQ5jRB5xMII/vgIZ2EAKEhfJCc05hpbY6Jmtq5Z83VlgbYf24He+uVZHyBNWEAoamfZPT0tfok0CdlsS6/QxWM6Mk7GdqN2edodTwYGu6gdYTh3qPq+YEkX+fvhsB3IliE7z8eQg29uDM0QBJ4SL4AskoSPij9kb1oBHDxYF+YLGu+UmWOevd8tmYF1gS4OYaLVKnSU0oMmIoOXfa+zyBs6fT2Q1OEgLNiMMUmspVxA5B4Qxx2sbK/b1Fpeno1KO4VAHT6Gfx/0+yGNBLajUXu95WKf56T08IashOaPzksOn5/hkCE2wwKzVw+PEQb8knOuOjLIYkCEWA9sPNwKrlx2muFE7911dVLcZVp+iXPMsZYSgaP4IXW/EUt2CFuMB8IRFkYCAaDunVLXb9yH5Hr0ha2KIuvnZ/gDb4K89Xl/NytFEwJbpdv9mh3INylm4Krnu34rT0= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199021)(46966006)(40470700004)(36840700001)(478600001)(40460700003)(54906003)(86362001)(36756003)(186003)(26005)(82310400005)(1076003)(40480700001)(4326008)(6916009)(316002)(6666004)(82740400003)(83380400001)(70206006)(70586007)(36860700001)(2906002)(8676002)(336012)(426003)(356005)(81166007)(41300700001)(5660300002)(8936002)(47076005)(2616005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 12:05:16.4513 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 162010cc-8728-449a-eed4-08db45855530 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7881 X-Mailman-Approved-At: Tue, 25 Apr 2023 14:35:28 +0200 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.8 at phobos.denx.de X-Virus-Status: Clean From: Algapally Santosh Sagar The SERIAL_DT_BAUD is added to Kconfig and the DEFAULT_ENV_IS_RW is moved to the Kconfig for easier configuration. Hence, the CONFIG_DEFAULT_ENV_IS_RW config is added to the defconfig files to allow enabling them for armada boards. Signed-off-by: Algapally Santosh Sagar Signed-off-by: Venkatesh Yadav Abbarapu --- configs/mvebu_db-88f3720_defconfig | 1 + configs/mvebu_espressobin-88f3720_defconfig | 1 + configs/mvebu_mcbin-88f8040_defconfig | 1 + drivers/serial/Kconfig | 16 ++++++++++++++++ include/configs/mvebu_armada-37xx.h | 1 - 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/configs/mvebu_db-88f3720_defconfig b/configs/mvebu_db-88f3720_defconfig index ed0d28fd7d..e3bbaa2173 100644 --- a/configs/mvebu_db-88f3720_defconfig +++ b/configs/mvebu_db-88f3720_defconfig @@ -21,6 +21,7 @@ CONFIG_USE_PREBOOT=y CONFIG_SYS_CONSOLE_INFO_QUIET=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_DEFAULT_ENV_IS_RW=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_ARCH_EARLY_INIT_R=y CONFIG_BOARD_EARLY_INIT_F=y diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig index ce696787e8..a06eb2dd42 100644 --- a/configs/mvebu_espressobin-88f3720_defconfig +++ b/configs/mvebu_espressobin-88f3720_defconfig @@ -22,6 +22,7 @@ CONFIG_USE_PREBOOT=y CONFIG_SYS_CONSOLE_INFO_QUIET=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_DEFAULT_ENV_IS_RW=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_ARCH_EARLY_INIT_R=y CONFIG_BOARD_EARLY_INIT_F=y diff --git a/configs/mvebu_mcbin-88f8040_defconfig b/configs/mvebu_mcbin-88f8040_defconfig index 058c04333a..4ee5f242f7 100644 --- a/configs/mvebu_mcbin-88f8040_defconfig +++ b/configs/mvebu_mcbin-88f8040_defconfig @@ -22,6 +22,7 @@ CONFIG_USE_PREBOOT=y CONFIG_SYS_CONSOLE_INFO_QUIET=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_DEFAULT_ENV_IS_RW=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_ARCH_EARLY_INIT_R=y CONFIG_BOARD_EARLY_INIT_F=y diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 10d07daf27..96cea87f45 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -24,6 +24,22 @@ config BAUDRATE in the SPL stage (most drivers) or for choosing a default baudrate in the absence of an environment setting (serial_mxc.c). +config SERIAL_DT_BAUD + bool "Fetch serial baudrate from device tree" + depends on DM_SERIAL && SPL_ENV_SUPPORT + select DEFAULT_ENV_IS_RW + help + Select this to enable fetching and setting of the baudrate + configured in the DT. Replace the default baudrate with the DT + baudrate and also set it to the environment. + +config DEFAULT_ENV_IS_RW + bool "Make default environment as writable" + depends on DM_SERIAL + help + Select this to enable to make default environment writable. This + allows modifying the default environment. + config REQUIRE_SERIAL_CONSOLE bool "Require a serial port for console" # Running without a serial console is not supported by the diff --git a/include/configs/mvebu_armada-37xx.h b/include/configs/mvebu_armada-37xx.h index 76e148f55e..18b55be0d8 100644 --- a/include/configs/mvebu_armada-37xx.h +++ b/include/configs/mvebu_armada-37xx.h @@ -30,7 +30,6 @@ /* * Environment */ -#define DEFAULT_ENV_IS_RW /* required for configuring default fdtfile= */ #ifdef CONFIG_MMC #define BOOT_TARGET_DEVICES_MMC(func, i) func(MMC, mmc, i)