summaryrefslogtreecommitdiffstats
path: root/arch/mips/loongson/common/early_printk.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/loongson/common/early_printk.c')
-rw-r--r--arch/mips/loongson/common/early_printk.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/mips/loongson/common/early_printk.c b/arch/mips/loongson/common/early_printk.c
index 8ec4fb2066a..23e7a8f8897 100644
--- a/arch/mips/loongson/common/early_printk.c
+++ b/arch/mips/loongson/common/early_printk.c
@@ -12,7 +12,6 @@
#include <linux/serial_reg.h>
#include <loongson.h>
-#include <machine.h>
#define PORT(base, offset) (u8 *)(base + offset)
@@ -28,10 +27,14 @@ static inline void serial_out(unsigned char *base, int offset, int value)
void prom_putchar(char c)
{
- unsigned char *uart_base =
- (unsigned char *) ioremap_nocache(LOONGSON_UART_BASE, 8);
+ int timeout;
+ unsigned char *uart_base;
- while ((serial_in(uart_base, UART_LSR) & UART_LSR_THRE) == 0)
+ uart_base = (unsigned char *)_loongson_uart_base;
+ timeout = 1024;
+
+ while (((serial_in(uart_base, UART_LSR) & UART_LSR_THRE) == 0) &&
+ (timeout-- > 0))
;
serial_out(uart_base, UART_TX, c);