dmaengine: add driver for Samsung s3c24xx SoCs
This adds a new driver to support the s3c24xx dma using the dmaengine and makes the old one in mach-s3c24xx obsolete in the long run. Conceptually the s3c24xx-dma feels like a distant relative of the pl08x with numerous virtual channels being mapped to a lot less physical ones. The driver therefore borrows a lot from the amba-pl08x driver in this regard. Functionality-wise the driver gains a memcpy ability in addition to the slave_sg one. The driver supports both the method for requesting the peripheral used by SoCs before the S3C2443 and the different method for S3C2443 and later. On earlier SoCs the hardware channels usable for specific peripherals is constrainted while on later SoCs all channels can be used for any peripheral. Tested on a s3c2416-based board, memcpy using the dmatest module and slave_sg partially using the spi-s3c64xx driver. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
This commit is contained in:
parent
0fa93b914d
commit
ddeccb8d6b
|
@ -154,6 +154,18 @@ config TEGRA20_APB_DMA
|
|||
This DMA controller transfers data from memory to peripheral fifo
|
||||
or vice versa. It does not support memory to memory data transfer.
|
||||
|
||||
config S3C24XX_DMAC
|
||||
tristate "Samsung S3C24XX DMA support"
|
||||
depends on ARCH_S3C24XX && !S3C24XX_DMA
|
||||
select DMA_ENGINE
|
||||
select DMA_VIRTUAL_CHANNELS
|
||||
help
|
||||
Support for the Samsung S3C24XX DMA controller driver. The
|
||||
DMA controller is having multiple DMA channels which can be
|
||||
configured for different peripherals like audio, UART, SPI.
|
||||
The DMA controller can transfer data from memory to peripheral,
|
||||
periphal to memory, periphal to periphal and memory to memory.
|
||||
|
||||
source "drivers/dma/sh/Kconfig"
|
||||
|
||||
config COH901318
|
||||
|
|
|
@ -30,6 +30,7 @@ obj-$(CONFIG_SIRF_DMA) += sirf-dma.o
|
|||
obj-$(CONFIG_TI_EDMA) += edma.o
|
||||
obj-$(CONFIG_STE_DMA40) += ste_dma40.o ste_dma40_ll.o
|
||||
obj-$(CONFIG_TEGRA20_APB_DMA) += tegra20-apb-dma.o
|
||||
obj-$(CONFIG_S3C24XX_DMAC) += s3c24xx-dma.o
|
||||
obj-$(CONFIG_PL330_DMA) += pl330.o
|
||||
obj-$(CONFIG_PCH_DMA) += pch_dma.o
|
||||
obj-$(CONFIG_AMBA_PL08X) += amba-pl08x.o
|
||||
|
|
1340
drivers/dma/s3c24xx-dma.c
Normal file
1340
drivers/dma/s3c24xx-dma.c
Normal file
File diff suppressed because it is too large
Load Diff
43
include/linux/platform_data/dma-s3c24xx.h
Normal file
43
include/linux/platform_data/dma-s3c24xx.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* S3C24XX DMA handling
|
||||
*
|
||||
* Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*/
|
||||
|
||||
enum s3c24xx_dma_bus {
|
||||
S3C24XX_DMA_APB,
|
||||
S3C24XX_DMA_AHB,
|
||||
};
|
||||
|
||||
/**
|
||||
* @bus: on which bus does the peripheral reside - AHB or APB.
|
||||
* @handshake: is a handshake with the peripheral necessary
|
||||
* @chansel: channel selection information, depending on variant; reqsel for
|
||||
* s3c2443 and later and channel-selection map for earlier SoCs
|
||||
* see CHANSEL doc in s3c2443-dma.c
|
||||
*/
|
||||
struct s3c24xx_dma_channel {
|
||||
enum s3c24xx_dma_bus bus;
|
||||
bool handshake;
|
||||
u16 chansel;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct s3c24xx_dma_platdata - platform specific settings
|
||||
* @num_phy_channels: number of physical channels
|
||||
* @channels: array of virtual channel descriptions
|
||||
* @num_channels: number of virtual channels
|
||||
*/
|
||||
struct s3c24xx_dma_platdata {
|
||||
int num_phy_channels;
|
||||
struct s3c24xx_dma_channel *channels;
|
||||
int num_channels;
|
||||
};
|
||||
|
||||
struct dma_chan;
|
||||
bool s3c24xx_dma_filter(struct dma_chan *chan, void *param);
|
Loading…
Reference in New Issue
Block a user