diff options
author | Simon Glass <sjg@chromium.org> | 2016-07-04 20:58:04 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-07-15 05:40:24 +0300 |
commit | b484b0daefc43bb3a6258a44040b53602060b2af (patch) | |
tree | fd5d907e1821775882f71b112c5504bd35a7838a /drivers/serial/serial-uclass.c | |
parent | 7423daa60eb30b6613dfc19a51c55de23fd4d703 (diff) | |
download | u-boot-b484b0daefc43bb3a6258a44040b53602060b2af.tar.xz |
dm: serial: Add support for of-platdata
When this feature is enabled, we cannot access the device tree to find out
which serial device to use. Just use the first serial driver we find.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/serial/serial-uclass.c')
-rw-r--r-- | drivers/serial/serial-uclass.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 0ce5c44f33..19f38e162e 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -33,7 +33,13 @@ static void serial_find_console_or_panic(void) struct udevice *dev; int node; - if (CONFIG_IS_ENABLED(OF_CONTROL) && blob) { + if (CONFIG_IS_ENABLED(OF_PLATDATA)) { + uclass_first_device(UCLASS_SERIAL, &dev); + if (dev) { + gd->cur_serial_dev = dev; + return; + } + } else if (CONFIG_IS_ENABLED(OF_CONTROL) && blob) { /* Check for a chosen console */ node = fdtdec_get_chosen_node(blob, "stdout-path"); if (node < 0) { |