[TG3]: Set minimal hw interrupt mitigation.
[linux-2.6/verdex.git] / arch / ppc / syslib / mv64x60_dbg.c
blob2927c7adf5e51c455b30905fc0c2afbf0e5899cd
1 /*
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
11 * or implied.
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;
36 void
37 mv64x60_progress_init(u32 base)
39 mv64x60_dbg_bh.v_base = base;
40 return;
43 static void
44 mv64x60_polled_putc(int chan, char c)
46 u32 offset;
48 if (chan == 0)
49 offset = 0x8000;
50 else
51 offset = 0x9000;
53 mv64x60_write(&mv64x60_dbg_bh, offset + MPSC_CHR_1, (u32)c);
54 mv64x60_write(&mv64x60_dbg_bh, offset + MPSC_CHR_2, 0x200);
55 udelay(2000);
58 void
59 mv64x60_mpsc_progress(char *s, unsigned short hex)
61 volatile char c;
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');
71 return;
73 #endif /* CONFIG_SERIAL_TEXT_DEBUG */
76 #if defined(CONFIG_KGDB)
78 #if defined(CONFIG_KGDB_TTYS0)
79 #define KGDB_PORT 0
80 #elif defined(CONFIG_KGDB_TTYS1)
81 #define KGDB_PORT 1
82 #else
83 #error "Invalid kgdb_tty port"
84 #endif
86 void
87 putDebugChar(unsigned char c)
89 mv64x60_polled_putc(KGDB_PORT, (char)c);
92 int
93 getDebugChar(void)
95 unsigned char c;
97 while (!mv64x60_polled_getc(KGDB_PORT, &c));
98 return (int)c;
101 void
102 putDebugString(char* str)
104 while (*str != '\0') {
105 putDebugChar(*str);
106 str++;
108 putDebugChar('\r');
109 return;
112 void
113 kgdb_interruptible(int enable)
117 void
118 kgdb_map_scc(void)
120 if (ppc_md.early_serial_map)
121 ppc_md.early_serial_map();
123 #endif /* CONFIG_KGDB */