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>
26 #include <console/console.h>
27 #include <console/vtxprintf.h>
29 #if CONFIG_CONSOLE_SERIAL8250MEM
30 static u32 serial8250mem_base_address = 0;
33 void console_tx_flush(void)
35 // the tx_byte functions take care of the flush.
36 // if not, this should be implemented.
39 void console_tx_byte(unsigned char byte)
42 console_tx_byte('\r');
44 #if CONFIG_CONSOLE_SERIAL8250MEM
45 if (serial8250mem_base_address)
46 uart8250_mem_tx_byte(serial8250mem_base_address, byte);
48 #if CONFIG_CONSOLE_SERIAL8250
49 uart8250_tx_byte(CONFIG_TTYS0_BASE, byte);
52 usbdebug_tx_byte(byte);
54 #if CONFIG_CONSOLE_NE2K
55 ne2k_append_data(&byte, 1, CONFIG_CONSOLE_NE2K_IO_PORT);
59 void console_init(void)
62 console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
63 #if CONFIG_CONSOLE_SERIAL8250
66 #if CONFIG_CONSOLE_SERIAL8250MEM
67 serial8250mem_base_address = uart_mem_init();