u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] serial: pl011: Enable DEBUG_UART_PL011 in SPL
@ 2021-07-21  6:11 Chen Baozi
  2021-07-22 13:28 ` Simon Glass
  2021-07-24 20:41 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Baozi @ 2021-07-21  6:11 UTC (permalink / raw)
  To: u-boot; +Cc: Simon Glass, Tom Rini

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>
---
 drivers/serial/serial_pl01x.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 8ff19acf33..67caa063c9 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -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,
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] serial: pl011: Enable DEBUG_UART_PL011 in SPL
  2021-07-21  6:11 [PATCH v3] serial: pl011: Enable DEBUG_UART_PL011 in SPL Chen Baozi
@ 2021-07-22 13:28 ` Simon Glass
  2021-07-24 20:41 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2021-07-22 13:28 UTC (permalink / raw)
  To: chenbaozi; +Cc: U-Boot Mailing List, Tom Rini

On Wed, 21 Jul 2021 at 00:11, Chen Baozi <chenbaozi@phytium.com.cn> wrote:
>
> 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>
> ---
>  drivers/serial/serial_pl01x.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] serial: pl011: Enable DEBUG_UART_PL011 in SPL
  2021-07-21  6:11 [PATCH v3] serial: pl011: Enable DEBUG_UART_PL011 in SPL Chen Baozi
  2021-07-22 13:28 ` Simon Glass
@ 2021-07-24 20:41 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2021-07-24 20:41 UTC (permalink / raw)
  To: Chen Baozi; +Cc: u-boot, Simon Glass

[-- Attachment #1: Type: text/plain, Size: 567 bytes --]

On Wed, Jul 21, 2021 at 02:11:26PM +0800, Chen Baozi wrote:

> 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>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-24 20:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21  6:11 [PATCH v3] serial: pl011: Enable DEBUG_UART_PL011 in SPL Chen Baozi
2021-07-22 13:28 ` Simon Glass
2021-07-24 20:41 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).