]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
serial: a37xx: Use CONFIG_BAUDRATE for initializing early debug UART
authorPali Rohár <pali@kernel.org>
Mon, 26 Jul 2021 12:58:58 +0000 (14:58 +0200)
committerStefan Roese <sr@denx.de>
Sat, 31 Jul 2021 07:59:59 +0000 (09:59 +0200)
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 <pali@kernel.org>
Reviewed-by: Marek Behun <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/serial/serial_mvebu_a3700.c

index c7e66fef8768e5a076af0d6efa5c5bde7d5a90c1..52dc3fdad7b458be076f0d8dc2dda7455854ce33 100644 (file)
@@ -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);
 
        /*