ARM: uniphier: add EHCI nodes for PH1-LD11
[oweals/u-boot.git] / drivers / serial / serial_xuartlite.c
index 157e14dedc4fb1c356bf54836351d57cc7488cdd..a2e93039257133aa97ef101d5f2208ebb100f187 100644 (file)
@@ -114,3 +114,29 @@ U_BOOT_DRIVER(serial_uartlite) = {
        .ops    = &uartlite_serial_ops,
        .flags = DM_FLAG_PRE_RELOC,
 };
+
+#ifdef CONFIG_DEBUG_UART_UARTLITE
+
+#include <debug_uart.h>
+
+static inline void _debug_uart_init(void)
+{
+       struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;
+
+       out_be32(&regs->control, 0);
+       out_be32(&regs->control, ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX);
+       in_be32(&regs->control);
+}
+
+static inline void _debug_uart_putc(int ch)
+{
+       struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;
+
+       while (in_be32(&regs->status) & SR_TX_FIFO_FULL)
+               ;
+
+       out_be32(&regs->tx_fifo, ch & 0xff);
+}
+
+DEBUG_UART_FUNCS
+#endif