summaryrefslogtreecommitdiffstats
path: root/src/soc/intel/common/block/uart/uart.c
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2019-05-29 18:33:35 +0200
committerPatrick Georgi <pgeorgi@google.com>2019-06-03 13:24:06 +0000
commitce8eebd3b7642e3d675616fb8d3d068cb58d66ef (patch)
treebc93d3a76de342112164b57c4c9043e660571d37 /src/soc/intel/common/block/uart/uart.c
parent8bbad6c8186037e67da9f1465078b5952c0c0899 (diff)
downloadcoreboot-ce8eebd3b7642e3d675616fb8d3d068cb58d66ef.tar.gz
coreboot-ce8eebd3b7642e3d675616fb8d3d068cb58d66ef.tar.bz2
coreboot-ce8eebd3b7642e3d675616fb8d3d068cb58d66ef.zip
soc/intel/common/uart: Only return valid UART base
We only configure the base address for the console UART, the other addresses are never assigned to the hardware. It seems better to return 0 for them instead of a spurious value. Change-Id: I3fa5c99958b56ca5b0b603917c086bdddb677fa2 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33096 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lance Zhao <lance.zhao@gmail.com>
Diffstat (limited to 'src/soc/intel/common/block/uart/uart.c')
-rw-r--r--src/soc/intel/common/block/uart/uart.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/soc/intel/common/block/uart/uart.c b/src/soc/intel/common/block/uart/uart.c
index 35c2c6cafb04..47774b6e96b8 100644
--- a/src/soc/intel/common/block/uart/uart.c
+++ b/src/soc/intel/common/block/uart/uart.c
@@ -46,8 +46,9 @@ static void uart_lpss_init(uintptr_t baseaddr)
#if CONFIG(DRIVERS_UART_8250MEM)
uintptr_t uart_platform_base(int idx)
{
- /* return Base address for UART console index */
- return UART_BASE_0_ADDR(idx);
+ if (idx == CONFIG_UART_FOR_CONSOLE)
+ return UART_BASE_0_ADDR(CONFIG_UART_FOR_CONSOLE);
+ return 0;
}
#endif