From 2cc4be280c259ac1e8e74c643c72e0331266056f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Mon, 26 Jul 2021 14:58:59 +0200 Subject: [PATCH] serial: a37xx: Do not call get_ref_clk() in _debug_uart_init() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Stefan Roese --- 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 52dc3fdad7..6bca8e4b7e 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.39.5