uart: Prepare to support multiple base addresses

Prepare low-level register access to take UART base address as a
parameter. This is done to support a list of base addresses defined
in the platform.

Change-Id: Ie630e55f2562f099b0ba9eb94b08c92d26dfdf2e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/5309
Tested-by: build bot (Jenkins)
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
This commit is contained in:
Kyösti Mälkki
2014-02-24 20:51:30 +02:00
committed by Patrick Georgi
parent e5760af398
commit c2610a4a18
5 changed files with 74 additions and 70 deletions

View File

@@ -15,12 +15,14 @@
#include <console/uart.h>
static void pl011_uart_tx_byte(unsigned char data)
static void pl011_uart_tx_byte(unsigned int *uart_base, unsigned char data)
{
static volatile unsigned int *uart0_address =
(unsigned int *) CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
*uart_base = (unsigned int)data;
}
*uart0_address = (unsigned int)data;
unsigned int uart_platform_base(int idx)
{
return CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
}
#if !defined(__PRE_RAM__)
@@ -36,7 +38,8 @@ void uart_init(void)
void uart_tx_byte(unsigned char data)
{
pl011_uart_tx_byte(data);
unsigned int *uart_base = uart_platform_baseptr(0);
pl011_uart_tx_byte(uart_base, data);
}
void uart_tx_flush(void)