#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
        || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
-       || defined(CONFIG_SERIAL_MPSC_CONSOLE)
+       || defined(CONFIG_SERIAL_MPSC_CONSOLE) \
+       || defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
 extern unsigned long com_port;
 
 extern int serial_tstc(unsigned long com_port);
 {
 #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
        || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
-       || defined(CONFIG_SERIAL_MPSC_CONSOLE)
+       || defined(CONFIG_SERIAL_MPSC_CONSOLE) \
+       || defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
        if(keyb_present)
                return (CRT_tstc() || serial_tstc(com_port));
        else
        while (1) {
 #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
        || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
-       || defined(CONFIG_SERIAL_MPSC_CONSOLE)
+       || defined(CONFIG_SERIAL_MPSC_CONSOLE) \
+       || defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
                if (serial_tstc(com_port))
                        return (serial_getc(com_port));
 #endif /* serial console */
 
 #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
        || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
-       || defined(CONFIG_SERIAL_MPSC_CONSOLE)
+       || defined(CONFIG_SERIAL_MPSC_CONSOLE) \
+       || defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
        serial_putc(com_port, c);
        if ( c == '\n' )
                serial_putc(com_port, '\r');
        while ( ( c = *s++ ) != '\0' ) {
 #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
        || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
-       || defined(CONFIG_SERIAL_MPSC_CONSOLE)
+       || defined(CONFIG_SERIAL_MPSC_CONSOLE) \
+       || defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
                serial_putc(com_port, c);
                if ( c == '\n' ) serial_putc(com_port, '\r');
 #endif /* serial console */
 
--- /dev/null
+/*
+ * Xilinx UARTLITE bootloader driver
+ *
+ * Copyright (c) 2007 Secret Lab Technologies Ltd.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/types.h>
+#include <asm/serial.h>
+#include <asm/io.h>
+#include <platforms/4xx/xparameters/xparameters.h>
+
+#define UARTLITE_BASEADDR ((void*)(XPAR_UARTLITE_0_BASEADDR))
+
+void
+serial_putc(unsigned long com_port, unsigned char c)
+{
+       while ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x08) != 0); /* spin */
+       out_be32(UARTLITE_BASEADDR + 0x4, c);
+}
+
+unsigned char
+serial_getc(unsigned long com_port)
+{
+       while ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x01) == 0); /* spin */
+       return in_be32(UARTLITE_BASEADDR);
+}
+
+int
+serial_tstc(unsigned long com_port)
+{
+       return ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x01) != 0);
+}