Bryant Ou has uploaded this change for review.

View Change

drivers/uart: Override uart base address

Add CONFIG_UART_OVERRIDE_BASE_ADDR to select the function, platform
overrides the base address by providing a uart_platform_base routine.

Signed-off-by: Bryant Ou <Bryant.Ou.Q@gmail.com>
Change-Id: I2079bd1e5ffa209553383b6aafe3b8724849ba2a
---
M src/drivers/uart/Kconfig
M src/drivers/uart/uart8250io.c
2 files changed, 9 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/05/45405/1
diff --git a/src/drivers/uart/Kconfig b/src/drivers/uart/Kconfig
index 41b870f..9cbb359 100644
--- a/src/drivers/uart/Kconfig
+++ b/src/drivers/uart/Kconfig
@@ -33,6 +33,13 @@
Set to "y" when the platform overrides the uart_platform_refclk
routine.

+config UART_OVERRIDE_BASE_ADDR
+ bool
+ default n
+ help
+ Set to "y" when the platform overrides the base address by providing
+ a uart_platform_base routine.
+
config DRIVERS_UART_8250MEM
bool
default n
diff --git a/src/drivers/uart/uart8250io.c b/src/drivers/uart/uart8250io.c
index d0841de..c5317af 100644
--- a/src/drivers/uart/uart8250io.c
+++ b/src/drivers/uart/uart8250io.c
@@ -75,6 +75,7 @@
ENABLE_TRACE;
}

+#if !CONFIG(UART_OVERRIDE_BASE_ADDR)
static const unsigned int bases[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };

uintptr_t uart_platform_base(unsigned int idx)
@@ -83,6 +84,7 @@
return bases[idx];
return 0;
}
+#endif

void uart_init(unsigned int idx)
{

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2079bd1e5ffa209553383b6aafe3b8724849ba2a
Gerrit-Change-Number: 45405
Gerrit-PatchSet: 1
Gerrit-Owner: Bryant Ou <bryant.ou.q@gmail.com>
Gerrit-MessageType: newchange