[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180718182023.8182-9-paul@crapouillou.net>
Date: Wed, 18 Jul 2018 20:20:14 +0200
From: Paul Cercueil <paul@...pouillou.net>
To: Vinod Koul <vkoul@...nel.org>, Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Ralf Baechle <ralf@...ux-mips.org>,
Paul Burton <paul.burton@...s.com>,
James Hogan <jhogan@...nel.org>,
Zubair Lutfullah Kakakhel <Zubair.Kakakhel@...tec.com>
Cc: Mathieu Malaterre <malat@...ian.org>,
Daniel Silsby <dansilsby@...il.com>,
Paul Cercueil <paul@...pouillou.net>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mips@...ux-mips.org
Subject: [PATCH v2 08/17] dmaengine: dma-jz4780: Add support for the JZ4725B SoC
The JZ4725B has one DMA core starring six DMA channels.
As for the JZ4770, each DMA channel's clock can be enabled with
a register write, the difference here being that once started, it
is not possible to turn it off.
Signed-off-by: Paul Cercueil <paul@...pouillou.net>
Tested-by: Mathieu Malaterre <malat@...ian.org>
Reviewed-by: PrasannaKumar Muralidharan <prasannatsmkumar@...il.com>
---
drivers/dma/dma-jz4780.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
v2: - Add comments about channel enabling/disabling
- The documentation update is now in patch 01/17
diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
index 084d4023637e..88ce3f0157f6 100644
--- a/drivers/dma/dma-jz4780.c
+++ b/drivers/dma/dma-jz4780.c
@@ -136,6 +136,7 @@ struct jz4780_dma_chan {
enum jz_version {
ID_JZ4740,
+ ID_JZ4725B,
ID_JZ4770,
ID_JZ4780,
};
@@ -209,8 +210,12 @@ static inline void jz4780_dma_ctrl_writel(struct jz4780_dma_dev *jzdma,
static inline void jz4780_dma_chan_enable(struct jz4780_dma_dev *jzdma,
unsigned int chn)
{
- if (jzdma->version == ID_JZ4770)
+ if (jzdma->version == ID_JZ4770) {
jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DCKES, BIT(chn));
+ } else if (jzdma->version == ID_JZ4725B) {
+ /* JZ4725B has no DCKES, it uses DCKE to enable channels */
+ jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DCKE, BIT(chn));
+ }
}
static inline void jz4780_dma_chan_disable(struct jz4780_dma_dev *jzdma,
@@ -218,6 +223,8 @@ static inline void jz4780_dma_chan_disable(struct jz4780_dma_dev *jzdma,
{
if (jzdma->version == ID_JZ4770)
jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DCKEC, BIT(chn));
+
+ /* On JZ4725B it is not possible to stop a DMA channel once enabled */
}
static struct jz4780_dma_desc *jz4780_dma_desc_alloc(
@@ -805,12 +812,14 @@ static struct dma_chan *jz4780_of_dma_xlate(struct of_phandle_args *dma_spec,
static const struct jz4780_dma_soc_data jz4780_dma_soc_data[] = {
[ID_JZ4740] = { .nb_channels = 6, .transfer_ord_max = 5, },
+ [ID_JZ4725B] = { .nb_channels = 6, .transfer_ord_max = 5, },
[ID_JZ4770] = { .nb_channels = 6, .transfer_ord_max = 6, },
[ID_JZ4780] = { .nb_channels = 32, .transfer_ord_max = 7, },
};
static const struct of_device_id jz4780_dma_dt_match[] = {
{ .compatible = "ingenic,jz4740-dma", .data = (void *)ID_JZ4740 },
+ { .compatible = "ingenic,jz4725b-dma", .data = (void *)ID_JZ4725B },
{ .compatible = "ingenic,jz4770-dma", .data = (void *)ID_JZ4770 },
{ .compatible = "ingenic,jz4780-dma", .data = (void *)ID_JZ4780 },
{},
--
2.11.0
Powered by blists - more mailing lists