blob: ff4b3e47b20b9a94d029b29a4636b05c620abdad [file] [log] [blame]
Eric Biederman8ca8d762003-04-22 19:02:15 +00001/*
Stefan Reinauer2a8ad412010-09-27 18:49:46 +00002 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2003 Eric Biederman
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
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.
14 *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Eric Biederman8ca8d762003-04-22 19:02:15 +000018 */
19
Kyösti Mälkki1d7541f2014-02-17 21:34:42 +020020#include <console/cbmem_console.h>
Edward O'Callaghan0ddb8262014-06-17 18:37:08 +100021#include <console/ne2k.h>
22#include <console/qemu_debugcon.h>
23#include <console/spkmodem.h>
24#include <console/streams.h>
Kyösti Mälkki1d7541f2014-02-17 21:34:42 +020025#include <console/uart.h>
26#include <console/usb.h>
Edward O'Callaghan0ddb8262014-06-17 18:37:08 +100027#include <rules.h>
Kyösti Mälkki1d7541f2014-02-17 21:34:42 +020028
Kyösti Mälkki21333f92014-02-14 10:04:31 +020029void console_hw_init(void)
Stefan Reinauer5a1f5972010-03-31 14:34:40 +000030{
Kyösti Mälkkif3390862014-02-26 15:19:04 +020031 __cbmemc_init();
32 __spkmodem_init();
33 __qemu_debugcon_init();
34
35 __uart_init();
36 __ne2k_init();
37 __usbdebug_init();
Stefan Reinauer5a1f5972010-03-31 14:34:40 +000038}
Kyösti Mälkkifd956242014-02-03 17:04:22 +020039
Kyösti Mälkkifd956242014-02-03 17:04:22 +020040void console_tx_byte(unsigned char byte)
41{
Kyösti Mälkkif3390862014-02-26 15:19:04 +020042 __cbmemc_tx_byte(byte);
43 __spkmodem_tx_byte(byte);
44 __qemu_debugcon_tx_byte(byte);
45
46 __uart_tx_byte(byte);
47 __ne2k_tx_byte(byte);
48 __usb_tx_byte(byte);
Kyösti Mälkkifd956242014-02-03 17:04:22 +020049}
50
51void console_tx_flush(void)
52{
Kyösti Mälkkif3390862014-02-26 15:19:04 +020053 __uart_tx_flush();
54 __ne2k_tx_flush();
55 __usb_tx_flush();
Kyösti Mälkki40760722014-02-27 19:30:18 +020056}
Kyösti Mälkkif2f7f032014-04-04 15:05:28 +030057
58
59#if CONFIG_GDB_STUB && (ENV_ROMSTAGE || ENV_RAMSTAGE)
60void gdb_hw_init(void)
61{
62 __gdb_hw_init();
63}
64
65void gdb_tx_byte(unsigned char byte)
66{
67 __gdb_tx_byte(byte);
68}
69
70void gdb_tx_flush(void)
71{
72 __gdb_tx_flush();
73}
74
75unsigned char gdb_rx_byte(void)
76{
77 return __gdb_rx_byte();
78}
79#endif