summaryrefslogtreecommitdiff
path: root/src/soc/imgtec/pistachio/uart.c
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2015-01-26 07:11:01 -0800
committerPatrick Georgi <pgeorgi@google.com>2015-04-17 10:11:45 +0200
commitb116a1aa9ce289cd27f6eed51d3ce1d7dd35377b (patch)
tree453a0fb97047395b2c2e58b1b31a41484c0a6a4b /src/soc/imgtec/pistachio/uart.c
parentd82e0cf331b5f7f3122930808705030ed861b14e (diff)
pistachio: Move console UART to a Kconfig variable
This allows us to define the serial console UART on a per-board basis. BUG=chrome-os-partner:31438 BRANCH=none TEST=built and booted on urara w/ follow-up patches Change-Id: Idbb0d39bf8855df4312f7499c60b8b92826fdd07 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: ed4cfdd5ed6ccbf87a50f56d3e07f2f1a9d49464 Original-Change-Id: I3faeb92f026062cded390603a610e5b8f7c9bc12 Original-Signed-off-by: David Hendricks <dhendrix@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/243211 Original-Reviewed-by: Ionela Voinescu <ionela.voinescu@imgtec.com> Reviewed-on: http://review.coreboot.org/9777 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks <dhendrix@chromium.org>
Diffstat (limited to 'src/soc/imgtec/pistachio/uart.c')
-rw-r--r--src/soc/imgtec/pistachio/uart.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/src/soc/imgtec/pistachio/uart.c b/src/soc/imgtec/pistachio/uart.c
index ee5da57a37..a9e1a54bee 100644
--- a/src/soc/imgtec/pistachio/uart.c
+++ b/src/soc/imgtec/pistachio/uart.c
@@ -122,23 +122,9 @@ unsigned int uart_platform_refclk(void)
return 1843318;
}
-uintptr_t uart_platform_base(int idx)
-{
- switch (idx) {
- case 0:
- return 0xb8101400;
-
- case 1:
- return 0xb8101500;
-
- default:
- return 0x0;
- }
-}
-
void uart_init(int idx)
{
- u32 base = uart_platform_base(idx);
+ u32 base = CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
if (!base)
return;
@@ -150,26 +136,17 @@ void uart_init(int idx)
void uart_tx_byte(int idx, unsigned char data)
{
- u32 base = uart_platform_base(idx);
- if (!base)
- return;
- uart8250_mem_tx_byte(base, data);
+ uart8250_mem_tx_byte(CONFIG_CONSOLE_SERIAL_UART_ADDRESS, data);
}
unsigned char uart_rx_byte(int idx)
{
- u32 base = uart_platform_base(idx);
- if (!base)
- return 0xff;
- return uart8250_mem_rx_byte(base);
+ return uart8250_mem_rx_byte(CONFIG_CONSOLE_SERIAL_UART_ADDRESS);
}
void uart_tx_flush(int idx)
{
- u32 base = uart_platform_base(idx);
- if (!base)
- return;
- uart8250_mem_tx_flush(base);
+ uart8250_mem_tx_flush(CONFIG_CONSOLE_SERIAL_UART_ADDRESS);
}
#ifndef __PRE_RAM__
@@ -177,7 +154,7 @@ void uart_fill_lb(void *data)
{
struct lb_serial serial;
serial.type = LB_SERIAL_TYPE_MEMORY_MAPPED;
- serial.baseaddr = uart_platform_base(CONFIG_UART_FOR_CONSOLE);
+ serial.baseaddr = CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
serial.baud = default_baudrate();
serial.regwidth = 1 << UART_SHIFT;
lb_add_serial(&serial, data);