Stefan Reinauer | bbd2f21 | 2011-04-20 21:11:22 +0000 | [diff] [blame] | 1 | /* |
| 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älkki | efb0b51 | 2014-04-13 17:57:34 +0300 | [diff] [blame] | 20 | #include <console/streams.h> |
| 21 | #include <console/early_print.h> |
Stefan Reinauer | bbd2f21 | 2011-04-20 21:11:22 +0000 | [diff] [blame] | 22 | |
Kyösti Mälkki | efb0b51 | 2014-04-13 17:57:34 +0300 | [diff] [blame] | 23 | /* Include the sources. */ |
Kyösti Mälkki | afa7b13 | 2014-02-13 17:16:22 +0200 | [diff] [blame] | 24 | #if CONFIG_CONSOLE_SERIAL && CONFIG_DRIVERS_UART_8250IO |
Kyösti Mälkki | 3ee1668 | 2014-02-17 19:37:52 +0200 | [diff] [blame] | 25 | #include "drivers/uart/util.c" |
Kyösti Mälkki | bea6bf0 | 2014-01-30 15:45:16 +0200 | [diff] [blame] | 26 | #include "drivers/uart/uart8250io.c" |
Stefan Reinauer | bbd2f21 | 2011-04-20 21:11:22 +0000 | [diff] [blame] | 27 | #endif |
| 28 | #if CONFIG_CONSOLE_NE2K |
Kyösti Mälkki | 207379d | 2014-01-31 07:38:21 +0200 | [diff] [blame] | 29 | #include "drivers/net/ne2k.c" |
Stefan Reinauer | bbd2f21 | 2011-04-20 21:11:22 +0000 | [diff] [blame] | 30 | #endif |
| 31 | |
Kyösti Mälkki | efb0b51 | 2014-04-13 17:57:34 +0300 | [diff] [blame] | 32 | void console_hw_init(void) |
| 33 | { |
| 34 | #if CONFIG_CONSOLE_SERIAL |
Kyösti Mälkki | 70342a7 | 2014-03-14 22:28:29 +0200 | [diff] [blame^] | 35 | uart_init(CONFIG_UART_FOR_CONSOLE); |
Kyösti Mälkki | efb0b51 | 2014-04-13 17:57:34 +0300 | [diff] [blame] | 36 | #endif |
| 37 | #if CONFIG_CONSOLE_NE2K |
| 38 | ne2k_init(CONFIG_CONSOLE_NE2K_IO_PORT); |
| 39 | #endif |
| 40 | } |
| 41 | |
| 42 | void console_tx_byte(unsigned char byte) |
Stefan Reinauer | bbd2f21 | 2011-04-20 21:11:22 +0000 | [diff] [blame] | 43 | { |
Kyösti Mälkki | afa7b13 | 2014-02-13 17:16:22 +0200 | [diff] [blame] | 44 | #if CONFIG_CONSOLE_SERIAL |
Kyösti Mälkki | 70342a7 | 2014-03-14 22:28:29 +0200 | [diff] [blame^] | 45 | uart_tx_byte(CONFIG_UART_FOR_CONSOLE, byte); |
Stefan Reinauer | bbd2f21 | 2011-04-20 21:11:22 +0000 | [diff] [blame] | 46 | #endif |
| 47 | #if CONFIG_CONSOLE_NE2K |
| 48 | ne2k_append_data_byte(byte, CONFIG_CONSOLE_NE2K_IO_PORT); |
| 49 | #endif |
Stefan Reinauer | bbd2f21 | 2011-04-20 21:11:22 +0000 | [diff] [blame] | 50 | } |
| 51 | |
Kyösti Mälkki | efb0b51 | 2014-04-13 17:57:34 +0300 | [diff] [blame] | 52 | void console_tx_flush(void) |
Kyösti Mälkki | dbc7bd9 | 2014-01-28 11:34:38 +0200 | [diff] [blame] | 53 | { |
| 54 | #if CONFIG_CONSOLE_SERIAL |
Kyösti Mälkki | 70342a7 | 2014-03-14 22:28:29 +0200 | [diff] [blame^] | 55 | uart_tx_flush(CONFIG_UART_FOR_CONSOLE); |
Kyösti Mälkki | dbc7bd9 | 2014-01-28 11:34:38 +0200 | [diff] [blame] | 56 | #endif |
| 57 | #if CONFIG_CONSOLE_NE2K |
| 58 | ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT); |
| 59 | #endif |
| 60 | } |
| 61 | |
Kyösti Mälkki | efb0b51 | 2014-04-13 17:57:34 +0300 | [diff] [blame] | 62 | #include <console/early_print.c> |
Kyösti Mälkki | 21333f9 | 2014-02-14 10:04:31 +0200 | [diff] [blame] | 63 | #include <console/init.c> |
Stefan Reinauer | bbd2f21 | 2011-04-20 21:11:22 +0000 | [diff] [blame] | 64 | #include <console/post.c> |
| 65 | #include <console/die.c> |