From 7ca9b8ae5014a745855296903682ae803235cb35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Sat, 29 Oct 2016 21:48:18 +0200 Subject: [PATCH] mb/lowrisc/nexys4ddr: Actually fix the UART clock setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ron's code calculated the DLL and DLM registers of the 8250 UART, but that's the job of the UART driver. uart_input_clock_divider isn't needed anymore because the default value of 16 works. As a bonus, the baud rate can now be selected in Kconfig, instead of being hardcoded at 115200. TEST=Booted the board at 9600 and 115200 baud. Change-Id: I3d5e49568b798a6a6d944db1161def7d0a2d3b48 Signed-off-by: Jonathan Neuschäfer Reviewed-on: https://review.coreboot.org/17188 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Martin Roth Reviewed-by: Ronald G. Minnich --- src/mainboard/lowrisc/nexys4ddr/Kconfig | 1 - src/mainboard/lowrisc/nexys4ddr/uart.c | 13 ++----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/mainboard/lowrisc/nexys4ddr/Kconfig b/src/mainboard/lowrisc/nexys4ddr/Kconfig index f0a3637d1c..5a6bfb2503 100644 --- a/src/mainboard/lowrisc/nexys4ddr/Kconfig +++ b/src/mainboard/lowrisc/nexys4ddr/Kconfig @@ -21,7 +21,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy select DRIVERS_UART_8250MEM select BOOT_DEVICE_NOT_SPI_FLASH select UART_OVERRIDE_REFCLK - select UART_OVERRIDE_INPUT_CLOCK_DIVIDER config MAINBOARD_DIR string diff --git a/src/mainboard/lowrisc/nexys4ddr/uart.c b/src/mainboard/lowrisc/nexys4ddr/uart.c index e3c233f80b..d19ce520d8 100644 --- a/src/mainboard/lowrisc/nexys4ddr/uart.c +++ b/src/mainboard/lowrisc/nexys4ddr/uart.c @@ -24,17 +24,8 @@ uintptr_t uart_platform_base(int idx) return (uintptr_t) 0x42000000; } -/* these are currently not quite right but they are here for reference - * and will be fixed when lowrisc gives us a standard clock - * and set of values. */ -// divisor = clk_freq / (16 * Baud) -unsigned int uart_input_clock_divider(void) -{ - return (25 * 1000 * 1000u / (16u * 115200u)) % 0x100; -} - -// System clock 25 MHz, 115200 baud rate +/* The clock which the UART is based on */ unsigned int uart_platform_refclk(void) { - return (25 * 1000 * 1000u / (16u * 115200u)) >> 8; + return 25 * MHz; }