2 * This file is part of the coreboot project.
4 * Copyright (C) 2008-2009 coresystems GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
23 #include <arch/romcc_io.h>
24 #include <cpu/x86/cache.h>
25 #include <cpu/x86/smm.h>
27 #include <console/console.h>
28 #include <console/vtxprintf.h>
29 #if CONFIG_CONSOLE_SERIAL8250 || CONFIG_CONSOLE_SERIAL8250MEM
35 #if CONFIG_CONSOLE_NE2K
36 #include <console/ne2k.h>
39 #if CONFIG_CONSOLE_SERIAL8250MEM
40 static u32 serial8250mem_base_address = 0;
43 void console_tx_flush(void)
45 // the tx_byte functions take care of the flush.
46 // if not, this should be implemented.
49 void console_tx_byte(unsigned char byte)
52 console_tx_byte('\r');
54 #if CONFIG_CONSOLE_SERIAL8250MEM
55 if (serial8250mem_base_address)
56 uart8250_mem_tx_byte(serial8250mem_base_address, byte);
58 #if CONFIG_CONSOLE_SERIAL8250
59 uart8250_tx_byte(CONFIG_TTYS0_BASE, byte);
62 usbdebug_tx_byte(byte);
64 #if CONFIG_CONSOLE_NE2K
65 ne2k_append_data(&byte, 1, CONFIG_CONSOLE_NE2K_IO_PORT);
69 void console_init(void)
72 console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
73 #if CONFIG_CONSOLE_SERIAL8250
76 #if CONFIG_CONSOLE_SERIAL8250MEM
77 serial8250mem_base_address = uart_mem_init();