From a081568d7016061ed848696984e3acf1ba0b3054 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 28 Mar 2006 10:24:33 +0100 Subject: [ARM] Fix decompressor serial IO to give CRLF not LFCR As per the corresponding change to the serial drivers, arrange for ARM decompressors to give CRLF. Move the common putstr code into misc.c such that machines only need to supply "putc" and "flush" functions. Signed-off-by: Russell King --- include/asm-arm/arch-at91rm9200/uncompress.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'include/asm-arm/arch-at91rm9200') diff --git a/include/asm-arm/arch-at91rm9200/uncompress.h b/include/asm-arm/arch-at91rm9200/uncompress.h index b30dd552071..7b38497c24b 100644 --- a/include/asm-arm/arch-at91rm9200/uncompress.h +++ b/include/asm-arm/arch-at91rm9200/uncompress.h @@ -31,21 +31,22 @@ * * This does not append a newline */ -static void putstr(const char *s) +static void putc(int c) +{ + void __iomem *sys = (void __iomem *) AT91_BASE_SYS; /* physical address */ + + while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXRDY)) + barrier(); + __raw_writel(c, sys + AT91_DBGU_THR); +} + +static inline void flush(void) { void __iomem *sys = (void __iomem *) AT91_BASE_SYS; /* physical address */ - while (*s) { - while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXRDY)) { barrier(); } - __raw_writel(*s, sys + AT91_DBGU_THR); - if (*s == '\n') { - while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXRDY)) { barrier(); } - __raw_writel('\r', sys + AT91_DBGU_THR); - } - s++; - } /* wait for transmission to complete */ - while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXEMPTY)) { barrier(); } + while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXEMPTY)) + barrier(); } #define arch_decomp_setup() -- cgit v1.2.3