path: root/include/drivers
diff options
authorAndre Przywara <andre.przywara@arm.com>2019-12-12 12:00:15 +0000
committerManish Pandey <manish.pandey2@arm.com>2019-12-30 11:40:08 +0000
commitcd50ffd2fcbebc47173174151919333960ebe732 (patch)
treed6578e0431c796f4bfd7629fd8fe2a7796e7bc7a /include/drivers
parent2b4c5e4b6f88cd36055b9881909ffb847570c27a (diff)
console: 16550: Prepare for skipping initialisation
On some platforms the UART might have already been initialised, for instance by firmware running before TF-A or by a separate management processor. In this case it would not be need to initialise it again (doing so could create spurious characters). But more importantly this saves us from knowing the right baudrate and the right base clock rate for the UART. This can lead to more robust and versatile firmware builds. Allow to skip the 16550 UART initialisation and baud rate divisor programming, by interpreting an input clock rate of "0" to signify this case. This will just skip the call to console_16550_core_init, but still will register the console properly. Users should just pass 0 as the second parameter, the baudrate (third parameter) will then be ignored as well. Fix copy & paste typos in comments for the console_16550_register() function on the way. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Change-Id: I9f8fca5b358f878fac0f31dc411358fd160786ee
Diffstat (limited to 'include/drivers')
1 files changed, 5 insertions, 0 deletions
diff --git a/include/drivers/ti/uart/uart_16550.h b/include/drivers/ti/uart/uart_16550.h
index 32e38f0ac1..2b95fa33a6 100644
--- a/include/drivers/ti/uart/uart_16550.h
+++ b/include/drivers/ti/uart/uart_16550.h
@@ -87,6 +87,11 @@ typedef struct {
* framework. The |console| pointer must point to storage that will be valid
* for the lifetime of the console, such as a global or static local variable.
* Its contents will be reinitialized from scratch.
+ * When |clock| has a value of 0, the UART will *not* be initialised. This
+ * means the UART should already be enabled and the baudrate and clock setup
+ * should have been done already, either by platform specific code or by
+ * previous firmware stages. The |baud| parameter will be ignored in this
+ * case as well.
int console_16550_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
console_16550_t *console);