From b7546312d21ff05b741f9d51fdfbfa997b564001 Mon Sep 17 00:00:00 2001 From: Xiao Feng Date: Wed, 31 Dec 2014 14:01:07 +0800 Subject: [PATCH] DMA: memcpy_test: allocate memory using kmalloc Signed-off-by: Xiao Feng --- arch/arm/mach-rockchip/dma_memcpy_test.c | 13 ++----------- arch/arm64/mach-rockchip/Makefile | 1 + 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-rockchip/dma_memcpy_test.c b/arch/arm/mach-rockchip/dma_memcpy_test.c index 0bb48fce1dd1..8db3ec358ee9 100644 --- a/arch/arm/mach-rockchip/dma_memcpy_test.c +++ b/arch/arm/mach-rockchip/dma_memcpy_test.c @@ -165,8 +165,8 @@ static int dma_memtest_channel_setup_and_init(struct Dma_MemToMem *DmaMemInfo, c } - DmaMemInfo->src = dma_alloc_coherent(NULL, DMA_TEST_BUFFER_SIZE, &DmaMemInfo->config->src_addr, GFP_KERNEL); - DmaMemInfo->dst = dma_alloc_coherent(NULL, DMA_TEST_BUFFER_SIZE, &DmaMemInfo->config->dst_addr, GFP_KERNEL); + DmaMemInfo->src = kmalloc(DMA_TEST_BUFFER_SIZE, GFP_KERNEL); + DmaMemInfo->dst = kmalloc(DMA_TEST_BUFFER_SIZE, GFP_KERNEL); if(DmaMemInfo->src == NULL || DmaMemInfo->dst == NULL) { printk("dma_alloc_coherent %s fail\n",DmaMemInfo->name); @@ -176,15 +176,6 @@ static int dma_memtest_channel_setup_and_init(struct Dma_MemToMem *DmaMemInfo, c { printk("dma_alloc_coherent %s success\n",DmaMemInfo->name); } - - DmaMemInfo->MenSize = DMA_TEST_BUFFER_SIZE; - DmaMemInfo->config->direction = direction; - DmaMemInfo->config->src_addr_width = addr_width; - DmaMemInfo->config->dst_addr_width = addr_width; - DmaMemInfo->config->src_maxburst = maxburst; - DmaMemInfo->config->dst_maxburst = maxburst; - - dmaengine_slave_config(DmaMemInfo->dma_chan,DmaMemInfo->config); return 0; diff --git a/arch/arm64/mach-rockchip/Makefile b/arch/arm64/mach-rockchip/Makefile index c2a9526f0eeb..70bbc24b217e 100644 --- a/arch/arm64/mach-rockchip/Makefile +++ b/arch/arm64/mach-rockchip/Makefile @@ -7,3 +7,4 @@ obj-$(CONFIG_PM) += ../../arm/mach-rockchip/rockchip_pm.o obj-$(CONFIG_RK_LAST_LOG) += ../../arm/mach-rockchip/last_log.o obj-$(CONFIG_DVFS) += ../../arm/mach-rockchip/dvfs.o obj-$(CONFIG_BLOCK_RKNAND) += ../../arm/mach-rockchip/rknandbase.o +obj-$(CONFIG_RK_PL330_DMA_TEST) += ../../arm/mach-rockchip/dma_memcpy_test.o -- 2.34.1