From 12bd547263f11dec8f286f0aba2ba5ee4e5a0ed9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Tue, 5 Aug 2014 17:47:32 +0800 Subject: [PATCH] ARM: rockchip: fiq-debugger: add UART_USR macro --- arch/arm/mach-rockchip/rk_fiq_debugger.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-rockchip/rk_fiq_debugger.c b/arch/arm/mach-rockchip/rk_fiq_debugger.c index b0f7ccdb2102..2717a307ce36 100644 --- a/arch/arm/mach-rockchip/rk_fiq_debugger.c +++ b/arch/arm/mach-rockchip/rk_fiq_debugger.c @@ -37,6 +37,13 @@ #include #include "rk_fiq_debugger.h" +#define UART_USR 0x1f /* In: UART Status Register */ +#define UART_USR_RX_FIFO_FULL 0x10 /* Receive FIFO full */ +#define UART_USR_RX_FIFO_NOT_EMPTY 0x08 /* Receive FIFO not empty */ +#define UART_USR_TX_FIFO_EMPTY 0x04 /* Transmit FIFO empty */ +#define UART_USR_TX_FIFO_NOT_FULL 0x02 /* Transmit FIFO not full */ +#define UART_USR_BUSY 0x01 /* UART busy indicator */ + struct rk_fiq_debugger { struct fiq_debugger_pdata pdata; void __iomem *debug_port_base; @@ -113,10 +120,7 @@ static void debug_putc(struct platform_device *pdev, unsigned int c) struct rk_fiq_debugger *t; t = container_of(dev_get_platdata(&pdev->dev), typeof(*t), pdata); -// while (!(rk_fiq_read_lsr(t) & UART_LSR_THRE)) -// cpu_relax(); - //enable TX FIFO - while (!(rk_fiq_read(t, 0x1F) & 0x02)) + while (!(rk_fiq_read(t, UART_USR) & UART_USR_TX_FIFO_NOT_FULL)) cpu_relax(); rk_fiq_write(t, c, UART_TX); } -- 2.34.1