rk: uncompress.h: add debug_uart.h and support timeout on putc
author黄涛 <huangtao@rock-chips.com>
Fri, 30 Aug 2013 03:30:10 +0000 (11:30 +0800)
committer黄涛 <huangtao@rock-chips.com>
Fri, 30 Aug 2013 03:30:46 +0000 (11:30 +0800)
arch/arm/plat-rk/include/plat/uncompress.h

index 9704769e6a42c70d5355fc72a2c934130c74e5b3..2d542adf6a68d378c5740370584e0078aaf8c17c 100644 (file)
@@ -3,13 +3,15 @@
 
 #include <linux/serial_reg.h>
 #include <mach/io.h>
+#include <mach/debug_uart.h>
 
 #ifdef DEBUG_UART_PHYS
 static volatile u32 *UART = (u32 *)DEBUG_UART_PHYS;
 
 static void putc(int c)
 {
-       while (!(UART[UART_LSR] & UART_LSR_THRE))
+       int i = 1000;
+       while (i-- && !(UART[UART_LSR] & UART_LSR_THRE))
                barrier();
        UART[UART_TX] = c;
 }