2 * arch/ppc/syslib/mv64x60_dbg.c
4 * KGDB and progress routines for the Marvell/Galileo MV64x60 (Discovery).
6 * Author: Mark A. Greer <mgreer@mvista.com>
8 * 2003 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
15 *****************************************************************************
17 * Low-level MPSC/UART I/O routines
19 *****************************************************************************
23 #include <linux/config.h>
24 #include <linux/irq.h>
25 #include <asm/delay.h>
26 #include <asm/mv64x60.h>
29 #if defined(CONFIG_SERIAL_TEXT_DEBUG)
31 #define MPSC_CHR_1 0x000c
32 #define MPSC_CHR_2 0x0010
34 static struct mv64x60_handle mv64x60_dbg_bh
;
37 mv64x60_progress_init(u32 base
)
39 mv64x60_dbg_bh
.v_base
= base
;
44 mv64x60_polled_putc(int chan
, char c
)
53 mv64x60_write(&mv64x60_dbg_bh
, offset
+ MPSC_CHR_1
, (u32
)c
);
54 mv64x60_write(&mv64x60_dbg_bh
, offset
+ MPSC_CHR_2
, 0x200);
59 mv64x60_mpsc_progress(char *s
, unsigned short hex
)
63 mv64x60_polled_putc(0, '\r');
65 while ((c
= *s
++) != 0)
66 mv64x60_polled_putc(0, c
);
68 mv64x60_polled_putc(0, '\n');
69 mv64x60_polled_putc(0, '\r');
73 #endif /* CONFIG_SERIAL_TEXT_DEBUG */
76 #if defined(CONFIG_KGDB)
78 #if defined(CONFIG_KGDB_TTYS0)
80 #elif defined(CONFIG_KGDB_TTYS1)
83 #error "Invalid kgdb_tty port"
87 putDebugChar(unsigned char c
)
89 mv64x60_polled_putc(KGDB_PORT
, (char)c
);
97 while (!mv64x60_polled_getc(KGDB_PORT
, &c
));
102 putDebugString(char* str
)
104 while (*str
!= '\0') {
113 kgdb_interruptible(int enable
)
120 if (ppc_md
.early_serial_map
)
121 ppc_md
.early_serial_map();
123 #endif /* CONFIG_KGDB */