From 7dd581494dbaff64e4a2dd31f29cb254104d2d03 Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Wed, 5 Jun 2013 14:06:55 -0700 Subject: snow: Add flush to UART driver. Wait for UART FIFO to be ready. (Credit to dhendrix for finding the bits to test with.) Change-Id: Ib6733e422cbc1c61b942bd90d85f88a3f412d6ff Signed-off-by: Hung-Te Lin Signed-off-by: Gabe Black Reviewed-on: http://review.coreboot.org/3698 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/cpu/samsung/exynos5250/uart.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/cpu/samsung/exynos5250/uart.c') diff --git a/src/cpu/samsung/exynos5250/uart.c b/src/cpu/samsung/exynos5250/uart.c index 24812ae64f..41dc709c97 100644 --- a/src/cpu/samsung/exynos5250/uart.c +++ b/src/cpu/samsung/exynos5250/uart.c @@ -162,12 +162,19 @@ static void exynos5_uart_tx_byte(unsigned char data) writeb(data, &uart->utxh); } +static void exynos5_uart_tx_flush(void) +{ + struct s5p_uart *uart = (struct s5p_uart *)base_port; + + while (readl(&uart->ufstat) & 0x1ff0000); +} + #if !defined(__PRE_RAM__) static const struct console_driver exynos5_uart_console __console = { .init = exynos5_init_dev, .tx_byte = exynos5_uart_tx_byte, -// .tx_flush = exynos5_uart_tx_flush, + .tx_flush = exynos5_uart_tx_flush, .rx_byte = exynos5_uart_rx_byte, // .tst_byte = exynos5_uart_tst_byte, }; @@ -196,6 +203,7 @@ void uart_tx_byte(unsigned char data) void uart_tx_flush(void) { + exynos5_uart_tx_flush(); } #endif -- cgit v1.2.3