提交 97b05973 编写于 作者: S Simon Glass

debug_uart: Adjust the declaration of debug_uart_init()

We want to be able to add other common code to this function. So change the
driver's version to have an underscore before it, just like
_debug_uart_putc(). Define debug_uart_init() to call this version.

Update all drivers to this new method.
Signed-off-by: NSimon Glass <sjg@chromium.org>
Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
上级 5ac98cb9
...@@ -257,7 +257,7 @@ int NS16550_tstc(NS16550_t com_port) ...@@ -257,7 +257,7 @@ int NS16550_tstc(NS16550_t com_port)
(1 << CONFIG_DEBUG_UART_SHIFT), \ (1 << CONFIG_DEBUG_UART_SHIFT), \
CONFIG_DEBUG_UART_SHIFT) CONFIG_DEBUG_UART_SHIFT)
void debug_uart_init(void) static inline void _debug_uart_init(void)
{ {
struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE; struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE;
int baud_divisor; int baud_divisor;
......
...@@ -107,7 +107,7 @@ static int serial_efi_pending(struct udevice *dev, bool input) ...@@ -107,7 +107,7 @@ static int serial_efi_pending(struct udevice *dev, bool input)
* There is nothing to init here since the EFI console is already running by * There is nothing to init here since the EFI console is already running by
* the time we enter U-Boot. * the time we enter U-Boot.
*/ */
void debug_uart_init(void) static inline void _debug_uart_init(void)
{ {
} }
......
...@@ -207,7 +207,7 @@ U_BOOT_DRIVER(serial_s5p) = { ...@@ -207,7 +207,7 @@ U_BOOT_DRIVER(serial_s5p) = {
#include <debug_uart.h> #include <debug_uart.h>
void debug_uart_init(void) static inline void _debug_uart_init(void)
{ {
struct s5p_uart *uart = (struct s5p_uart *)CONFIG_DEBUG_UART_BASE; struct s5p_uart *uart = (struct s5p_uart *)CONFIG_DEBUG_UART_BASE;
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
* To enable the debug UART in your serial driver: * To enable the debug UART in your serial driver:
* *
* - #include <debug_uart.h> * - #include <debug_uart.h>
* - Define debug_uart_init(), trying to avoid using the stack * - Define _debug_uart_init(), trying to avoid using the stack
* - Define _debug_uart_putc() as static inline (avoiding stack usage) * - Define _debug_uart_putc() as static inline (avoiding stack usage)
* - Immediately afterwards, add DEBUG_UART_FUNCS to define the rest of the * - Immediately afterwards, add DEBUG_UART_FUNCS to define the rest of the
* functionality (printch(), etc.) * functionality (printch(), etc.)
...@@ -132,6 +132,11 @@ void printhex8(uint value); ...@@ -132,6 +132,11 @@ void printhex8(uint value);
void printhex8(uint value) \ void printhex8(uint value) \
{ \ { \
printhex(value, 8); \ printhex(value, 8); \
} } \
\
void debug_uart_init(void) \
{ \
_debug_uart_init(); \
} \
#endif #endif
...@@ -59,7 +59,7 @@ struct __packed desctab_info { ...@@ -59,7 +59,7 @@ struct __packed desctab_info {
* considering if we start needing more U-Boot functionality. Note that we * considering if we start needing more U-Boot functionality. Note that we
* could then move get_codeseg32() to arch/x86/cpu/cpu.c. * could then move get_codeseg32() to arch/x86/cpu/cpu.c.
*/ */
void debug_uart_init(void) void _debug_uart_init(void)
{ {
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册