rk29: serial is based on the 16550 industry standard

This commit is contained in:
黄涛
2011-04-06 19:23:05 +08:00
parent 54e55eaf2f
commit 2b025392fc
2 changed files with 7 additions and 15 deletions

View File

@@ -30,16 +30,5 @@
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>

View File

@@ -15,13 +15,16 @@
#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)