From 5cd424d71f9f94b6524f929fb90ff6fa8d4eee28 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Mon, 26 Jul 2021 14:58:58 +0200 Subject: [PATCH] serial: a37xx: Use CONFIG_BAUDRATE for initializing early debug UART MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit CONFIG_BAUDRATE should be used for setting the baudrate for the early debug UART. This replaces current hardcoded 115200 value. Signed-off-by: Pali Rohár Reviewed-by: Marek Behun Reviewed-by: Stefan Roese --- drivers/serial/serial_mvebu_a3700.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/serial/serial_mvebu_a3700.c b/drivers/serial/serial_mvebu_a3700.c index c7e66fef87..52dc3fdad7 100644 --- a/drivers/serial/serial_mvebu_a3700.c +++ b/drivers/serial/serial_mvebu_a3700.c @@ -309,7 +309,7 @@ U_BOOT_DRIVER(serial_mvebu) = { static inline void _debug_uart_init(void) { void __iomem *base = (void __iomem *)CONFIG_DEBUG_UART_BASE; - u32 baudrate, parent_rate, divider; + u32 parent_rate, divider; /* reset FIFOs */ writel(UART_CTRL_RXFIFO_RESET | UART_CTRL_TXFIFO_RESET, @@ -322,9 +322,8 @@ static inline void _debug_uart_init(void) * Calculate divider * baudrate = clock / 16 / divider */ - baudrate = 115200; parent_rate = get_ref_clk() * 1000000; - divider = DIV_ROUND_CLOSEST(parent_rate, baudrate * 16); + divider = DIV_ROUND_CLOSEST(parent_rate, CONFIG_BAUDRATE * 16); writel(divider, base + UART_BAUD_REG); /* -- 2.39.5