blob: 6c7f0506c6bc606474be4acf4905ab892b044aa7 [file] [log] [blame]
Stefan Reinauerbbd2f212011-04-20 21:11:22 +00001/*
2 * 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
18 */
19
Kyösti Mälkkiefb0b512014-04-13 17:57:34 +030020#include <console/streams.h>
21#include <console/early_print.h>
Stefan Reinauerbbd2f212011-04-20 21:11:22 +000022
Kyösti Mälkkiefb0b512014-04-13 17:57:34 +030023/* Include the sources. */
Kyösti Mälkkiafa7b132014-02-13 17:16:22 +020024#if CONFIG_CONSOLE_SERIAL && CONFIG_DRIVERS_UART_8250IO
Kyösti Mälkki3ee16682014-02-17 19:37:52 +020025#include "drivers/uart/util.c"
Kyösti Mälkkibea6bf02014-01-30 15:45:16 +020026#include "drivers/uart/uart8250io.c"
Stefan Reinauerbbd2f212011-04-20 21:11:22 +000027#endif
28#if CONFIG_CONSOLE_NE2K
Kyösti Mälkki207379d2014-01-31 07:38:21 +020029#include "drivers/net/ne2k.c"
Stefan Reinauerbbd2f212011-04-20 21:11:22 +000030#endif
31
Kyösti Mälkkiefb0b512014-04-13 17:57:34 +030032void console_hw_init(void)
33{
34#if CONFIG_CONSOLE_SERIAL
35 uart_init();
36#endif
37#if CONFIG_CONSOLE_NE2K
38 ne2k_init(CONFIG_CONSOLE_NE2K_IO_PORT);
39#endif
40}
41
42void console_tx_byte(unsigned char byte)
Stefan Reinauerbbd2f212011-04-20 21:11:22 +000043{
Kyösti Mälkkiafa7b132014-02-13 17:16:22 +020044#if CONFIG_CONSOLE_SERIAL
Kyösti Mälkki47707492014-02-15 07:53:18 +020045 uart_tx_byte(byte);
Stefan Reinauerbbd2f212011-04-20 21:11:22 +000046#endif
47#if CONFIG_CONSOLE_NE2K
48 ne2k_append_data_byte(byte, CONFIG_CONSOLE_NE2K_IO_PORT);
49#endif
Stefan Reinauerbbd2f212011-04-20 21:11:22 +000050}
51
Kyösti Mälkkiefb0b512014-04-13 17:57:34 +030052void console_tx_flush(void)
Kyösti Mälkkidbc7bd92014-01-28 11:34:38 +020053{
54#if CONFIG_CONSOLE_SERIAL
55 uart_tx_flush();
56#endif
57#if CONFIG_CONSOLE_NE2K
58 ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT);
59#endif
60}
61
Kyösti Mälkkiefb0b512014-04-13 17:57:34 +030062#include <console/early_print.c>
Kyösti Mälkki21333f92014-02-14 10:04:31 +020063#include <console/init.c>
Stefan Reinauerbbd2f212011-04-20 21:11:22 +000064#include <console/post.c>
65#include <console/die.c>