From: Christoph Müllner <christoph.muell...@theobroma-systems.com>

Currently addr_aligned() performs an alignment and a length check
to validate the DMA address. However, some machines have stricter
restrictions of DMA-able addresses.

This patch adds a call to mach_addr_is_dmaable() to honor this
machine specific restrictions.

Signed-off-by: Christoph Müllner <christoph.muell...@theobroma-systems.com>
Signed-off-by: Christoph Muellner <christoph.muell...@theobroma-systems.com>
---

Changes in v2: None

 common/bouncebuf.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/bouncebuf.c b/common/bouncebuf.c
index a7098e2caf..1b82243b06 100644
--- a/common/bouncebuf.c
+++ b/common/bouncebuf.c
@@ -26,6 +26,12 @@ static int addr_aligned(struct bounce_buffer *state)
                return 0;
        }
 
+       /* Check if valid DMA address. */
+       if (!mach_addr_is_dmaable(state->user_buffer)) {
+               debug("Buffer address is not DMA-able\n");
+               return 0;
+       }
+
        /* Aligned */
        return 1;
 }
-- 
2.11.0

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to