]> 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 79374b8f91aa8030cb5f1d3ad595290a14c5f818..6938e62993e83b8d9cda7d8f53a28182e1bb23c9 100644 (file)
@@ -45,7 +45,7 @@ struct resource;
  * the DT.
  *
  * @np: Pointer to device node, used for live tree
- * @flat_ptr: Pointer into flat device tree, used for flat tree. Note that this
+ * @of_offset: Pointer into flat device tree, used for flat tree. Note that this
  *     is not a really a pointer to a node: it is an offset value. See above.
  */
 typedef union ofnode_union {
@@ -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