summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-12-20 12:32:23 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-12-20 12:48:50 +0100
commitbd6705c7da22f5bf0443619f6f98637892515704 (patch)
treee8db0455ad532fcf5a043aba4d119366b872f0f3 /include
parentd791e51e2db7a6ff12c4f0b191b7cdc57faefa0c (diff)
downloadbarebox-bd6705c7da22f5bf0443619f6f98637892515704.tar.gz
barebox-bd6705c7da22f5bf0443619f6f98637892515704.tar.xz
of: Read dma_offset from device tree
This reads the dma-ranges property from the device tree and sets dma_offset in the devices accordingly. The code is mostly taken from the Kernel as of v5.5-rc1. of_dma_configure() is trimmed down to the cases we want to support currently. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/of_address.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/of_address.h b/include/of_address.h
index ebf3ec2a24..350ecaec82 100644
--- a/include/of_address.h
+++ b/include/of_address.h
@@ -56,6 +56,9 @@ extern struct device_node *of_find_matching_node_by_address(
u64 base_address);
extern void __iomem *of_iomap(struct device_node *np, int index);
+extern int of_dma_get_range(struct device_node *np, u64 *dma_addr, u64 *paddr,
+ u64 *size);
+
#else /* CONFIG_OFTREE */
static inline u64 of_translate_address(struct device_node *dev,
@@ -99,6 +102,12 @@ static inline void __iomem *of_iomap(struct device_node *np, int index)
return NULL;
}
+static inline int of_dma_get_range(struct device_node *np, u64 *dma_addr,
+ u64 *paddr, u64 *size)
+{
+ return -ENOSYS;
+}
+
#endif /* CONFIG_OFTREE */
#ifdef CONFIG_OF_PCI