Commit c7fefcb9125bbd183dc095996c6747273043d988
1 parent
0e977bc145
Exists in
v2017.01-smarct4x
and in
30 other branches
debug_uart: Add an option to announce the debug UART
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>
Showing 2 changed files with 17 additions and 0 deletions Side-by-side Diff
drivers/serial/Kconfig
... | ... | @@ -120,6 +120,16 @@ |
120 | 120 | here that is needed to set up the UART ready for use, such as set |
121 | 121 | pin multiplexing or enable clocks. |
122 | 122 | |
123 | +config DEBUG_UART_ANNOUNCE | |
124 | + bool "Show a message when the debug UART starts up" | |
125 | + depends on DEBUG_UART | |
126 | + help | |
127 | + Enable this option to show a message when the debug UART is ready | |
128 | + for use. You will see a message like "<debug_uart> " as soon as | |
129 | + U-Boot has the UART ready for use (i.e. your code calls | |
130 | + debug_uart_init()). This can be useful just as a check that | |
131 | + everything is working. | |
132 | + | |
123 | 133 | config ROCKCHIP_SERIAL |
124 | 134 | bool "Rockchip on-chip UART support" |
125 | 135 | depends on ARCH_ROCKCHIP && DM_SERIAL |
include/debug_uart.h
... | ... | @@ -105,6 +105,12 @@ |
105 | 105 | */ |
106 | 106 | void printhex8(uint value); |
107 | 107 | |
108 | +#ifdef CONFIG_DEBUG_UART_ANNOUNCE | |
109 | +#define _DEBUG_UART_ANNOUNCE printascii("<debug_uart> "); | |
110 | +#else | |
111 | +#define _DEBUG_UART_ANNOUNCE | |
112 | +#endif | |
113 | + | |
108 | 114 | /* |
109 | 115 | * Now define some functions - this should be inserted into the serial driver |
110 | 116 | */ |
... | ... | @@ -151,6 +157,7 @@ |
151 | 157 | { \ |
152 | 158 | board_debug_uart_init(); \ |
153 | 159 | _debug_uart_init(); \ |
160 | + _DEBUG_UART_ANNOUNCE \ | |
154 | 161 | } \ |
155 | 162 | |
156 | 163 | #endif |