2 * This file is part of the coreboot project.
4 * Copyright (C) 2003 Eric Biederman
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.
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.
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
20 #include <console/console.h>
22 #include <pc80/mc146818rtc.h>
24 static void ttyS0_init(void)
29 static void ttyS0_tx_byte(unsigned char data)
31 uart8250_tx_byte(CONFIG_TTYS0_BASE, data);
34 static void ttyS0_tx_flush(void)
36 uart8250_tx_flush(CONFIG_TTYS0_BASE);
39 static unsigned char ttyS0_rx_byte(void)
41 return uart8250_rx_byte(CONFIG_TTYS0_BASE);
44 static int ttyS0_tst_byte(void)
46 return uart8250_can_rx_byte(CONFIG_TTYS0_BASE);
49 static const struct console_driver uart8250_console __console = {
51 .tx_byte = ttyS0_tx_byte,
52 .tx_flush = ttyS0_tx_flush,
53 .rx_byte = ttyS0_rx_byte,
54 .tst_byte = ttyS0_tst_byte,