]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
debug_uart: Add an option to announce the debug UART
authorSimon Glass <sjg@chromium.org>
Mon, 19 Oct 2015 01:51:25 +0000 (19:51 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 21 Oct 2015 13:46:50 +0000 (07:46 -0600)
It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/serial/Kconfig
include/debug_uart.h

index 39f65007c9d659b322c65a553df7822d64ca005c..ac5920ad5a94634a13c1fff7093e064bdaec0f6a 100644 (file)
@@ -120,6 +120,16 @@ config DEBUG_UART_BOARD_INIT
          here that is needed to set up the UART ready for use, such as set
          pin multiplexing or enable clocks.
 
+config DEBUG_UART_ANNOUNCE
+       bool "Show a message when the debug UART starts up"
+       depends on DEBUG_UART
+       help
+         Enable this option to show a message when the debug UART is ready
+         for use. You will see a message like "<debug_uart> " as soon as
+         U-Boot has the UART ready for use (i.e. your code calls
+         debug_uart_init()). This can be useful just as a check that
+         everything is working.
+
 config ROCKCHIP_SERIAL
        bool "Rockchip on-chip UART support"
        depends on ARCH_ROCKCHIP && DM_SERIAL
index a6b7ce8e6eede1a1d74850e22663cb0f973bd63c..5d5349bbd2e87ed9b65131fc6d095dd56cd19172 100644 (file)
@@ -105,6 +105,12 @@ void printhex4(uint value);
  */
 void printhex8(uint value);
 
+#ifdef CONFIG_DEBUG_UART_ANNOUNCE
+#define _DEBUG_UART_ANNOUNCE   printascii("<debug_uart> ");
+#else
+#define _DEBUG_UART_ANNOUNCE
+#endif
+
 /*
  * Now define some functions - this should be inserted into the serial driver
  */
@@ -151,6 +157,7 @@ void printhex8(uint value);
        { \
                board_debug_uart_init(); \
                _debug_uart_init(); \
+               _DEBUG_UART_ANNOUNCE \
        } \
 
 #endif