DMA: memcpy_test: allocate memory using kmalloc
authorXiao Feng <xf@rock-chips.com>
Wed, 31 Dec 2014 06:01:07 +0000 (14:01 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 31 Dec 2014 06:28:07 +0000 (14:28 +0800)
Signed-off-by: Xiao Feng <xf@rock-chips.com>
arch/arm/mach-rockchip/dma_memcpy_test.c
arch/arm64/mach-rockchip/Makefile

index 0bb48fce1dd120f89c242a67b3ccda72e5eb9a62..8db3ec358ee9feb2c8c65a99c83b1e95b956d173 100644 (file)
@@ -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;
 
index c2a9526f0eebebad30a10941f2efe1d391f32c52..70bbc24b217e0688f8113f083a17825cd90b4770 100644 (file)
@@ -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