From: peter.griffin@linaro.org (Peter Griffin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/18] dmaengine: st_fdma: Add STMicroelectronics FDMA engine driver support
Date: Thu, 21 Apr 2016 15:58:22 +0100 [thread overview]
Message-ID: <20160421145822.GA1725@griffinp-ThinkPad-X1-Carbon-2nd> (raw)
In-Reply-To: <C246CAC1457055469EF09E3A7AC4E11A4A57989B@XAP-PVEXMBX01.xlnx.xilinx.com>
Hi Appana,
Thanks for the review.
On Thu, 21 Apr 2016, Appana Durga Kedareswara Rao wrote:
>
>
> > -----Original Message-----
> > From: dmaengine-owner at vger.kernel.org [mailto:dmaengine-
> > owner at vger.kernel.org] On Behalf Of Peter Griffin
> > Sent: Thursday, April 21, 2016 4:34 PM
> > To: linux-arm-kernel at lists.infradead.org; linux-kernel at vger.kernel.org;
> > srinivas.kandagatla at gmail.com; maxime.coquelin at st.com;
> > patrice.chotard at st.com; vinod.koul at intel.com
> > Cc: peter.griffin at linaro.org; lee.jones at linaro.org;
> > dmaengine at vger.kernel.org; devicetree at vger.kernel.org; arnd at arndb.de;
> > broonie at kernel.org; ludovic.barre at st.com
> > Subject: [PATCH 03/18] dmaengine: st_fdma: Add STMicroelectronics FDMA
> > engine driver support
> >
> > This patch adds support for the Flexible Direct Memory Access (FDMA) core
> > driver. The FDMA is a slim core CPU with a dedicated firmware.
> > It is a general purpose DMA controller capable of supporting 16
> > independent DMA channels. Data moves maybe from memory to memory
> > or between memory and paced latency critical real time targets and it
> > is found on al STi based chipsets.
> >
> > Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
> > Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
> > ---
> > drivers/dma/Kconfig | 12 +
> > drivers/dma/Makefile | 1 +
> > drivers/dma/st_fdma.c | 967
> > ++++++++++++++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 980 insertions(+)
> > create mode 100644 drivers/dma/st_fdma.c
> >
> > diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
> > index d96d87c..5910c4f 100644
> > --- a/drivers/dma/Kconfig
> > +++ b/drivers/dma/Kconfig
> > @@ -527,6 +527,18 @@ config ZX_DMA
> > help
> > Support the DMA engine for ZTE ZX296702 platform devices.
> >
> > +config ST_FDMA
> > + tristate "ST FDMA dmaengine support"
> > + depends on ARCH_STI
> > + select DMA_ENGINE
> > + select FW_LOADER
> > + select DMA_VIRTUAL_CHANNELS
> > + help
> > + Enable support for ST FDMA controller.
> > + It supports 16 independent DMA channels, accepts up to 32 DMA
> > requests
> > +
> > + Say Y here if you have such a chipset.
> > + If unsure, say N.
> >
> > # driver files
> > source "drivers/dma/bestcomm/Kconfig"
> > diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
> > index 6084127..b81ca99 100644
> > --- a/drivers/dma/Makefile
> > +++ b/drivers/dma/Makefile
> > @@ -65,6 +65,7 @@ obj-$(CONFIG_TI_DMA_CROSSBAR) += ti-dma-crossbar.o
> > obj-$(CONFIG_TI_EDMA) += edma.o
> > obj-$(CONFIG_XGENE_DMA) += xgene-dma.o
> > obj-$(CONFIG_ZX_DMA) += zx296702_dma.o
> > +obj-$(CONFIG_ST_FDMA) += st_fdma.o
> >
> > obj-y += qcom/
> > obj-y += xilinx/
> > diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c
> > new file mode 100644
> > index 0000000..9bf0100
> > --- /dev/null
> > +++ b/drivers/dma/st_fdma.c
> > @@ -0,0 +1,967 @@
> > +/*
> > + * st_fdma.c
> > + *
> > + * Copyright (C) 2014 STMicroelectronics
> > + * Author: Ludovic Barre <Ludovic.barre@st.com>
> > + * License terms: GNU General Public License (GPL), version 2
> > + */
> > +#include <linux/init.h>
> > +#include <linux/module.h>
> > +#include <linux/slab.h>
> > +#include <linux/of.h>
> > +#include <linux/of_device.h>
> > +#include <linux/of_dma.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/clk.h>
> > +#include <linux/dmaengine.h>
> > +#include <linux/dmapool.h>
> > +#include <linux/firmware.h>
> > +#include <linux/elf.h>
> > +#include <linux/atomic.h>
> > +
> > +#include "st_fdma.h"
> > +#include "dmaengine.h"
> > +#include "virt-dma.h"
> > +
> > +static char *fdma_clk_name[CLK_MAX_NUM] = {
> > + [CLK_SLIM] = "fdma_slim",
> > + [CLK_HI] = "fdma_hi",
> > + [CLK_LOW] = "fdma_low",
> > + [CLK_IC] = "fdma_ic",
> > +};
> > +
> > +static int st_fdma_clk_get(struct st_fdma_dev *fdev)
> > +{
> > + int i;
> > +
> > + for (i = 0; i < CLK_MAX_NUM; i++) {
> > + fdev->clks[i] = devm_clk_get(fdev->dev, fdma_clk_name[i]);
> > + if (IS_ERR(fdev->clks[i])) {
> > + dev_err(fdev->dev,
> > + "failed to get clock: %s\n", fdma_clk_name[i]);
> > + return PTR_ERR(fdev->clks[i]);
> > + }
> > + }
> > +
> > + if (i != CLK_MAX_NUM) {
> > + dev_err(fdev->dev, "all clocks are not defined\n");
> > + return -EINVAL;
> > + }
> > +
> > + return 0;
> > +}
> > +
> > +static int st_fdma_clk_enable(struct st_fdma_dev *fdev)
> > +{
> > + int i, ret;
> > +
> > + for (i = 0; i < CLK_MAX_NUM; i++) {
> > + ret = clk_prepare_enable(fdev->clks[i]);
> > + if (ret < 0)
>
> You should disable and unprepared the other clocks...
Good point, will fix in v4.
regards,
Perer
next prev parent reply other threads:[~2016-04-21 14:58 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-21 11:04 [PATCH 00/18] Add support for FDMA DMA controller found on STi chipsets Peter Griffin
2016-04-21 11:04 ` [PATCH 01/18] dmaengine: st_fdma: Add STMicroelectronics FDMA DT binding documentation Peter Griffin
2016-04-21 11:25 ` Arnd Bergmann
2016-04-26 12:00 ` Peter Griffin
2016-04-21 11:04 ` [PATCH 02/18] dmaengine: st_fdma: Add STMicroelectronics FDMA driver header file Peter Griffin
2016-04-21 11:20 ` Arnd Bergmann
2016-04-21 11:04 ` [PATCH 03/18] dmaengine: st_fdma: Add STMicroelectronics FDMA engine driver support Peter Griffin
2016-04-21 11:24 ` Arnd Bergmann
2016-04-21 11:26 ` Appana Durga Kedareswara Rao
2016-04-21 14:58 ` Peter Griffin [this message]
2016-04-25 9:04 ` Lee Jones
2016-04-26 16:56 ` Vinod Koul
2016-04-27 12:59 ` Peter Griffin
2016-05-02 9:30 ` Vinod Koul
2016-05-09 17:30 ` Peter Griffin
2016-04-21 11:04 ` [PATCH 04/18] dmaengine: st_fdma: Add xp70 firmware loading mechanism Peter Griffin
2016-04-26 17:00 ` Vinod Koul
2016-05-11 7:57 ` Peter Griffin
2016-05-12 5:40 ` Vinod Koul
2016-04-21 11:04 ` [PATCH 05/18] dmaengine: st_fdma: Add fdma suspend and resume callbacks Peter Griffin
2016-04-21 11:04 ` [PATCH 06/18] ARM: STi: DT: STiH407: Add FDMA driver dt nodes Peter Griffin
2016-04-21 11:04 ` [PATCH 07/18] MAINTAINERS: Add FDMA driver files to STi section Peter Griffin
2016-04-21 11:04 ` [PATCH 08/18] ARM: multi_v7_defconfig: Enable STi FDMA driver Peter Griffin
2016-04-21 11:25 ` Arnd Bergmann
2016-04-26 10:42 ` Peter Griffin
2016-04-21 11:04 ` [PATCH 09/18] ASoC: sti: Update DT example to match the driver code Peter Griffin
2016-04-21 11:27 ` Arnd Bergmann
2016-04-26 10:11 ` Peter Griffin
2016-04-26 10:58 ` Arnd Bergmann
2016-04-26 11:15 ` Peter Griffin
2016-04-26 11:44 ` Arnd Bergmann
2016-05-04 7:52 ` Arnaud Pouliquen
2016-05-04 9:05 ` Arnd Bergmann
2016-04-21 15:57 ` Mark Brown
2016-04-26 11:02 ` Peter Griffin
2016-05-03 15:46 ` Arnaud Pouliquen
2016-04-21 11:04 ` [PATCH 10/18] ASoC: sti: Update example to include assigned-clocks and mclk-fs Peter Griffin
2016-04-21 15:49 ` Mark Brown
2016-04-26 11:52 ` Peter Griffin
2016-04-26 14:23 ` Mark Brown
2016-04-26 14:51 ` Peter Griffin
2016-04-26 15:03 ` Mark Brown
2016-04-26 16:14 ` Peter Griffin
2016-04-26 16:41 ` Mark Brown
2016-04-26 17:49 ` Peter Griffin
2016-04-21 11:04 ` [PATCH 11/18] ARM: multi_v7_defconfig: Enable STi and simple-card drivers Peter Griffin
2016-04-21 11:04 ` [PATCH 12/18] ARM: DT: STiH407: Add i2s_out pinctrl configuration Peter Griffin
2016-04-21 11:04 ` [PATCH 13/18] ARM: DT: STiH407: Add i2s_in " Peter Griffin
2016-04-21 11:04 ` [PATCH 14/18] ARM: DT: STiH407: Add spdif_out pinctrl config Peter Griffin
2016-04-21 11:04 ` [PATCH 15/18] ARM: STi: DT: STiH407: Add sti-sasg-codec dt node Peter Griffin
2016-04-21 11:04 ` [PATCH 16/18] ARM: STi: DT: STiH407: Add uniperif player dt nodes Peter Griffin
2016-04-21 11:04 ` [PATCH 17/18] ARM: STi: DT: STiH407: Add uniperif reader " Peter Griffin
2016-04-21 11:04 ` [PATCH 18/18] ARM: DT: STi: stihxxx-b2120: Add DT nodes for STi audio card Peter Griffin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160421145822.GA1725@griffinp-ThinkPad-X1-Carbon-2nd \
--to=peter.griffin@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox