ARM: 5855/1: putc support for nuc900
authorwanzongshun <mcuos.com@gmail.com>
Fri, 18 Dec 2009 17:00:37 +0000 (18:00 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 22 Dec 2009 15:32:32 +0000 (15:32 +0000)
putc support for nuc900

Signed-off-by: lijie <eltshanli@gmail.com>
Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-w90x900/include/mach/uncompress.h

index 050d9fe..56f1a74 100644 (file)
 
 #include <mach/regs-serial.h>
 #include <mach/map.h>
+#include <linux/serial_reg.h>
 
 #define arch_decomp_wdog()
 
+#define TX_DONE        (UART_LSR_TEMT | UART_LSR_THRE)
+static volatile u32 * uart_base = (u32 *)UART0_PA;
+
 static void putc(int ch)
 {
+       /* Check THRE and TEMT bits before we transmit the character.
+        */
+       while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
+               barrier();
+
+       *uart_base = ch;
 }
 
 static inline void flush(void)