aboutsummaryrefslogtreecommitdiff
path: root/include/dm/of_addr.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-02-18 08:06:26 -0500
committerTom Rini <trini@konsulko.com>2021-02-18 08:06:26 -0500
commit56f1bcc4b7fbca8789cef90c30f201f5b3fff757 (patch)
treed587eafbc09d7ec51a9b12dca023ddce60507876 /include/dm/of_addr.h
parent496f49464d90b564da5f1a2f4eecb5553e01edf9 (diff)
parent0059ef0be903a1f0a9afe5259fb2e0874f78a8ac (diff)
Merge tag 'rpi-next-2021.04' of https://gitlab.denx.de/u-boot/custodians/u-boot-raspberrypi
- add iProc RNG2000 driver for RPi4 - add support for CM4 and RPi400
Diffstat (limited to 'include/dm/of_addr.h')
-rw-r--r--include/dm/of_addr.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/dm/of_addr.h b/include/dm/of_addr.h
index 3fa1ffce81..ee21d5cf4f 100644
--- a/include/dm/of_addr.h
+++ b/include/dm/of_addr.h
@@ -44,6 +44,23 @@ u64 of_translate_address(const struct device_node *no, const __be32 *in_addr);
*/
u64 of_translate_dma_address(const struct device_node *no, const __be32 *in_addr);
+
+/**
+ * of_get_dma_range() - get dma-ranges for a specific DT node
+ *
+ * Get DMA ranges for a specifc node, this is useful to perform bus->cpu and
+ * cpu->bus address translations
+ *
+ * @param blob Pointer to device tree blob
+ * @param node_offset Node DT offset
+ * @param cpu Pointer to variable storing the range's cpu address
+ * @param bus Pointer to variable storing the range's bus address
+ * @param size Pointer to variable storing the range's size
+ * @return translated DMA address or OF_BAD_ADDR on error
+ */
+int of_get_dma_range(const struct device_node *dev, phys_addr_t *cpu,
+ dma_addr_t *bus, u64 *size);
+
/**
* of_get_address() - obtain an address from a node
*