Increase CBMEM to accommodate larger console.
[coreboot.git] / src / console / uart8250_console.c
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
20 #include <console/console.h>
21 #include <uart8250.h>
22 #include <pc80/mc146818rtc.h>
23
24 static void ttyS0_init(void)
25 {
26         uart_init();
27 }
28
29 static void ttyS0_tx_byte(unsigned char data)
30 {
31         uart8250_tx_byte(CONFIG_TTYS0_BASE, data);
32 }
33
34 static void ttyS0_tx_flush(void)
35 {
36         uart8250_tx_flush(CONFIG_TTYS0_BASE);
37 }
38
39 static unsigned char ttyS0_rx_byte(void)
40 {
41         return uart8250_rx_byte(CONFIG_TTYS0_BASE);
42 }
43
44 static int ttyS0_tst_byte(void)
45 {
46         return uart8250_can_rx_byte(CONFIG_TTYS0_BASE);
47 }
48
49 static const struct console_driver uart8250_console __console = {
50         .init     = ttyS0_init,
51         .tx_byte  = ttyS0_tx_byte,
52         .tx_flush = ttyS0_tx_flush,
53         .rx_byte  = ttyS0_rx_byte,
54         .tst_byte = ttyS0_tst_byte,
55 };