rk29: serial is based on the 16550 industry standard
author黄涛 <huangtao@rock-chips.com>
Wed, 6 Apr 2011 11:23:05 +0000 (19:23 +0800)
committer黄涛 <huangtao@rock-chips.com>
Thu, 7 Apr 2011 04:19:15 +0000 (12:19 +0800)
arch/arm/mach-rk29/include/mach/debug-macro.S
arch/arm/mach-rk29/include/mach/uncompress.h

index ad42c6e1b6bd5401604f160534a0b03081d12d6b..8637a82fde4dfc2566f55006fb4987dfa2c15ff3 100644 (file)
                ldrne   \rx, = RK29_UART1_BASE
        .endm
 
-       .macro  senduart,rd,rx
-       str     \rd, [\rx, #0x00]
-       .endm
-
-       .macro  waituart,rd,rx
-       @ wait for TX_READY
-1:     ldr     \rd, [\rx, #0x7C]
-       tst     \rd, #0x02
-       beq     1b
-       .endm
-
-       .macro  busyuart,rd,rx
-       .endm
+#define UART_SHIFT     2
+#include <asm/hardware/debug-8250.S>
index 250c4e7caab2d2ee7e4deed2fda2739033ccaa84..f47d232cbd34dc85d290ea6fa20167066812a5b1 100644 (file)
 
 #ifndef __ASM_ARCH_RK29_UNCOMPRESS_H
 
+#include <linux/serial_reg.h>
 #include <mach/rk29_iomap.h>
 
+static volatile u32 *UART = (u32 *)RK29_UART1_PHYS;
+
 static void putc(int c)
 {
-       while (!(*(volatile u32 *) (RK29_UART1_PHYS + 0x14) & (1 << 5)))
+       while (!(UART[UART_LSR] & UART_LSR_THRE))
                barrier();
-       *(volatile u32 *) (RK29_UART1_PHYS) = c;
+       UART[UART_TX] = c;
 }
 
 static inline void flush(void)