]> git.sur5r.net Git - u-boot/blobdiff - drivers/core/root.c
spl: use different BOARD_INIT MACRO for spl and tpl
[u-boot] / drivers / core / root.c
index 757d109e57a37399cafb5091273cf726759ce07d..36336b65b6cbfd8e6ba2b88d9b27f48a08280692 100644 (file)
@@ -227,7 +227,7 @@ static int dm_scan_fdt_live(struct udevice *parent,
                    !of_find_property(np, "u-boot,dm-pre-reloc", NULL))
                        continue;
                if (!of_device_is_available(np)) {
-                       dm_dbg("   - ignoring disabled device\n");
+                       pr_debug("   - ignoring disabled device\n");
                        continue;
                }
                err = lists_bind_fdt(parent, np_to_ofnode(np), NULL);
@@ -266,11 +266,22 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
        for (offset = fdt_first_subnode(blob, offset);
             offset > 0;
             offset = fdt_next_subnode(blob, offset)) {
+               /* "chosen" node isn't a device itself but may contain some: */
+               if (!strcmp(fdt_get_name(blob, offset, NULL), "chosen")) {
+                       pr_debug("parsing subnodes of \"chosen\"\n");
+
+                       err = dm_scan_fdt_node(parent, blob, offset,
+                                              pre_reloc_only);
+                       if (err && !ret)
+                               ret = err;
+                       continue;
+               }
+
                if (pre_reloc_only &&
                    !dm_fdt_pre_reloc(blob, offset))
                        continue;
                if (!fdtdec_get_is_enabled(blob, offset)) {
-                       dm_dbg("   - ignoring disabled device\n");
+                       pr_debug("   - ignoring disabled device\n");
                        continue;
                }
                err = lists_bind_fdt(parent, offset_to_ofnode(offset), NULL);