aboutsummaryrefslogtreecommitdiff
path: root/drivers/core/read.c
diff options
context:
space:
mode:
authorFabien Dessenne2019-05-31 15:11:30 +0200
committerPatrick Delaunay2019-07-22 09:21:28 +0200
commit641067fb0c64dec8b6da962eb1d9fc49a6c7b499 (patch)
tree594af009ab9d03084047c09310018efe257cf926 /drivers/core/read.c
parent0de815356474912ef5bef9a69f0327a5a93bb2c2 (diff)
dm: core: Introduce xxx_translate_dma_address()
Add the following functions to translate DMA address to CPU address: - dev_translate_dma_address() - ofnode_translate_dma_address() - of_translate_dma_address() - fdt_translate_dma_address() These functions work the same way as xxx_translate_address(), with the difference that the translation relies on the "dma-ranges" property instead of the "ranges" property. Add related test. Test report: => ut dm fdt_translation Test: dm_test_fdt_translation: test-fdt.c Test: dm_test_fdt_translation: test-fdt.c (flat tree) Failures: 0 Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Diffstat (limited to 'drivers/core/read.c')
-rw-r--r--drivers/core/read.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/core/read.c b/drivers/core/read.c
index 6bda077a34b..1a044b05e88 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -265,6 +265,11 @@ u64 dev_translate_address(struct udevice *dev, const fdt32_t *in_addr)
return ofnode_translate_address(dev_ofnode(dev), in_addr);
}
+u64 dev_translate_dma_address(struct udevice *dev, const fdt32_t *in_addr)
+{
+ return ofnode_translate_dma_address(dev_ofnode(dev), in_addr);
+}
+
int dev_read_alias_highest_id(const char *stem)
{
if (of_live_active())