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 X-Spam-Level: X-Spam-Status: No, score=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85DFFC4338F for ; Mon, 26 Jul 2021 12:59:37 +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 894F6608FB for ; Mon, 26 Jul 2021 12:59:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 894F6608FB 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 3537583314; Mon, 26 Jul 2021 14:59:25 +0200 (CEST) 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="Nuw7dIUA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BC3A78331A; Mon, 26 Jul 2021 14:59:21 +0200 (CEST) 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 973B083314 for ; Mon, 26 Jul 2021 14:59:11 +0200 (CEST) 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: by mail.kernel.org (Postfix) with ESMTPSA id 2A096608FB; Mon, 26 Jul 2021 12:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627304350; bh=fDic38uH6IuANEgvkOMi+vJj/l6jTK3OaxSXAnc0STg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nuw7dIUA94Ly1BiT/GDaFY7S9oD7uc6+ixtAH7RB8RxgnkZ7oViTJ8mKnVMuVpKNg J+w6T/eRG8Z7co9FwrhKTye5zLUz13yF2KYcYaORM3OxPKAy2ip1OwtrolLN9pn1ka jR+MXBBEa9p3n5IKb063IZyxyI5zwqteXNm+JDAMdekoWkb5U0JDJGtKf2xJ17i0QB QXfPUN6q1M7aPIqDF7MmyOuOhph1J09v1IueDCeL5nvlAmlO38UtgUl5f18pFnTibM 0VyTqP5sHKZgmEdxRTEs4TLBlG2VkCKXgEnO0y6GS6eEk6kfZ2DPSp2VcMH1s9phYT Myc5NYwEKNiCA== Received: by pali.im (Postfix) id 782748A2; Mon, 26 Jul 2021 14:59:08 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese Cc: Konstantin Porotchkin , =?UTF-8?q?Marek=20Beh=C3=BAn?= , u-boot@lists.denx.de Subject: [PATCH 2/2] serial: a37xx: Do not call get_ref_clk() in _debug_uart_init() Date: Mon, 26 Jul 2021 14:58:59 +0200 Message-Id: <20210726125859.5588-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210726125859.5588-1-pali@kernel.org> References: <20210726125859.5588-1-pali@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 Static inline function _debug_uart_init() should avoid calling external (non-inline) functions. Therefore do not call get_ref_clk() in _debug_uart_init() and reimplement its functionality without external function calls. Signed-off-by: Pali Rohár --- drivers/serial/serial_mvebu_a3700.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/serial/serial_mvebu_a3700.c b/drivers/serial/serial_mvebu_a3700.c index 52dc3fdad7b4..6bca8e4b7e2d 100644 --- a/drivers/serial/serial_mvebu_a3700.c +++ b/drivers/serial/serial_mvebu_a3700.c @@ -305,6 +305,7 @@ U_BOOT_DRIVER(serial_mvebu) = { #ifdef CONFIG_DEBUG_MVEBU_A3700_UART #include +#include static inline void _debug_uart_init(void) { @@ -322,7 +323,8 @@ static inline void _debug_uart_init(void) * Calculate divider * baudrate = clock / 16 / divider */ - parent_rate = get_ref_clk() * 1000000; + parent_rate = (readl(MVEBU_REGISTER(0x13808)) & BIT(9)) ? + 40000000 : 25000000; divider = DIV_ROUND_CLOSEST(parent_rate, CONFIG_BAUDRATE * 16); writel(divider, base + UART_BAUD_REG); -- 2.20.1