Patrick Georgi merged this change.

View Change

Approvals: build bot (Jenkins): Verified Lance Zhao: Looks good to me, approved
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>
---
M src/soc/intel/common/block/uart/uart.c
1 file 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 35c2c6c..47774b6 100644
--- a/src/soc/intel/common/block/uart/uart.c
+++ b/src/soc/intel/common/block/uart/uart.c
@@ -46,8 +46,9 @@
#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


To view, visit change 33096. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3fa5c99958b56ca5b0b603917c086bdddb677fa2
Gerrit-Change-Number: 33096
Gerrit-PatchSet: 2
Gerrit-Owner: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Lance Zhao <lance.zhao@gmail.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph@9elements.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged