diff options
author | Nicolas Saenz Julienne <nsaenzjulienne@suse.de> | 2021-01-12 15:55:22 +0300 |
---|---|---|
committer | Matthias Brugger <mbrugger@suse.com> | 2021-02-18 13:56:25 +0300 |
commit | 51bdb50904b1ffffc1caa8dd92f5abea78e33a0b (patch) | |
tree | 861d5e3a57adaed2bd04df0489eed3df1af99369 /drivers/core/read.c | |
parent | c709243ee0e1c3e1f8aaa750efb5b738493502c7 (diff) | |
download | u-boot-51bdb50904b1ffffc1caa8dd92f5abea78e33a0b.tar.xz |
dm: Introduce xxx_get_dma_range()
Add the following functions to get a specific device's DMA ranges:
- dev_get_dma_range()
- ofnode_get_dma_range()
- of_get_dma_range()
- fdt_get_dma_range()
They are specially useful in oder to be able validate a physical address
space range into a bus's and to convert addresses from and to address
spaces.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Diffstat (limited to 'drivers/core/read.c')
-rw-r--r-- | drivers/core/read.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/core/read.c b/drivers/core/read.c index 14fd1214d6..4307ca4579 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -341,6 +341,12 @@ u64 dev_translate_dma_address(const struct udevice *dev, const fdt32_t *in_addr) return ofnode_translate_dma_address(dev_ofnode(dev), in_addr); } +int dev_get_dma_range(const struct udevice *dev, phys_addr_t *cpu, + dma_addr_t *bus, u64 *size) +{ + return ofnode_get_dma_range(dev_ofnode(dev), cpu, bus, size); +} + int dev_read_alias_highest_id(const char *stem) { if (of_live_active()) |