diff options
author | Simon Glass <sjg@chromium.org> | 2015-07-02 18:15:54 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-08-05 21:06:11 -0600 |
commit | bf6e702232e3b8c38fe0934c1f0240958eaabed3 (patch) | |
tree | d87edfd116af4e8bb0b395cb89934420ce1c02f3 /drivers/serial/serial_s5p.c | |
parent | 89ca9351cf85ed0843a1a82d626560e0dadb3fe5 (diff) | |
download | u-boot-bf6e702232e3b8c38fe0934c1f0240958eaabed3.tar.gz |
exynos: Add debug UART support for Samsung S5P serial
Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/serial/serial_s5p.c')
-rw-r--r-- | drivers/serial/serial_s5p.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c index 7abec53f80..4a553a37b8 100644 --- a/drivers/serial/serial_s5p.c +++ b/drivers/serial/serial_s5p.c @@ -200,3 +200,28 @@ U_BOOT_DRIVER(serial_s5p) = { .ops = &s5p_serial_ops, .flags = DM_FLAG_PRE_RELOC, }; + +#ifdef CONFIG_DEBUG_UART_S5P + +#include <debug_uart.h> + +void debug_uart_init(void) +{ + struct s5p_uart *uart = (struct s5p_uart *)CONFIG_DEBUG_UART_BASE; + + s5p_serial_init(uart); + s5p_serial_baud(uart, CONFIG_DEBUG_UART_CLOCK, CONFIG_BAUDRATE); +} + +static inline void _debug_uart_putc(int ch) +{ + struct s5p_uart *uart = (struct s5p_uart *)CONFIG_DEBUG_UART_BASE; + + while (readl(&uart->ufstat) & TX_FIFO_FULL); + + writeb(ch, &uart->utxh); +} + +DEBUG_UART_FUNCS + +#endif |