]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
microblaze: Wire CMA allocator
authorMichal Simek <michal.simek@xilinx.com>
Tue, 14 Jan 2020 09:05:24 +0000 (10:05 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 4 Feb 2020 10:38:59 +0000 (11:38 +0100)
Based on commit 04e3543e228f ("microblaze: use the generic dma coherent
remap allocator")
CMA can be easily enabled by calling dma_contiguous_reserve() at the end of
mmu_init(). High limit is end of lowmem space which is completely unused at
this point of time.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
arch/microblaze/Kconfig
arch/microblaze/configs/mmu_defconfig
arch/microblaze/mm/init.c

index 5f46ebe7bfe3c641512e560c18f1cf240799c894..e6289294e7fcc840f67fb81828b2a648db454c54 100644 (file)
@@ -27,6 +27,7 @@ config MICROBLAZE
        select HAVE_ARCH_HASH
        select HAVE_ARCH_KGDB
        select HAVE_DEBUG_KMEMLEAK
+       select HAVE_DMA_CONTIGUOUS
        select HAVE_DYNAMIC_FTRACE
        select HAVE_FTRACE_MCOUNT_RECORD
        select HAVE_FUNCTION_GRAPH_TRACER
index dd63766c2d191a7851999b7ec094bf3887f8ddd2..9b8a50f30662545ff44486fafa851971d5ff7d05 100644 (file)
@@ -26,6 +26,7 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_PARTITION_ADVANCED=y
 # CONFIG_EFI_PARTITION is not set
+CONFIG_CMA=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -82,6 +83,7 @@ CONFIG_NFS_FS=y
 CONFIG_CIFS=y
 CONFIG_CIFS_STATS2=y
 CONFIG_ENCRYPTED_KEYS=y
+CONFIG_DMA_CMA=y
 CONFIG_DEBUG_INFO=y
 CONFIG_KGDB=y
 CONFIG_KGDB_TESTS=y
index 050fc621c9207caee067471e773d20bbd4997f09..1056f1674065f98f66560acfa1045f9f89a4b23c 100644 (file)
@@ -7,6 +7,7 @@
  * for more details.
  */
 
+#include <linux/dma-contiguous.h>
 #include <linux/memblock.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -345,6 +346,9 @@ asmlinkage void __init mmu_init(void)
        /* This will also cause that unflatten device tree will be allocated
         * inside 768MB limit */
        memblock_set_current_limit(memory_start + lowmem_size - 1);
+
+       /* CMA initialization */
+       dma_contiguous_reserve(memory_start + lowmem_size - 1);
 }
 
 /* This is only called until mem_init is done. */