aboutsummaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/dump.c8
-rw-r--r--drivers/core/ofnode.c9
-rw-r--r--drivers/core/root.c34
3 files changed, 40 insertions, 11 deletions
diff --git a/drivers/core/dump.c b/drivers/core/dump.c
index c3e109e7ed1..6c6b9444530 100644
--- a/drivers/core/dump.c
+++ b/drivers/core/dump.c
@@ -14,12 +14,10 @@ static void show_devices(struct udevice *dev, int depth, int last_flag)
{
int i, is_last;
struct udevice *child;
- char class_name[12];
/* print the first 11 characters to not break the tree-format. */
- strlcpy(class_name, dev->uclass->uc_drv->name, sizeof(class_name));
- printf(" %-11s [ %c ] ", class_name,
- dev->flags & DM_FLAG_ACTIVATED ? '+' : ' ');
+ printf(" %-10.10s [ %c ] %-10.10s ", dev->uclass->uc_drv->name,
+ dev->flags & DM_FLAG_ACTIVATED ? '+' : ' ', dev->driver->name);
for (i = depth; i >= 0; i--) {
is_last = (last_flag >> i) & 1;
@@ -50,7 +48,7 @@ void dm_dump_all(void)
root = dm_root();
if (root) {
- printf(" Class Probed Name\n");
+ printf(" Class Probed Driver Name\n");
printf("----------------------------------------\n");
show_devices(root, -1, 0);
}
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 0685b689d84..c6ca13fabf1 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -390,10 +390,11 @@ int ofnode_decode_display_timing(ofnode parent, int index,
if (!ofnode_valid(timings))
return -EINVAL;
- for (i = 0, node = ofnode_first_subnode(timings);
- ofnode_valid(node) && i != index;
- node = ofnode_first_subnode(node))
- i++;
+ i = 0;
+ ofnode_for_each_subnode(node, timings) {
+ if (i++ == index)
+ break;
+ }
if (!ofnode_valid(node))
return -EINVAL;
diff --git a/drivers/core/root.c b/drivers/core/root.c
index d691d6ff947..757d109e57a 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -312,8 +312,38 @@ int dm_scan_fdt(const void *blob, bool pre_reloc_only)
#endif
return dm_scan_fdt_node(gd->dm_root, blob, 0, pre_reloc_only);
}
+#else
+static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
+ int offset, bool pre_reloc_only)
+{
+ return 0;
+}
#endif
+int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only)
+{
+ int node, ret;
+
+ ret = dm_scan_fdt(gd->fdt_blob, pre_reloc_only);
+ if (ret) {
+ debug("dm_scan_fdt() failed: %d\n", ret);
+ return ret;
+ }
+
+ /* bind fixed-clock */
+ node = ofnode_to_offset(ofnode_path("/clocks"));
+ /* if no DT "clocks" node, no need to go further */
+ if (node < 0)
+ return ret;
+
+ ret = dm_scan_fdt_node(gd->dm_root, gd->fdt_blob, node,
+ pre_reloc_only);
+ if (ret)
+ debug("dm_scan_fdt_node() failed: %d\n", ret);
+
+ return ret;
+}
+
__weak int dm_scan_other(bool pre_reloc_only)
{
return 0;
@@ -335,9 +365,9 @@ int dm_init_and_scan(bool pre_reloc_only)
}
if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
- ret = dm_scan_fdt(gd->fdt_blob, pre_reloc_only);
+ ret = dm_extended_scan_fdt(gd->fdt_blob, pre_reloc_only);
if (ret) {
- debug("dm_scan_fdt() failed: %d\n", ret);
+ debug("dm_extended_scan_dt() failed: %d\n", ret);
return ret;
}
}