aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVabhav Sharma <vabhav.sharma@nxp.com>2020-12-09 10:42:04 +0530
committerTom Rini <trini@konsulko.com>2021-01-16 12:11:43 -0500
commit71e683c312f5e9dd3c6b409524ca407205be175c (patch)
tree5dba88a254a77caffc9a61dcd7e4c842aa716b8b
parent0abd235e41283573af6996ef2d2140fa60ea1492 (diff)
downloadu-boot-71e683c312f5e9dd3c6b409524ca407205be175c.zip
u-boot-71e683c312f5e9dd3c6b409524ca407205be175c.tar.gz
u-boot-71e683c312f5e9dd3c6b409524ca407205be175c.tar.bz2
drivers: serial: probe all uart devices
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> Reviewed-by: Sean Anderson <seanga2@gmail.com>
-rw-r--r--drivers/serial/Kconfig16
-rw-r--r--drivers/serial/serial-uclass.c9
2 files changed, 25 insertions, 0 deletions
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
+ 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 58a6541..ead0193 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();
}