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>
27 #include <asm/machdep.h>
30 #if defined(CONFIG_SERIAL_TEXT_DEBUG)
32 #define MPSC_CHR_1 0x000c
33 #define MPSC_CHR_2 0x0010
35 static struct mv64x60_handle mv64x60_dbg_bh;
38 mv64x60_progress_init(u32 base)
40 mv64x60_dbg_bh.v_base = base;
45 mv64x60_polled_putc(int chan, char c)
54 mv64x60_write(&mv64x60_dbg_bh, offset + MPSC_CHR_1, (u32)c);
55 mv64x60_write(&mv64x60_dbg_bh, offset + MPSC_CHR_2, 0x200);
60 mv64x60_mpsc_progress(char *s, unsigned short hex)
64 mv64x60_polled_putc(0, '\r');
66 while ((c = *s++) != 0)
67 mv64x60_polled_putc(0, c);
69 mv64x60_polled_putc(0, '\n');
70 mv64x60_polled_putc(0, '\r');
74 #endif /* CONFIG_SERIAL_TEXT_DEBUG */
77 #if defined(CONFIG_KGDB)
79 #if defined(CONFIG_KGDB_TTYS0)
81 #elif defined(CONFIG_KGDB_TTYS1)
84 #error "Invalid kgdb_tty port"
88 putDebugChar(unsigned char c)
90 mv64x60_polled_putc(KGDB_PORT, (char)c);
98 while (!mv64x60_polled_getc(KGDB_PORT, &c));
103 putDebugString(char* str)
105 while (*str != '\0') {
114 kgdb_interruptible(int enable)
121 if (ppc_md.early_serial_map)
122 ppc_md.early_serial_map();
124 #endif /* CONFIG_KGDB */