2013-02-11 17:07:38 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013 Google, Inc.
|
|
|
|
*
|
|
|
|
* This software is licensed under the terms of the GNU General Public
|
|
|
|
* License version 2, as published by the Free Software Foundation, and
|
|
|
|
* may be copied, distributed, and modified under those terms.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <console/console.h>
|
2014-02-17 20:34:42 +01:00
|
|
|
#include <console/uart.h>
|
2013-02-11 17:07:38 +01:00
|
|
|
|
2014-02-10 22:21:14 +01:00
|
|
|
static void pl011_uart_tx_byte(unsigned char data)
|
|
|
|
{
|
2013-02-11 17:07:38 +01:00
|
|
|
static volatile unsigned int *uart0_address =
|
2014-02-10 22:21:14 +01:00
|
|
|
(unsigned int *) CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
|
2013-02-11 17:07:38 +01:00
|
|
|
|
|
|
|
*uart0_address = (unsigned int)data;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if !defined(__PRE_RAM__)
|
|
|
|
|
|
|
|
static const struct console_driver pl011_uart_console __console = {
|
|
|
|
.tx_byte = pl011_uart_tx_byte,
|
|
|
|
};
|
|
|
|
|
2013-02-20 23:13:01 +01:00
|
|
|
uint32_t uartmem_getbaseaddr(void)
|
|
|
|
{
|
2014-02-10 22:21:14 +01:00
|
|
|
return CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
|
2013-02-20 23:13:01 +01:00
|
|
|
}
|
2013-02-11 17:07:38 +01:00
|
|
|
#else
|
|
|
|
void uart_init(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void uart_tx_byte(unsigned char data)
|
|
|
|
{
|
|
|
|
pl011_uart_tx_byte(data);
|
|
|
|
}
|
|
|
|
|
2014-02-10 22:21:14 +01:00
|
|
|
void uart_tx_flush(void)
|
|
|
|
{
|
2013-02-11 17:07:38 +01:00
|
|
|
}
|
|
|
|
#endif
|