提交 210dce5f 编写于 作者: F Florian Fainelli 提交者: Ryan Mallon

ARM: ep93xx: properly wait for UART FIFO to be empty

This patch changes the busy-waiting loop around in the decompressor
putc() function on the UART FIFO register. Without a proper wait, the
output of the decompressor was corrupted like this:

Uncompressing Linx. done, booting th enl

To highlight the issue more evidently, looping 100 times instead of 1000
makes the issue appear much faster. This patch takes the approach of
using an active while loop until the FIFO is empty (not FULL).
This issue happened to me on Sim.One running at 200Mhz.
Signed-off-by: NFlorian Fainelli <florian@openwrt.org>
Signed-off-by: NRyan Mallon <rmallon@gmail.com>
上级 ddffeb8c
...@@ -47,13 +47,9 @@ static void __raw_writel(unsigned int value, unsigned int ptr) ...@@ -47,13 +47,9 @@ static void __raw_writel(unsigned int value, unsigned int ptr)
static inline void putc(int c) static inline void putc(int c)
{ {
int i; /* Transmit fifo not full? */
while (__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF)
for (i = 0; i < 1000; i++) { ;
/* Transmit fifo not full? */
if (!(__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF))
break;
}
__raw_writeb(c, PHYS_UART_DATA); __raw_writeb(c, PHYS_UART_DATA);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册