summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorIsaac Christensen <isaac.christensen@se-eng.com>2014-09-03 15:34:05 -0600
committerIsaac Christensen <isaac.christensen@se-eng.com>2014-09-08 19:07:15 +0200
commitd68932463f0a5c23ebe19cce4465ed5a17dbb5eb (patch)
treeab67b21103b0d31aad0dc853641d6da385abea6a /src/soc
parent33e295e66fe6fa5d7f2fead3bbbe30b6bfd5dca4 (diff)
downloadcoreboot-d68932463f0a5c23ebe19cce4465ed5a17dbb5eb.tar.xz
tegra124: return the UART base address based on index
Change-Id: I73a8e56559c7ffdaab39a5c19311221c91565004 Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com> Reviewed-on: http://review.coreboot.org/6830 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/nvidia/tegra124/uart.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/soc/nvidia/tegra124/uart.c b/src/soc/nvidia/tegra124/uart.c
index d28cbb7016..9d06a0a34e 100644
--- a/src/soc/nvidia/tegra124/uart.c
+++ b/src/soc/nvidia/tegra124/uart.c
@@ -95,8 +95,17 @@ static int tegra124_uart_tst_byte(struct tegra124_uart *uart_ptr)
unsigned int uart_platform_base(int idx)
{
- //TODO:return the correct address based on which UART has been selected
- return CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
+ //Default to UART A
+ unsigned int base = 0x70006000;
+ //UARTs A - E are mapped as index 0 - 4
+ if ((idx < 5) && (idx >= 0)) {
+ if (idx != 1) { //not UART B
+ base += idx * 0x100;
+ } else {
+ base += 0x40;
+ }
+ }
+ return base;
}
void uart_init(int idx)