dm: core: Introduce xxx_translate_dma_address()
[oweals/u-boot.git] / include / dm / of_addr.h
index 12b1a99a80ef964958fbf1051046769938119f6a..3fa1ffce81a69587893e1af0f0547bc52ef51b4e 100644 (file)
  */
 u64 of_translate_address(const struct device_node *no, const __be32 *in_addr);
 
+/**
+ * of_translate_dma_address() - translate a device-tree DMA address to a CPU
+ *                             address
+ *
+ * Translate a DMA address from the device-tree into a CPU physical address,
+ * this walks up the tree and applies the various bus mappings on the way.
+ *
+ * Note: We consider that crossing any level with #size-cells == 0 to mean
+ * that translation is impossible (that is we are not dealing with a value
+ * that can be mapped to a cpu physical address). This is not really specified
+ * that way, but this is traditionally the way IBM at least do things
+ *
+ * @np: node to check
+ * @in_addr: pointer to input DMA address
+ * @return translated DMA address or OF_BAD_ADDR on error
+ */
+u64 of_translate_dma_address(const struct device_node *no, const __be32 *in_addr);
+
 /**
  * of_get_address() - obtain an address from a node
  *