All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/5] dm: core: also parse chosen node
Date: Sat, 24 Jun 2017 19:05:20 -0400	[thread overview]
Message-ID: <20170624230523.2327-3-robdclark@gmail.com> (raw)
In-Reply-To: <20170624230523.2327-1-robdclark@gmail.com>

This is the node that would contain, for example, the framebuffer setup
by an earlier stage.

Signed-off-by: Rob Clark <robdclark@gmail.com>
---
 drivers/core/root.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index d691d6f..5e6b2da 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -266,6 +266,26 @@ 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)) {
+		ofnode node = offset_to_ofnode(offset);
+
+		/* "chosen" node isn't a device itself but may contain some: */
+		if (strcmp(ofnode_get_name(node), "chosen") == 0) {
+			dm_dbg("parsing subnodes of \"chosen\"\n");
+
+			for (node = ofnode_first_subnode(node);
+			     ofnode_valid(node);
+			     node = ofnode_next_subnode(node)) {
+				dm_dbg("subnode: %s\n", ofnode_get_name(node));
+				err = lists_bind_fdt(parent, node, NULL);
+				if (err && !ret) {
+					ret = err;
+					dm_dbg("%s: ret=%d\n", ofnode_get_name(node), ret);
+				}
+			}
+
+			continue;
+		}
+
 		if (pre_reloc_only &&
 		    !dm_fdt_pre_reloc(blob, offset))
 			continue;
@@ -273,7 +293,7 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
 			dm_dbg("   - ignoring disabled device\n");
 			continue;
 		}
-		err = lists_bind_fdt(parent, offset_to_ofnode(offset), NULL);
+		err = lists_bind_fdt(parent, node, NULL);
 		if (err && !ret) {
 			ret = err;
 			debug("%s: ret=%d\n", fdt_get_name(blob, offset, NULL),
-- 
2.9.4

  parent reply	other threads:[~2017-06-24 23:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-24 23:05 [U-Boot] [PATCH 0/5] db410c: updates for grub + gfxterm Rob Clark
2017-06-24 23:05 ` [U-Boot] [PATCH 1/5] board/db410c: use fdt passed from lk Rob Clark
2017-07-07 15:17   ` Tom Rini
2017-06-24 23:05 ` Rob Clark [this message]
2017-06-24 23:05 ` [U-Boot] [PATCH 3/5] video: simplefb Rob Clark
2017-06-24 23:05 ` [U-Boot] [PATCH 4/5] efi_loader: gop: fixes for CONFIG_DM_VIDEO without CONFIG_LCD Rob Clark
2017-07-12 12:52   ` Alexander Graf
2017-07-18 14:00     ` Simon Glass
2017-07-18 14:47       ` Alexander Graf
2017-07-18 14:54         ` Simon Glass
2017-07-18 15:06           ` Alexander Graf
2017-07-18 17:07             ` Tom Rini
2017-07-19 10:02               ` Wenyou.Yang at microchip.com
2017-07-19 16:24             ` Rob Clark
2017-07-21 10:48               ` Simon Glass
2017-07-21 15:58                 ` Tom Rini
2017-07-21 17:54                   ` Rob Clark
2017-07-21 10:47             ` Rob Clark
2017-06-24 23:05 ` [U-Boot] [PATCH 5/5] configs: db410c: config updates Rob Clark
2017-07-06 12:02 ` [U-Boot] [PATCH 0/5] db410c: updates for grub + gfxterm Mateusz Kulikowski
2017-07-19 16:49   ` Rob Clark
2017-07-19 17:54     ` Rob Clark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170624230523.2327-3-robdclark@gmail.com \
    --to=robdclark@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.