[U-Boot] [PATCH v2 3/5] debug_uart: Add an option to announce the debug UART

Simon Glass sjg at chromium.org
Mon Oct 19 03:51:25 CEST 2015


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 at chromium.org>
---

Changes in v2: None

 drivers/serial/Kconfig | 10 ++++++++++
 include/debug_uart.h   |  7 +++++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 39f6500..ac5920a 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -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
diff --git a/include/debug_uart.h b/include/debug_uart.h
index a6b7ce8..5d5349b 100644
--- a/include/debug_uart.h
+++ b/include/debug_uart.h
@@ -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
-- 
2.6.0.rc2.230.g3dd15c0



More information about the U-Boot mailing list