[U-Boot] [PATCH v2 3/3] rk3399: Add restriction for DMA-able addresses.

Christoph Muellner christoph.muellner at theobroma-systems.com
Tue May 7 15:59:35 UTC 2019


From: Christoph Müllner <christoph.muellner at theobroma-systems.com>

Patches on the U-Boot mailing list from Rockchip engineers
indicate, that the RK3399's DMA engines are not able to use
addresses in high-memory (above 0xf8000000).

This patch models this restriction in an RK3399 specific
mach_addr_is_dmaable() function.

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

Changes in v2:
    - Convert argument type from unsigned long to void pointer.

 arch/arm/mach-rockchip/rk3399/rk3399.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c
index a7ccd4f3ed..8895417bda 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -109,3 +109,16 @@ void board_debug_uart_init(void)
 #endif
 }
 #endif
+
+int mach_addr_is_dmaable(void __iomem *ptr)
+{
+	uintptr_t addr = (uintptr_t)ptr;
+
+	/*
+	 * The RK3399 cannot cope with high-memory DMA targets/sources.
+	 */
+	if (addr < 0xf8000000UL)
+		return 1;
+
+	return 0;
+}
-- 
2.11.0



More information about the U-Boot mailing list