MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / arch / arm / mach-moxart / debug.c
blobf801555a8286e5cd09ee980d24efa0c81d9bd8fd
2 #include <asm/arch/cpe/cpe.h>
4 #define SERIAL_THR 0x00
5 #define SERIAL_LSR 0x14
6 #define SERIAL_LSR_THRE 0x20
8 void debug_puts(const char *s)
10 while (*s)
12 volatile unsigned int status=0;
15 status = *(unsigned char *)(IO_ADDRESS(CPE_UART1_BASE)+SERIAL_LSR);
17 while (!((status & SERIAL_LSR_THRE)==SERIAL_LSR_THRE) );
19 *(unsigned char *)(IO_ADDRESS(CPE_UART1_BASE)+SERIAL_THR) = *s;
21 if (*s == '\n')
26 status = *(unsigned char *)(IO_ADDRESS(CPE_UART1_BASE)+SERIAL_LSR);
28 while (!((status & SERIAL_LSR_THRE)==SERIAL_LSR_THRE) );
30 *(unsigned char *)(IO_ADDRESS(CPE_UART1_BASE)+SERIAL_THR) = '\r';
32 s++;