3 * Peter De Schrijver (p2@mind.be), Mind Linux Solutions, NV.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22 #include <asm/u-boot.h>
23 #include <asm/processor.h>
26 #include <configs/ML2.h>
28 #if (defined CFG_INIT_CHAN1) || (defined CFG_INIT_CHAN2)
36 #if (defined CFG_INIT_CHAN1) || (defined CFG_INIT_CHAN2)
37 const NS16550_t COM_PORTS[] = { (NS16550_t) CFG_NS16550_COM1,
38 (NS16550_t) CFG_NS16550_COM2 };
44 DECLARE_GLOBAL_DATA_PTR;
46 int clock_divisor = CFG_NS16550_CLK / 16 / gd->baudrate;
49 (void)NS16550_init(COM_PORTS[0], clock_divisor);
52 (void)NS16550_init(COM_PORTS[1], clock_divisor);
59 serial_putc(const char c)
62 NS16550_putc(COM_PORTS[CFG_DUART_CHAN], '\r');
64 NS16550_putc(COM_PORTS[CFG_DUART_CHAN], c);
70 return NS16550_getc(COM_PORTS[CFG_DUART_CHAN]);
76 return NS16550_tstc(COM_PORTS[CFG_DUART_CHAN]);
82 DECLARE_GLOBAL_DATA_PTR;
84 int clock_divisor = CFG_NS16550_CLK / 16 / gd->baudrate;
87 NS16550_reinit(COM_PORTS[0], clock_divisor);
90 NS16550_reinit(COM_PORTS[1], clock_divisor);
95 serial_puts (const char *s)
102 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
104 kgdb_serial_init(void)
115 putDebugStr (const char *str)
123 return serial_getc();
127 kgdb_interruptible (int yes)
131 #endif /* CFG_CMD_KGDB */