diff options
author | Alexander Graf <agraf@suse.de> | 2018-01-29 15:57:20 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-01-29 16:18:02 +0300 |
commit | ae5326a6b34b34b1827edf2eee1a0e9e5363c5a2 (patch) | |
tree | 7e6938c1a57a812530b8a9a34d7e22298aadabbb /drivers/serial/serial-uclass.c | |
parent | 06bfb9f37c03335dd5d0547ab7286f2f74fcbcbb (diff) | |
download | u-boot-ae5326a6b34b34b1827edf2eee1a0e9e5363c5a2.tar.xz |
serial: Make full device search optional
Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.
Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.
Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'drivers/serial/serial-uclass.c')
-rw-r--r-- | drivers/serial/serial-uclass.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 68ca2d09d1..9891c20656 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -74,7 +74,9 @@ static void serial_find_console_or_panic(void) { const void *blob = gd->fdt_blob; struct udevice *dev; +#ifdef CONFIG_SERIAL_SEARCH_ALL int ret; +#endif if (CONFIG_IS_ENABLED(OF_PLATDATA)) { uclass_first_device(UCLASS_SERIAL, &dev); @@ -113,6 +115,8 @@ static void serial_find_console_or_panic(void) #else #define INDEX 0 #endif + +#ifdef CONFIG_SERIAL_SEARCH_ALL if (!uclass_get_device_by_seq(UCLASS_SERIAL, INDEX, &dev) || !uclass_get_device(UCLASS_SERIAL, INDEX, &dev)) { if (dev->flags & DM_FLAG_ACTIVATED) { @@ -131,6 +135,15 @@ static void serial_find_console_or_panic(void) return; } } +#else + if (!uclass_get_device_by_seq(UCLASS_SERIAL, INDEX, &dev) || + !uclass_get_device(UCLASS_SERIAL, INDEX, &dev) || + (!uclass_first_device(UCLASS_SERIAL, &dev) && dev)) { + gd->cur_serial_dev = dev; + return; + } +#endif + #undef INDEX } |