From 641067fb0c64dec8b6da962eb1d9fc49a6c7b499 Mon Sep 17 00:00:00 2001 From: Fabien Dessenne Date: Fri, 31 May 2019 15:11:30 +0200 Subject: 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 --- arch/sandbox/dts/test.dts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/sandbox/dts/test.dts') diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 531c1afc97..ac985ecb32 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -756,6 +756,10 @@ 3 0x300 0xB000 0x1000 >; + dma-ranges = <0 0x000 0x10000000 0x1000 + 1 0x100 0x20000000 0x1000 + >; + dev@0,0 { compatible = "denx,u-boot-fdt-dummy"; reg = <0 0x0 0x1000>; -- cgit