summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2026-03-16 00:57:23 +0100
committerTom Rini <[email protected]>2026-04-07 15:27:22 -0600
commita383c9689282269bb9687ec6c115de094c27fa67 (patch)
tree26f961e89b7a5583b91a9c14a60c4b9551663b0b /drivers
parent6201fd7c1ffa134f8ba229b434e6f14a3fd5bb14 (diff)
dm: Respect dma-ranges size
Rework dev_phys_to_bus() and dev_bus_to_phys() to respect the size of the area specified in dma-ranges DT property. The area outside of ranges is remapped 1:1, while the area in the ranges is remapped according to the description in the dma-ranges property. Adjust the test to test the area within the remapped range, not area outside the remapped range, which was incorrect. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Markus Schneider-Pargmann <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/core/device.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 779f371b9d5..d365204ba11 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -473,7 +473,11 @@ static int device_get_dma_constraints(struct udevice *dev)
return ret;
}
- dev_set_dma_offset(dev, cpu - bus);
+#if CONFIG_IS_ENABLED(DM_DMA)
+ dev->dma_cpu = cpu;
+ dev->dma_bus = bus;
+ dev->dma_size = size;
+#endif
return 0;
}