Skip to contentSkip to conversation

dmaengine: fsl-edma: Add eDMA support for QorIQ LS1028A platform

PATCH Applied Peng Ma 3 participants 8 messages Dec 12, 2019 – Dec 23, 2019

Subsystems (4)
lore
Share & tools
lore

Peng Ma

author
#0 lore raw

PATCH v5 1/3 dmaengine: fsl-edma: Add eDMA support for QorIQ LS1028A platform

Our platforms(such as LS1021A, LS1012A, LS1043A, LS1046A, LS1028A) with below registers(CHCFG0 - CHCFG15) of eDMA as follows:
*-----------------------------------------------------------*

|     Offset   |	OTHERS			|		LS1028A			|
|--------------|--------------------|-----------------------|
|     0x0      |        CHCFG0      |           CHCFG3      |
|--------------|--------------------|-----------------------|
|     0x1      |        CHCFG1      |           CHCFG2      |
|--------------|--------------------|-----------------------|
|     0x2      |        CHCFG2      |           CHCFG1      |
|--------------|--------------------|-----------------------|
|     0x3      |        CHCFG3      |           CHCFG0      |
|--------------|--------------------|-----------------------|
|     ...      |        ......      |           ......      |
|--------------|--------------------|-----------------------|
|     0xC      |        CHCFG12     |           CHCFG15     |
|--------------|--------------------|-----------------------|
|     0xD      |        CHCFG13     |           CHCFG14     |
|--------------|--------------------|-----------------------|
|     0xE      |        CHCFG14     |           CHCFG13     |
|--------------|--------------------|-----------------------|
|     0xF      |        CHCFG15     |           CHCFG12     |

*-----------------------------------------------------------*

This patch is to improve edma driver to fit LS1028A platform.

---
Changed for v5:
- no changes

 drivers/dma/fsl-edma-common.c | 5 +++++
 drivers/dma/fsl-edma-common.h | 1 +
 drivers/dma/fsl-edma.c        | 8 ++++++++
 3 files changed, 14 insertions(+)
drivers/dma/fsl-edma-common.c +5 -0
index b1a7ca91701a..5697c3622699 100644
@@ -109,10 +109,15 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan,
 	u32 ch = fsl_chan->vchan.chan.chan_id;
 	void __iomem *muxaddr;
 	unsigned int chans_per_mux, ch_off;
+	int endian_diff[4] = {3, 1, -1, -3};
 	u32 dmamux_nr = fsl_chan->edma->drvdata->dmamuxs;
 
 	chans_per_mux = fsl_chan->edma->n_chans / dmamux_nr;
 	ch_off = fsl_chan->vchan.chan.chan_id % chans_per_mux;
+
+	if (fsl_chan->edma->drvdata->mux_swap)
+		ch_off += endian_diff[ch_off % 4];
+
 	muxaddr = fsl_chan->edma->muxbase[ch / chans_per_mux];
 	slot = EDMAMUX_CHCFG_SOURCE(slot);
 
drivers/dma/fsl-edma-common.h +1 -0
index 5eaa2902ed39..67e422590c9a 100644
@@ -147,6 +147,7 @@ struct fsl_edma_drvdata {
 	enum edma_version	version;
 	u32			dmamuxs;
 	bool			has_dmaclk;
+	bool			mux_swap;
 	int			(*setup_irq)(struct platform_device *pdev,
 					     struct fsl_edma_engine *fsl_edma);
 };
drivers/dma/fsl-edma.c +8 -0
index b626c06ac2e0..eff7ebd8cf35 100644
@@ -233,6 +233,13 @@ static struct fsl_edma_drvdata vf610_data = {
 	.setup_irq = fsl_edma_irq_init,
 };
 
