Skip to contentSkip to conversation

serial: pl011: Enable DEBUG_UART_PL011 in SPL

PATCH In review Chen Baozi 3 participants 3 messages Jul 21, 2021 – Jul 24, 2021

lore
Share & tools
lore

Chen Baozi

author
#0 lore raw

PATCH v3 1/1 serial: pl011: Enable DEBUG_UART_PL011 in SPL

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.

---
 drivers/serial/serial_pl01x.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/serial/serial_pl01x.c +6 -2
index 8ff19acf33..67caa063c9 100644
@@ -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,
Signature · 1 line
2.28.0
Reviewed-by on v3 1/1
#1 lore raw
Quoted 7 lines · Chen Baozi

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.

Quoted 5 lines
---
 drivers/serial/serial_pl01x.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
#2 lore raw
In reply to Chen Baozi
Quoted 8 lines · Chen Baozi

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.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom