All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: chenbaozi@phytium.com.cn
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH] serial: pl011: Enable DEBUG_UART_PL011 in SPL
Date: Tue, 20 Jul 2021 12:33:12 -0600	[thread overview]
Message-ID: <CAPnjgZ3opeAWr_Z0Mhhj-AWrpYZxLLo4y4Ke1rwjS7-2EJJP-Q@mail.gmail.com> (raw)
In-Reply-To: <20210718084607.13453-1-chenbaozi@phytium.com.cn>

Hi,

On Sun, 18 Jul 2021 at 02:46, 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 | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
> index 17b26aed81..f00663a814 100644
> --- a/drivers/serial/serial_pl01x.c
> +++ b/drivers/serial/serial_pl01x.c
> @@ -404,8 +404,11 @@ 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;
> +#if defined(CONFIG_DEBUG_UART_PL011)

Please can you use if() ? Patman should warn you about that.

> +       enum pl01x_type type = TYPE_PL011;
> +#else
> +       enum pl01x_type type = TYPE_PL010;
> +#endif
>
>         pl01x_generic_serial_init(regs, type);
>         pl01x_generic_setbrg(regs, type,
> --
> 2.28.0
>

Regards,
Simon

      reply	other threads:[~2021-07-20 18:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-18  8:46 [PATCH] serial: pl011: Enable DEBUG_UART_PL011 in SPL Chen Baozi
2021-07-20 18:33 ` Simon Glass [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPnjgZ3opeAWr_Z0Mhhj-AWrpYZxLLo4y4Ke1rwjS7-2EJJP-Q@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=chenbaozi@phytium.com.cn \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.