+static struct fsl_edma_drvdata ls1028a_data = {
+	.version = v1,
+	.dmamuxs = DMAMUX_NR,
+	.mux_swap = true,
+	.setup_irq = fsl_edma_irq_init,
+};
+
 static struct fsl_edma_drvdata imx7ulp_data = {
 	.version = v3,
 	.dmamuxs = 1,
@@ -242,6 +249,7 @@ static struct fsl_edma_drvdata imx7ulp_data = {
 
 static const struct of_device_id fsl_edma_dt_ids[] = {
 	{ .compatible = "fsl,vf610-edma", .data = &vf610_data},
+	{ .compatible = "fsl,ls1028a-edma", .data = &ls1028a_data},
 	{ .compatible = "fsl,imx7ulp-edma", .data = &imx7ulp_data},
 	{ /* sentinel */ }
 };
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH v5 2/3 arm64: dts: ls1028a: Update edma compatible to fit eDMA driver

The eDMA of LS1028A soc has a little bit different from others, So we should distinguish them in driver by compatible.

---
Changed for v5:
- separate dts and binding

 arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +1 -1
index 8e8a77eb596a..b3716a89fa0d 100644
@@ -316,7 +316,7 @@
 
 		edma0: dma-controller@22c0000 {
 			#dma-cells = <2>;
-			compatible = "fsl,vf610-edma";
+			compatible = "fsl,ls1028a-edma";
 			reg = <0x0 0x22c0000 0x0 0x10000>,
 			      <0x0 0x22d0000 0x0 0x10000>,
 			      <0x0 0x22e0000 0x0 0x10000>;
Signature · 1 line
2.17.1
Applied
#2 lore raw

Re: [v5 2/3] arm64: dts: ls1028a: Update edma compatible to fit eDMA driver

Quoted 4 lines · Peng Ma

The eDMA of LS1028A soc has a little bit different from others, So we should distinguish them in driver by compatible.

Applied, thanks.

author
#3 lore raw

PATCH v5 3/3 dt-bindings: dma: fsl-edma: add new fsl,fsl,ls1028a-edma

In reply to Peng Ma

QORIQ LS1028A soc used fsl,vf610-edma, but it has a little bit different from others, so add new compatible to distinguish them.

---
Changed for v5:
- add new patch

 Documentation/devicetree/bindings/dma/fsl-edma.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/dma/fsl-edma.txt +1 -0
index 29dd3ccb1235..e77b08ebcd06 100644
@@ -10,6 +10,7 @@ Required properties:
 - compatible :
 	- "fsl,vf610-edma" for eDMA used similar to that on Vybrid vf610 SoC
 	- "fsl,imx7ulp-edma" for eDMA2 used similar to that on i.mx7ulp
+	- "fsl,fsl,ls1028a-edma" for eDMA used similar to that on Vybrid vf610 SoC
 - reg : Specifies base physical address(s) and size of the eDMA registers.
 	The 1st region is eDMA control register's address and size.
 	The 2nd and the 3rd regions are programmable channel multiplexing
Signature · 1 line
2.17.1
maintainer Applied
#4 lore raw
In reply to Peng Ma
Quoted 22 lines · Peng Ma

Our platforms(such as LS1021A, LS1012A, LS1043A, LS1046A, LS1028A) with below registers(CHCFG0 - CHCFG15) of eDMA as follows:
*-----------------------------------------------------------*

|     Offset   |	OTHERS			|		LS1028A			|
|--------------|--------------------|-----------------------|
|     0x0      |        CHCFG0      |           CHCFG3      |
|--------------|--------------------|-----------------------|
|     0x1      |        CHCFG1      |           CHCFG2      |
|--------------|--------------------|-----------------------|
|     0x2      |        CHCFG2      |           CHCFG1      |
|--------------|--------------------|-----------------------|
|     0x3      |        CHCFG3      |           CHCFG0      |
|--------------|--------------------|-----------------------|
|     ...      |        ......      |           ......      |
|--------------|--------------------|-----------------------|
|     0xC      |        CHCFG12     |           CHCFG15     |
|--------------|--------------------|-----------------------|
|     0xD      |        CHCFG13     |           CHCFG14     |
|--------------|--------------------|-----------------------|
|     0xE      |        CHCFG14     |           CHCFG13     |
|--------------|--------------------|-----------------------|
|     0xF      |        CHCFG15     |           CHCFG12     |
Quoted 3 lines

*-----------------------------------------------------------*

This patch is to improve edma driver to fit LS1028A platform.

Applied this and patch 3, thanks

Btw pls send bindings as patch1 and driver changes as patch2.

Signature · 1 line
~Vinod
author
#5 lore raw
Quoted 14 lines

-----Original Message-----
From: Vinod Koul <[email protected]>
Sent: 2019年12月18日 14:27
To: Peng Ma <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Leo Li <[email protected]>; [email protected]; Robin Gong <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [EXT] Re: [v5 1/3] dmaengine: fsl-edma: Add eDMA support for QorIQ LS1028A platform

Quoted 30 lines

Caution: EXT Email

Quoted 4 lines · Peng Ma

Our platforms(such as LS1021A, LS1012A, LS1043A, LS1046A, LS1028A) with below registers(CHCFG0 - CHCFG15) of eDMA as follows:
*-----------------------------------------------------------*
| Offset | OTHERS |

LS1028A |

Quoted 21 lines
|--------------|--------------------|-----------------------|
|     0x0      |        CHCFG0      |           CHCFG3      |
|--------------|--------------------|-----------------------|
|     0x1      |        CHCFG1      |           CHCFG2      |
|--------------|--------------------|-----------------------|
|     0x2      |        CHCFG2      |           CHCFG1      |
|--------------|--------------------|-----------------------|
|     0x3      |        CHCFG3      |           CHCFG0      |
|--------------|--------------------|-----------------------|
|     ...      |        ......      |           ......      |
|--------------|--------------------|-----------------------|
|     0xC      |        CHCFG12     |           CHCFG15     |
|--------------|--------------------|-----------------------|
|     0xD      |        CHCFG13     |           CHCFG14     |
|--------------|--------------------|-----------------------|
|     0xE      |        CHCFG14     |           CHCFG13     |
|--------------|--------------------|-----------------------|
|     0xF      |        CHCFG15     |           CHCFG12     |

*-----------------------------------------------------------*

This patch is to improve edma driver to fit LS1028A platform.

Hi Vinod

Quoted 2 lines

Applied this and patch 3, thanks

[Peng Ma] Many thanks.

Quoted 1 line

Btw pls send bindings as patch1 and driver changes as patch2.

[Peng Ma] I don't understand this sentence, Please give me more information. As I know patch1 is driver changes, patch2 is dts changes, patch3 is binding changes. You accepted patch1 and patch3, I am puzzled for patch2 and your comments.

Best Regards,
Peng

Quoted 2 lines

--
~Vinod

maintainer
#6 lore raw
Quoted 4 lines · Peng Ma

Btw pls send bindings as patch1 and driver changes as patch2.
[Peng Ma] I don't understand this sentence, Please give me more information. As I know patch1 is driver changes, patch2 is dts changes, patch3 is binding changes. You accepted patch1 and patch3, I am puzzled for patch2 and your comments.

The order of patches should always be dt-bindings first, followerd by driver change and the dts changes as the last one in the series.

Signature · 1 line
~Vinod
author
#7 lore raw
Quoted 19 lines

-----Original Message-----
From: Vinod Koul <[email protected]>
Sent: 2019年12月19日 23:55
To: Peng Ma <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Leo Li <[email protected]>; [email protected]; Robin Gong <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] Re: [v5 1/3] dmaengine: fsl-edma: Add eDMA support for QorIQ LS1028A platform

Caution: EXT Email

Quoted 2 lines · Peng Ma

Btw pls send bindings as patch1 and driver changes as patch2. [Peng Ma] I don't understand this sentence, Please give me more

Quoted 9 lines

information.

Quoted 1 line

As I know patch1 is driver changes, patch2 is dts changes, patch3 is binding

changes.

Quoted 1 line

You accepted patch1 and patch3, I am puzzled for patch2 and your

comments.

The order of patches should always be dt-bindings first, followerd by driver change and the dts changes as the last one in the series.

[Peng Ma] OK,Got it.
Thanks very much!

Best Regards,
Peng

Quoted 2 lines

--
~Vinod