aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ep93xx
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2012-12-10 22:21:19 +0100
committerRyan Mallon <rmallon@gmail.com>2012-12-12 11:22:56 +1100
commit210dce5faf89c9677ac1a6273bc53f130843539f (patch)
tree3264b007ed0677df29683975571daa89cbe463d5 /arch/arm/mach-ep93xx
parentLinux 3.7-rc1 (diff)
downloadlinux-dev-210dce5faf89c9677ac1a6273bc53f130843539f.tar.xz
linux-dev-210dce5faf89c9677ac1a6273bc53f130843539f.zip
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: Florian Fainelli <florian@openwrt.org> Signed-off-by: Ryan Mallon <rmallon@gmail.com>
Diffstat (limited to 'arch/arm/mach-ep93xx')
-rw-r--r--arch/arm/mach-ep93xx/include/mach/uncompress.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/arm/mach-ep93xx/include/mach/uncompress.h b/arch/arm/mach-ep93xx/include/mach/uncompress.h
index 16026c2b1c8c..d64274fc5760 100644
--- a/arch/arm/mach-ep93xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ep93xx/include/mach/uncompress.h
@@ -47,13 +47,9 @@ static void __raw_writel(unsigned int value, unsigned int ptr)
static inline void putc(int c)
{
- int i;
-
- for (i = 0; i < 1000; i++) {
- /* Transmit fifo not full? */
- if (!(__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF))
- break;
- }
+ /* Transmit fifo not full? */
+ while (__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF)
+ ;
__raw_writeb(c, PHYS_UART_DATA);
}