3 * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
5 * modified for marvell db64360 eval board by
6 * Ingo Assmus <ingo.assmus@keymile.com>
8 * modified for cpci750 board by
9 * Reinhard Arlt <reinhard.arlt@esd-electronics.com>
11 * See file CREDITS for list of people who contributed to this
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * serial.c - serial support for esd cpci750 board
34 /* supports the MPSC */
39 #include <linux/compiler.h>
41 #include "../../Marvell/include/memory.h"
46 DECLARE_GLOBAL_DATA_PTR;
48 static int cpci750_serial_init(void)
50 mpsc_init (gd->baudrate);
55 static void cpci750_serial_putc(const char c)
63 static int cpci750_serial_getc(void)
65 return mpsc_getchar ();
68 static int cpci750_serial_tstc(void)
70 return mpsc_test_char ();
73 static void cpci750_serial_setbrg(void)
75 galbrg_set_baudrate (CONFIG_MPSC_PORT, gd->baudrate);
79 static void cpci750_serial_puts(const char *s)
86 #ifdef CONFIG_SERIAL_MULTI
87 static struct serial_device cpci750_serial_drv = {
88 .name = "cpci750_serial",
89 .start = cpci750_serial_init,
91 .setbrg = cpci750_serial_setbrg,
92 .putc = cpci750_serial_putc,
93 .puts = cpci750_serial_puts,
94 .getc = cpci750_serial_getc,
95 .tstc = cpci750_serial_tstc,
98 void cpci750_serial_initialize(void)
100 serial_register(&cpci750_serial_drv);
103 __weak struct serial_device *default_serial_console(void)
105 return &cpci750_serial_drv;
108 int serial_init(void)
110 return cpci750_serial_init();
113 void serial_setbrg(void)
115 cpci750_serial_setbrg();
118 void serial_putc(const char c)
120 cpci750_serial_putc(c);
123 void serial_puts(const char *s)
125 cpci750_serial_puts(s);
128 int serial_getc(void)
130 return cpci750_serial_getc();
133 int serial_tstc(void)
135 return cpci750_serial_tstc();
138 #if defined(CONFIG_CMD_KGDB)
139 void kgdb_serial_init (void)
143 void putDebugChar (int c)
148 void putDebugStr (const char *str)
153 int getDebugChar (void)
155 return serial_getc ();
158 void kgdb_interruptible (int yes)