dmaengine: fsl-edma: add ColdFire mcf5441x edma support
PATCH v6 2/2 dmaengine: fsl-edma: add ColdFire mcf5441x edma support
This patch adds support for ColdFire mcf5441x-family edma module.
The ColdFire edma module is slightly different from fsl-edma, so a new driver is added. But most of the code is common between fsl-edma and mcf-edma so it has been collected into a separate common module fsl-edma-common (patch 1/2).
---
Changes for v2:
- patch splitted into 4
- add mcf-edma as minimal different parts from fsl-edma
Changes for v3:
none
Changes for v4:
- patch simplified from 4/4 into 2/2
- collecting all the mcf-edma-related changes
Changes for v5:
none
Changes for v6:
- adjusted comment header
- fixed bit shift with BIT()
- we need to free the interrupts at remove(), so removed all devm_ interrupt related calls
--- drivers/dma/Kconfig | 11 + drivers/dma/Makefile | 1 + drivers/dma/mcf-edma.c | 315 +++++++++++++++++++++ include/linux/platform_data/dma-mcf-edma.h | 38 +++ 4 files changed, 365 insertions(+) create mode 100644 drivers/dma/mcf-edma.c create mode 100644 include/linux/platform_data/dma-mcf-edma.h
drivers/dma/Kconfig +11 -0
@@ -320,6 +320,17 @@ config LPC18XX_DMAMUX Enable support for DMA on NXP LPC18xx/43xx platforms with PL080 and multiplexed DMA request lines. +config MCF_EDMA + tristate "Freescale eDMA engine support, ColdFire mcf5441x SoCs" + depends on M5441x + select DMA_ENGINE + select DMA_VIRTUAL_CHANNELS + help + Support the Freescale ColdFire eDMA engine, 64-channel + implementation that performs complex data transfers with + minimal intervention from a host processor. + This module can be found on Freescale ColdFire mcf5441x SoCs. + config MMP_PDMA bool "MMP PDMA support" depends on ARCH_MMP || ARCH_PXA || COMPILE_TEST
drivers/dma/Makefile +1 -0
@@ -32,6 +32,7 @@ obj-$(CONFIG_DW_DMAC_CORE) += dw/ obj-$(CONFIG_EP93XX_DMA) += ep93xx_dma.o obj-$(CONFIG_FSL_DMA) += fsldma.o obj-$(CONFIG_FSL_EDMA) += fsl-edma.o fsl-edma-common.o +obj-$(CONFIG_MCF_EDMA) += mcf-edma.o fsl-edma-common.o obj-$(CONFIG_FSL_RAID) += fsl_raid.o obj-$(CONFIG_HSU_DMA) += hsu/ obj-$(CONFIG_IMG_MDC_DMA) += img-mdc-dma.o
drivers/dma/mcf-edma.c new file +315 -0
315 lines not on this page · raw message
include/linux/platform_data/dma-mcf-edma.h new file +38 -0
@@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Freescale eDMA platform data, ColdFire SoC's family. +* +* Copyright (c) 2017 Angelo Dureghello <angelo@xxxxxxxx> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#ifndef __MACH_MCF_EDMA_H__ +#define __MACH_MCF_EDMA_H__ + +struct dma_slave_map ; + +bool mcf_edma_filter_fn (struct dma_chan *chan,void *param); + +#define MCF_EDMA_FILTER_PARAM (ch) ((void *)ch) + +/** +* struct mcf_edma_platform_data - platform specific data for eDMA engine +* +* @ver The eDMA module version. +* @dma_channels The number of eDMA channels. +*/ +struct mcf_edma_platform_data { +int dma_channels; +const struct dma_slave_map *slave_map; +int slavecnt; +}; + +#endif /* __MACH_MCF_EDMA_H__ */