diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-02-24 20:51:30 +0200 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2014-04-09 11:13:03 +0200 |
commit | c2610a4a186c6e5a05f6518c2c7a734fde8f6cfd (patch) | |
tree | 21af900856344ac5a21ff6eca474d54fd7de97ac /src/drivers/uart | |
parent | e5760af3980ea4c55afd7e759e8ca2a078a4a1dc (diff) |
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>
Diffstat (limited to 'src/drivers/uart')
-rw-r--r-- | src/drivers/uart/pl011.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/drivers/uart/pl011.c b/src/drivers/uart/pl011.c index 2202de755d..e4bfdc6136 100644 --- a/src/drivers/uart/pl011.c +++ b/src/drivers/uart/pl011.c @@ -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) |