mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 22:51:37 +00:00
dm: serial: Add livetree support
Add support for a live device tree to the core serial uclass. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
This commit is contained in:
parent
d09608534c
commit
f93472a022
1 changed files with 15 additions and 3 deletions
|
@ -14,6 +14,7 @@
|
||||||
#include <watchdog.h>
|
#include <watchdog.h>
|
||||||
#include <dm/lists.h>
|
#include <dm/lists.h>
|
||||||
#include <dm/device-internal.h>
|
#include <dm/device-internal.h>
|
||||||
|
#include <dm/of_access.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
@ -81,11 +82,22 @@ static void serial_find_console_or_panic(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (CONFIG_IS_ENABLED(OF_CONTROL) && blob) {
|
} else if (CONFIG_IS_ENABLED(OF_CONTROL) && blob) {
|
||||||
|
/* Live tree has support for stdout */
|
||||||
|
if (of_live_active()) {
|
||||||
|
struct device_node *np = of_get_stdout();
|
||||||
|
|
||||||
|
if (np && !uclass_get_device_by_ofnode(UCLASS_SERIAL,
|
||||||
|
np_to_ofnode(np), &dev)) {
|
||||||
|
gd->cur_serial_dev = dev;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (!serial_check_stdout(blob, &dev)) {
|
if (!serial_check_stdout(blob, &dev)) {
|
||||||
gd->cur_serial_dev = dev;
|
gd->cur_serial_dev = dev;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!SPL_BUILD || !CONFIG_IS_ENABLED(OF_CONTROL) || !blob) {
|
if (!SPL_BUILD || !CONFIG_IS_ENABLED(OF_CONTROL) || !blob) {
|
||||||
/*
|
/*
|
||||||
* Try to use CONFIG_CONS_INDEX if available (it is numbered
|
* Try to use CONFIG_CONS_INDEX if available (it is numbered
|
||||||
|
|
Loading…
Add table
Reference in a new issue