blob: 2202de755d9b7314c026d31270603100c6f20a6a [file] [log] [blame]
Hung-Te Lin7635a602013-02-12 00:07:38 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 Google, Inc.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
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
Kyösti Mälkki1d7541f2014-02-17 21:34:42 +020016#include <console/uart.h>
Hung-Te Lin7635a602013-02-12 00:07:38 +080017
Kyösti Mälkki7e75f202014-02-10 23:21:14 +020018static void pl011_uart_tx_byte(unsigned char data)
19{
Hung-Te Lin7635a602013-02-12 00:07:38 +080020 static volatile unsigned int *uart0_address =
Kyösti Mälkki7e75f202014-02-10 23:21:14 +020021 (unsigned int *) CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
Hung-Te Lin7635a602013-02-12 00:07:38 +080022
23 *uart0_address = (unsigned int)data;
24}
25
Hung-Te Lin7635a602013-02-12 00:07:38 +080026#if !defined(__PRE_RAM__)
Ronald G. Minnichc8fadd92013-02-20 14:13:01 -080027uint32_t uartmem_getbaseaddr(void)
28{
Kyösti Mälkki7e75f202014-02-10 23:21:14 +020029 return CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
Ronald G. Minnichc8fadd92013-02-20 14:13:01 -080030}
Kyösti Mälkki0567c912014-02-14 10:31:38 +020031#endif
32
Hung-Te Lin7635a602013-02-12 00:07:38 +080033void uart_init(void)
34{
Hung-Te Lin7635a602013-02-12 00:07:38 +080035}
36
37void uart_tx_byte(unsigned char data)
38{
39 pl011_uart_tx_byte(data);
40}
41
Kyösti Mälkki7e75f202014-02-10 23:21:14 +020042void uart_tx_flush(void)
43{
Hung-Te Lin7635a602013-02-12 00:07:38 +080044}
Kyösti Mälkki0567c912014-02-14 10:31:38 +020045
46unsigned char uart_rx_byte(void)
47{
48 return 0;
49}