]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
serial: pl011: Enable DEBUG_UART_PL011 in SPL
authorChen Baozi <chenbaozi@phytium.com.cn>
Wed, 21 Jul 2021 06:11:26 +0000 (14:11 +0800)
committerTom Rini <trini@konsulko.com>
Sat, 24 Jul 2021 12:57:53 +0000 (08:57 -0400)
Commit b81406db51a6 ("arm: serial: Add debug UART capability to the
pl01x driver") add supports to use pl01x as a debug UART. However,
due to CONFIG_IS_ENABLED macro requires CONFIG_SPL_* prefix, the
_debug_uart_init() would not choose TYPE_PL011 in SPL build. This
patch fixes the bug by judging CONFIG_DEBUG_UART_PL011 explicitly.

Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/serial/serial_pl01x.c

index 8ff19acf335918be63d89a48b256c90c0b3e8a52..67caa063c9a38f93f6399d442462efe25924d9ca 100644 (file)
@@ -404,8 +404,12 @@ static void _debug_uart_init(void)
 {
 #ifndef CONFIG_DEBUG_UART_SKIP_INIT
        struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE;
-       enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
-                               TYPE_PL011 : TYPE_PL010;
+       enum pl01x_type type;
+
+       if (IS_ENABLED(CONFIG_DEBUG_UART_PL011))
+               type = TYPE_PL011;
+       else
+               type = TYPE_PL010;
 
        pl01x_generic_serial_init(regs, type);
        pl01x_generic_setbrg(regs, type,