]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
riscv: Add DMA 64-bit address support
authorPadmarao Begari <padmarao.begari@microchip.com>
Fri, 15 Jan 2021 02:50:35 +0000 (08:20 +0530)
committerAndes <uboot@andestech.com>
Mon, 18 Jan 2021 03:06:38 +0000 (11:06 +0800)
dma_addr_t holds any valid DMA address. If the DMA API only uses 32/64-bit
addresses, dma_addr_t need only be 32/64 bits wide.

Signed-off-by: Padmarao Begari <padmarao.begari@microchip.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Rick Chen <rick@andestech.com>
arch/riscv/Kconfig
arch/riscv/include/asm/types.h

index 30b05408b1445d079fa69e4bb28a18c3d6037c06..55eaee2da63dd9f830ef02628ae76f35859f3dcb 100644 (file)
@@ -152,6 +152,10 @@ config 32BIT
 config 64BIT
        bool
 
+config DMA_ADDR_T_64BIT
+       bool
+       default y if 64BIT
+
 config SIFIVE_CLINT
        bool
        depends on RISCV_MMODE || SPL_RISCV_MMODE
index 403cf9a48fa5642f4297a503cd28a136f73a8461..b800b2d221bf8cb4aa2fa135cf8722b14e97cf9a 100644 (file)
@@ -29,7 +29,11 @@ typedef unsigned short umode_t;
 
 #include <stddef.h>
 
+#ifdef CONFIG_DMA_ADDR_T_64BIT
+typedef u64 dma_addr_t;
+#else
 typedef u32 dma_addr_t;
+#endif
 
 typedef unsigned long phys_addr_t;
 typedef unsigned long phys_size_t;