All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v5 2/2] drivers: serial: probe all uart devices
Date: Wed, 16 Dec 2020 10:22:04 -0500	[thread overview]
Message-ID: <3e9095e4-ee9d-d92d-2c58-e2ae9418991c@gmail.com> (raw)
In-Reply-To: <1607490724-6447-3-git-send-email-vabhav.sharma@oss.nxp.com>

On 12/9/20 12:12 AM, Vabhav Sharma wrote:
> From: Vabhav Sharma <vabhav.sharma@nxp.com>
> 
> U-Boot DM model probe only single device at a time
> which is enabled and configured using device tree
> or platform data method.
> 
> PL011 UART IP is SBSA compliant and firmware does the
> serial port set-up, initialization and let the kernel use
> UART port for sending and receiving characters.
> 
> Normally software talk to one serial port time but some
> LayerScape platform require all the UART devices enabled
> in Linux for various use case.
> 
> Adding support to probe all enabled serial devices like SBSA
> compliant PL011 UART ports probe and initialization by firmware.
> 
> Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
> Reviewed-by: Stefan Roese <sr@denx.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> --
> v5:
>    Incorporated review comments from Sean Anderson
>    - Modified the macro description
>    - Added error check
> 
> v3:
>    Incorporated Simon and Stephan review comment
>    - Define generic function uclass_probe_all(enum uclass_id)
>      in drivers/core/uclass.c
>    - Added the function in caller of serial_find_console_or_panic()
>    - Removed repeated sequence with generic function call uclass_probe_all()
>    - Dependent on other patch [PATCH] dm: core: add function uclass_probe_all()
>      to probe all devices
> 
> v2:
>    Incorporated Stefan review comment, Update #ifdef with macro
>    if (IS_ENABLED)..
> ---
>   drivers/serial/Kconfig         | 16 ++++++++++++++++
>   drivers/serial/serial-uclass.c |  9 +++++++++
>   2 files changed, 25 insertions(+)
> 
> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
> index b4805a2..1294943 100644
> --- a/drivers/serial/Kconfig
> +++ b/drivers/serial/Kconfig
> @@ -134,6 +134,22 @@ config SERIAL_SEARCH_ALL
>   
>   	  If unsure, say N.
>   
> +config SERIAL_PROBE_ALL
> +	bool "Probe all available serial devices"
> +	depends on DM_SERIAL
> +	default n
> +	help
> +	  The serial subsystem only probes for a single serial device,
> +	  but does not probe for other remaining serial devices.
> +	  With this option set, we make probing and searching for
> +	  all available devices optional.
> +	  Normally, U-Boot talks to one serial port at a time, but SBSA
> +	  compliant UART devices like PL011 require initialization
> +	  by firmware and to let the kernel use serial port for sending

Nit: "and" or "to" but not both

> +	  and receiving the characters.
> +
> +	  If unsure, say N.
> +
>   config SPL_DM_SERIAL
>   	bool "Enable Driver Model for serial drivers in SPL"
>   	depends on DM_SERIAL && SPL_DM
> diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
> index f3c25d4..48e0080 100644
> --- a/drivers/serial/serial-uclass.c
> +++ b/drivers/serial/serial-uclass.c
> @@ -172,6 +172,15 @@ int serial_init(void)
>   /* Called after relocation */
>   int serial_initialize(void)
>   {
> +	/* Scanning uclass to probe devices */
> +	if (IS_ENABLED(CONFIG_SERIAL_PROBE_ALL)) {
> +		int ret;
> +
> +		ret  = uclass_probe_all(UCLASS_SERIAL);
> +		if (ret)
> +			return ret;
> +	}
> +
>   	return serial_init();
>   }
>  
Reviewed-by: Sean Anderson <seanga2@gmail.com>

  reply	other threads:[~2020-12-16 15:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09  5:12 [PATCH v5 0/2] dm: core: drivers: add function uclass_probe_all() Vabhav Sharma
2020-12-09  5:12 ` [PATCH v5 1/2] dm: core: add function uclass_probe_all() to probe all devices Vabhav Sharma
2020-12-16 15:19   ` Sean Anderson
2021-01-18 13:01   ` Tom Rini
2020-12-09  5:12 ` [PATCH v5 2/2] drivers: serial: probe all uart devices Vabhav Sharma
2020-12-16 15:22   ` Sean Anderson [this message]
2021-01-18 13:01   ` Tom Rini
2020-12-16 10:31 ` [PATCH v5 0/2] dm: core: drivers: add function uclass_probe_all() Vabhav Sharma

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=3e9095e4-ee9d-d92d-2c58-e2ae9418991c@gmail.com \
    --to=seanga2@gmail.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.