summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-05-06 19:23:28 -0700
committerPatrick Georgi <pgeorgi@google.com>2019-06-04 11:24:01 +0000
commit6d5695fac53f52e1f389f420b5428e92de5b8c9c (patch)
tree9a29412f481ab43a21ffbe4c86190e448113f632 /src/include
parentfbec63d15f761e01c934078570acbef779e707ba (diff)
device_tree: Add support for aliases
This patch adds support to lookup nodes via the "/aliases" mechanism in device trees. This may be required for overlay support (don't quite remember tbh) and is also just a generally useful feature. It was adapted from depthcharge's http://crosreview.com/1249703 and http://crosreview.com/1542702. Change-Id: I1289ab2f02c4877a2d0111040384827e2b48a34a Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/32866 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/device_tree.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/device_tree.h b/src/include/device_tree.h
index 6eaeacd6f0..e3723c86ac 100644
--- a/src/include/device_tree.h
+++ b/src/include/device_tree.h
@@ -146,6 +146,9 @@ struct device_tree_node *dt_find_node_by_phandle(struct device_tree_node *root,
// represented as a string of '/' separated node names.
struct device_tree_node *dt_find_node_by_path(struct device_tree *tree,
const char *path, u32 *addrcp, u32 *sizecp, int create);
+// Look up a node through an alias.
+struct device_tree_node *dt_find_node_by_alias(struct device_tree *tree,
+ const char *alias);
// Look up a node relative to a parent node, through its compatible string.
struct device_tree_node *dt_find_compat(struct device_tree_node *parent, const char *compatible);
// Look up the next child of a parent node, through its compatible string. It