diff options
| -rw-r--r-- | arch/arm/plat-nomadik/include/plat/ste_dma40.h | 8 | ||||
| -rw-r--r-- | drivers/dma/Kconfig | 9 | ||||
| -rw-r--r-- | drivers/dma/amba-pl08x.c | 1168 | ||||
| -rw-r--r-- | drivers/dma/at_hdmac.c | 19 | ||||
| -rw-r--r-- | drivers/dma/fsldma.c | 4 | ||||
| -rw-r--r-- | drivers/dma/intel_mid_dma.c | 33 | ||||
| -rw-r--r-- | drivers/dma/iop-adma.c | 4 | ||||
| -rw-r--r-- | drivers/dma/pch_dma.c | 19 | ||||
| -rw-r--r-- | drivers/dma/ste_dma40.c | 191 | ||||
| -rw-r--r-- | drivers/dma/ste_dma40_ll.c | 246 | ||||
| -rw-r--r-- | drivers/dma/ste_dma40_ll.h | 36 | ||||
| -rw-r--r-- | include/linux/amba/pl08x.h | 99 | ||||
| -rw-r--r-- | include/linux/dmaengine.h | 2 |
13 files changed, 994 insertions, 844 deletions
diff --git a/arch/arm/plat-nomadik/include/plat/ste_dma40.h b/arch/arm/plat-nomadik/include/plat/ste_dma40.h index 74b62f10d07f..4d6dd4c39b75 100644 --- a/arch/arm/plat-nomadik/include/plat/ste_dma40.h +++ b/arch/arm/plat-nomadik/include/plat/ste_dma40.h | |||
| @@ -13,6 +13,14 @@ | |||
| 13 | #include <linux/workqueue.h> | 13 | #include <linux/workqueue.h> |
| 14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
| 15 | 15 | ||
| 16 | /* | ||
| 17 | * Maxium size for a single dma descriptor | ||
| 18 | * Size is limited to 16 bits. | ||
| 19 | * Size is in the units of addr-widths (1,2,4,8 bytes) | ||
| 20 | * Larger transfers will be split up to multiple linked desc | ||
| 21 | */ | ||
| 22 | #define STEDMA40_MAX_SEG_SIZE 0xFFFF | ||
| 23 | |||
| 16 | /* dev types for memcpy */ | 24 | /* dev types for memcpy */ |
| 17 | #define STEDMA40_DEV_DST_MEMORY (-1) | 25 | #define STEDMA40_DEV_DST_MEMORY (-1) |
| 18 | #define STEDMA40_DEV_SRC_MEMORY (-1) | 26 | #define STEDMA40_DEV_SRC_MEMORY (-1) |
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index ef138731c0ea..1c28816152fa 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig | |||
| @@ -200,11 +200,16 @@ config PL330_DMA | |||
| 200 | platform_data for a dma-pl330 device. | 200 | platform_data for a dma-pl330 device. |
| 201 | 201 | ||
| 202 | config PCH_DMA | 202 | config PCH_DMA |
| 203 | tristate "Topcliff (Intel EG20T) PCH DMA support" | 203 | tristate "Intel EG20T PCH / OKI SEMICONDUCTOR ML7213 IOH DMA support" |
| 204 | depends on PCI && X86 | 204 | depends on PCI && X86 |
| 205 | select DMA_ENGINE | 205 | select DMA_ENGINE |
| 206 | help | 206 | help |
| 207 | Enable support for the Topcliff (Intel EG20T) PCH DMA engine. | 207 | Enable support for Intel EG20T PCH DMA engine. |
| 208 | |||
| 209 | This driver also can be used for OKI SEMICONDUCTOR ML7213 IOH(Input/ | ||
| 210 | Output Hub) which is for IVI(In-Vehicle Infotainment) use. | ||
| 211 | ML7213 is companion chip for Intel Atom E6xx series. | ||
| 212 | ML7213 is completely compatible for Intel EG20T PCH. | ||
| 208 | 213 | ||
| 209 | config IMX_SDMA | 214 | config IMX_SDMA |
| 210 | tristate "i.MX SDMA support" | 215 | tristate "i.MX SDMA support" |
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index b605cc9ac3a2..297f48b0cba9 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c | |||
| @@ -19,14 +19,14 @@ | |||
| 19 | * this program; if not, write to the Free Software Foundation, Inc., 59 | 19 | * this program; if not, write to the Free Software Foundation, Inc., 59 |
| 20 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 20 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 21 | * | 21 | * |
| 22 | * The full GNU General Public License is iin this distribution in the | 22 | * The full GNU General Public License is in this distribution in the file |
| 23 | * file called COPYING. | 23 | * called COPYING. |
| 24 | * | 24 | * |
| 25 | * Documentation: ARM DDI 0196G == PL080 | 25 | * Documentation: ARM DDI 0196G == PL080 |
| 26 | * Documentation: ARM DDI 0218E == PL081 | 26 | * Documentation: ARM DDI 0218E == PL081 |
| 27 | * | 27 | * |
| 28 | * PL080 & PL081 both have 16 sets of DMA signals that can be routed to | 28 | * PL080 & PL081 both have 16 sets of DMA signals that can be routed to any |
| 29 | * any channel. | 29 | * channel. |
| 30 | * | 30 | * |
| 31 | * The PL080 has 8 channels available for simultaneous use, and the PL081 | 31 | * The PL080 has 8 channels available for simultaneous use, and the PL081 |
| 32 | * has only two channels. So on these DMA controllers the number of channels | 32 | * has only two channels. So on these DMA controllers the number of channels |
| @@ -53,7 +53,23 @@ | |||
| 53 | * | 53 | * |
| 54 | * ASSUMES default (little) endianness for DMA transfers | 54 | * ASSUMES default (little) endianness for DMA transfers |
| 55 | * | 55 | * |
| 56 | * Only DMAC flow control is implemented | 56 | * The PL08x has two flow control settings: |
| 57 | * - DMAC flow control: the transfer size defines the number of transfers | ||
| 58 | * which occur for the current LLI entry, and the DMAC raises TC at the | ||
| 59 | * end of every LLI entry. Observed behaviour shows the DMAC listening | ||
| 60 | * to both the BREQ and SREQ signals (contrary to documented), | ||
| 61 | * transferring data if either is active. The LBREQ and LSREQ signals | ||
| 62 | * are ignored. | ||
| 63 | * | ||
| 64 | * - Peripheral flow control: the transfer size is ignored (and should be | ||
| 65 | * zero). The data is transferred from the current LLI entry, until | ||
| 66 | * after the final transfer signalled by LBREQ or LSREQ. The DMAC | ||
| 67 | * will then move to the next LLI entry. | ||
| 68 | * | ||
| 69 | * Only the former works sanely with scatter lists, so we only implement | ||
| 70 | * the DMAC flow control method. However, peripherals which use the LBREQ | ||
| 71 | * and LSREQ signals (eg, MMCI) are unable to use this mode, which through | ||
| 72 | * these hardware restrictions prevents them from using scatter DMA. | ||
| 57 | * | 73 | * |
| 58 | * Global TODO: | 74 | * Global TODO: |
| 59 | * - Break out common code from arch/arm/mach-s3c64xx and share | 75 | * - Break out common code from arch/arm/mach-s3c64xx and share |
| @@ -61,50 +77,39 @@ | |||
| 61 | #include <linux/device.h> | 77 | #include <linux/device.h> |
| 62 | #include <linux/init.h> | 78 | #include <linux/init.h> |
| 63 | #include <linux/module.h> | 79 | #include <linux/module.h> |
| 64 | #include <linux/pci.h> | ||
| 65 | #include <linux/interrupt.h> | 80 | #include <linux/interrupt.h> |
| 66 | #include <linux/slab.h> | 81 | #include <linux/slab.h> |
| 67 | #include <linux/dmapool.h> | 82 | #include <linux/dmapool.h> |
| 68 | #include <linux/amba/bus.h> | ||
| 69 | #include <linux/dmaengine.h> | 83 | #include <linux/dmaengine.h> |
| 84 | #include <linux/amba/bus.h> | ||
| 70 | #include <linux/amba/pl08x.h> | 85 | #include <linux/amba/pl08x.h> |
| 71 | #include <linux/debugfs.h> | 86 | #include <linux/debugfs.h> |
| 72 | #include <linux/seq_file.h> | 87 | #include <linux/seq_file.h> |
| 73 | 88 | ||
| 74 | #include <asm/hardware/pl080.h> | 89 | #include <asm/hardware/pl080.h> |
| 75 | #include <asm/dma.h> | ||
| 76 | #include <asm/mach/dma.h> | ||
| 77 | #include <asm/atomic.h> | ||
| 78 | #include <asm/processor.h> | ||
| 79 | #include <asm/cacheflush.h> | ||
| 80 | 90 | ||
| 81 | #define DRIVER_NAME "pl08xdmac" | 91 | #define DRIVER_NAME "pl08xdmac" |
| 82 | 92 | ||
| 83 | /** | 93 | /** |
| 84 | * struct vendor_data - vendor-specific config parameters | 94 | * struct vendor_data - vendor-specific config parameters for PL08x derivatives |
| 85 | * for PL08x derivates | ||
| 86 | * @name: the name of this specific variant | ||
| 87 | * @channels: the number of channels available in this variant | 95 | * @channels: the number of channels available in this variant |
| 88 | * @dualmaster: whether this version supports dual AHB masters | 96 | * @dualmaster: whether this version supports dual AHB masters or not. |
| 89 | * or not. | ||
| 90 | */ | 97 | */ |
| 91 | struct vendor_data { | 98 | struct vendor_data { |
| 92 | char *name; | ||
| 93 | u8 channels; | 99 | u8 channels; |
| 94 | bool dualmaster; | 100 | bool dualmaster; |
| 95 | }; | 101 | }; |
| 96 | 102 | ||
| 97 | /* | 103 | /* |
| 98 | * PL08X private data structures | 104 | * PL08X private data structures |
| 99 | * An LLI struct - see pl08x TRM | 105 | * An LLI struct - see PL08x TRM. Note that next uses bit[0] as a bus bit, |
| 100 | * Note that next uses bit[0] as a bus bit, | 106 | * start & end do not - their bus bit info is in cctl. Also note that these |
| 101 | * start & end do not - their bus bit info | 107 | * are fixed 32-bit quantities. |
| 102 | * is in cctl | ||
| 103 | */ | 108 | */ |
| 104 | struct lli { | 109 | struct pl08x_lli { |
| 105 | dma_addr_t src; | 110 | u32 src; |
| 106 | dma_addr_t dst; | 111 | u32 dst; |
| 107 | dma_addr_t next; | 112 | u32 lli; |
| 108 | u32 cctl; | 113 | u32 cctl; |
| 109 | }; | 114 | }; |
| 110 | 115 | ||
| @@ -119,6 +124,8 @@ struct lli { | |||
| 119 | * @phy_chans: array of data for the physical channels | 124 | * @phy_chans: array of data for the physical channels |
| 120 | * @pool: a pool for the LLI descriptors | 125 | * @pool: a pool for the LLI descriptors |
| 121 | * @pool_ctr: counter of LLIs in the pool | 126 | * @pool_ctr: counter of LLIs in the pool |
| 127 | * @lli_buses: bitmask to or in to LLI pointer selecting AHB port for LLI fetches | ||
| 128 | * @mem_buses: set to indicate memory transfers on AHB2. | ||
| 122 | * @lock: a spinlock for this struct | 129 | * @lock: a spinlock for this struct |
| 123 | */ | 130 | */ |
| 124 | struct pl08x_driver_data { | 131 | struct pl08x_driver_data { |
| @@ -126,11 +133,13 @@ struct pl08x_driver_data { | |||
| 126 | struct dma_device memcpy; | 133 | struct dma_device memcpy; |
| 127 | void __iomem *base; | ||
