MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / arch / arm / mach-moxacpu / debug_cpe.c
blob8f7319602e32a4d0462d43783d1940e8f3dfb611
1 /*
2 * linux/include/asm-arm/arch-integrator/debug-cpe.c
4 * Copyright (C) 1999 ARM Limited
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include <asm/arch/cpe/cpe.h>
23 #define SERIAL_THR 0x00
24 #define SERIAL_LSR 0x14
25 #define SERIAL_LSR_THRE 0x20
27 void debug_puts(const char *s)
29 while (*s)
31 volatile unsigned int status=0;
34 status = *(unsigned char *)(IO_ADDRESS(CPE_UART1_BASE)+SERIAL_LSR);
36 while (!((status & SERIAL_LSR_THRE)==SERIAL_LSR_THRE) );
38 *(unsigned char *)(IO_ADDRESS(CPE_UART1_BASE)+SERIAL_THR) = *s;
40 if (*s == '\n')
45 status = *(unsigned char *)(IO_ADDRESS(CPE_UART1_BASE)+SERIAL_LSR);
47 while (!((status & SERIAL_LSR_THRE)==SERIAL_LSR_THRE) );
49 *(unsigned char *)(IO_ADDRESS(CPE_UART1_BASE)+SERIAL_THR) = '\r';
51 s++;
53 // while (AMBA_UART_FR & (1 << 3));