blob: e4bfdc6136cf1d1905953debe6002626a92e4e9a [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älkkic2610a42014-02-24 20:51:30 +020018static void pl011_uart_tx_byte(unsigned int *uart_base, unsigned char data)
Kyösti Mälkki7e75f202014-02-10 23:21:14 +020019{
Kyösti Mälkkic2610a42014-02-24 20:51:30 +020020 *uart_base = (unsigned int)data;
21}
Hung-Te Lin7635a602013-02-12 00:07:38 +080022
Kyösti Mälkkic2610a42014-02-24 20:51:30 +020023unsigned int uart_platform_base(int idx)
24{
25 return CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
Hung-Te Lin7635a602013-02-12 00:07:38 +080026}
27
Hung-Te Lin7635a602013-02-12 00:07:38 +080028#if !defined(__PRE_RAM__)
Ronald G. Minnichc8fadd92013-02-20 14:13:01 -080029uint32_t uartmem_getbaseaddr(void)
30{
Kyösti Mälkki7e75f202014-02-10 23:21:14 +020031 return CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
Ronald G. Minnichc8fadd92013-02-20 14:13:01 -080032}
Kyösti Mälkki0567c912014-02-14 10:31:38 +020033#endif
34
Hung-Te Lin7635a602013-02-12 00:07:38 +080035void uart_init(void)
36{
Hung-Te Lin7635a602013-02-12 00:07:38 +080037}
38
39void uart_tx_byte(unsigned char data)
40{
Kyösti Mälkkic2610a42014-02-24 20:51:30 +020041 unsigned int *uart_base = uart_platform_baseptr(0);
42 pl011_uart_tx_byte(uart_base, data);
Hung-Te Lin7635a602013-02-12 00:07:38 +080043}
44
Kyösti Mälkki7e75f202014-02-10 23:21:14 +020045void uart_tx_flush(void)
46{
Hung-Te Lin7635a602013-02-12 00:07:38 +080047}
Kyösti Mälkki0567c912014-02-14 10:31:38 +020048
49unsigned char uart_rx_byte(void)
50{
51 return 0;
52}