]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/dm/ofnode.h
core: ofnode: add ofnode_get_parent function
[people/ms/u-boot.git] / include / dm / ofnode.h
index 8b9932a569ce5a33a813f3bdb11ed2fc880c210b..6938e62993e83b8d9cda7d8f53a28182e1bb23c9 100644 (file)
@@ -301,6 +301,14 @@ ofnode ofnode_first_subnode(ofnode node);
  */
 ofnode ofnode_next_subnode(ofnode node);
 
+/**
+ * ofnode_get_parent() - get the ofnode's parent (enclosing ofnode)
+ *
+ * @node: valid node to look up
+ * @return ofnode reference of the parent node
+ */
+ofnode ofnode_get_parent(ofnode node);
+
 /**
  * ofnode_get_name() - get the name of a node
  *
@@ -652,4 +660,17 @@ int ofnode_read_resource_byname(ofnode node, const char *name,
             ofnode_valid(node); \
             node = ofnode_next_subnode(node))
 
+/**
+ * ofnode_translate_address() - Tranlate a device-tree address
+ *
+ * Translate an address from the device-tree into a CPU physical address. This
+ * function walks up the tree and applies the various bus mappings along the
+ * way.
+ *
+ * @ofnode: Device tree node giving the context in which to translate the
+ *          address
+ * @in_addr: pointer to the address to translate
+ * @return the translated address; OF_BAD_ADDR on error
+ */
+u64 ofnode_translate_address(ofnode node, const fdt32_t *in_addr);
 #endif