diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/Kconfig | 8 | ||||
-rw-r--r-- | drivers/serial/serial_mxc.c | 26 |
2 files changed, 34 insertions, 0 deletions
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index b7dd2ac103..97cef7edbd 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -248,6 +248,14 @@ config DEBUG_UART_PIC32 will need to provide parameters to make this work. The driver will be available until the real driver model serial is running. +config DEBUG_UART_MXC + bool "IMX Serial port" + depends on MXC_UART + help + Select this to enable a debug UART using the serial_mxc driver. You + will need to provide parameters to make this work. The driver will + be available until the real driver model serial is running. + config DEBUG_UART_UNIPHIER bool "UniPhier on-chip UART" depends on ARCH_UNIPHIER diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c index c8c36e5e19..cce80a8559 100644 --- a/drivers/serial/serial_mxc.c +++ b/drivers/serial/serial_mxc.c @@ -357,3 +357,29 @@ U_BOOT_DRIVER(serial_mxc) = { .flags = DM_FLAG_PRE_RELOC, }; #endif + +#ifdef CONFIG_DEBUG_UART_MXC +#include <debug_uart.h> + +static inline void _debug_uart_init(void) +{ + struct mxc_uart *base = (struct mxc_uart *)CONFIG_DEBUG_UART_BASE; + + _mxc_serial_init(base); + _mxc_serial_setbrg(base, CONFIG_DEBUG_UART_CLOCK, + CONFIG_BAUDRATE, false); +} + +static inline void _debug_uart_putc(int ch) +{ + struct mxc_uart *base = (struct mxc_uart *)CONFIG_DEBUG_UART_BASE; + + while (!(readl(&base->ts) & UTS_TXEMPTY)) + WATCHDOG_RESET(); + + writel(ch, &base->txd); +} + +DEBUG_UART_FUNCS + +#endif |