Skip to contentSkip to conversation

Add Ingenic JZ4755 DMA support

PATCH Superseded Siarhei Volkau 3 participants 8 messages Oct 16, 2022 – Oct 18, 2022

Subsystems (4)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add Ingenic JZ4755 DMA support

This patch serie adds JZ4755 SoC DMA support.

Diffs from 1-st patchset:
- DMA patches splitted into its own patchset
- acks collected

Siarhei Volkau (2):
dt-bindings: ingenic: Add support for the JZ4755 dmaengine
dmaengine: JZ4780: Add support for the JZ4755.

 Documentation/devicetree/bindings/dma/ingenic,dma.yaml | 1 +
 drivers/dma/dma-jz4780.c                               | 8 ++++++++
 2 files changed, 9 insertions(+)
Signature · 1 line
2.36.1
#1 lore raw

PATCH v2 1/2 dt-bindings: ingenic: Add support for the JZ4755 dmaengine

---
 Documentation/devicetree/bindings/dma/ingenic,dma.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/dma/ingenic,dma.yaml +1 -0
index 3b0b3b919..e42b8ce94 100644
@@ -18,6 +18,7 @@ properties:
       - enum:
           - ingenic,jz4740-dma
           - ingenic,jz4725b-dma
+          - ingenic,jz4755-dma
           - ingenic,jz4760-dma
           - ingenic,jz4760-bdma
           - ingenic,jz4760-mdma
Signature · 1 line
2.36.1
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: ingenic: Add support for the JZ4755 dmaengine

On 16/10/2022 11:12, Siarhei Volkau wrote:

You miss here now commit msg.

Quoted 2 lines

No empty lines allowed between tags

Quoted 10 lines
---
 Documentation/devicetree/bindings/dma/ingenic,dma.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/dma/ingenic,dma.yaml +0 -0
index 3b0b3b919..e42b8ce94 100644

Documentation/devicetree/bindings/dma/ingenic,dma.yaml properties: · line 24

Quoted 7 lines
Documentation/devicetree/bindings/dma/ingenic,dma.yaml +1 -0
@@ -18,6 +18,7 @@ properties:
       - enum:
           - ingenic,jz4740-dma
           - ingenic,jz4725b-dma
+          - ingenic,jz4755-dma
           - ingenic,jz4760-dma
           - ingenic,jz4760-bdma
           - ingenic,jz4760-mdma

Best regards,
Krzysztof

#3 lore raw

PATCH v2 2/2 dmaengine: JZ4780: Add support for the JZ4755.

In reply to Siarhei Volkau

The JZ4755 has 4 DMA channels per DMA unit, two idential DMA units.

The JZ4755 has the similar DMA engine to JZ4725b, so I assume it has the same bug as JZ4725b, see commit a40c94be2336.

---
 drivers/dma/dma-jz4780.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/dma/dma-jz4780.c +8 -0
index 2a483802d..9c1a6e9a9 100644
@@ -1038,6 +1038,13 @@ static const struct jz4780_dma_soc_data jz4725b_dma_soc_data = {
 		 JZ_SOC_DATA_BREAK_LINKS,
 };
 
+static const struct jz4780_dma_soc_data jz4755_dma_soc_data = {
+	.nb_channels = 4,
+	.transfer_ord_max = 5,
+	.flags = JZ_SOC_DATA_PER_CHAN_PM | JZ_SOC_DATA_NO_DCKES_DCKEC |
+		 JZ_SOC_DATA_BREAK_LINKS,
+};
+
 static const struct jz4780_dma_soc_data jz4760_dma_soc_data = {
 	.nb_channels = 5,
 	.transfer_ord_max = 6,
@@ -1101,6 +1108,7 @@ static const struct jz4780_dma_soc_data x1830_dma_soc_data = {
 static const struct of_device_id jz4780_dma_dt_match[] = {
 	{ .compatible = "ingenic,jz4740-dma", .data = &jz4740_dma_soc_data },
 	{ .compatible = "ingenic,jz4725b-dma", .data = &jz4725b_dma_soc_data },
+	{ .compatible = "ingenic,jz4755-dma", .data = &jz4755_dma_soc_data },
 	{ .compatible = "ingenic,jz4760-dma", .data = &jz4760_dma_soc_data },
 	{ .compatible = "ingenic,jz4760-mdma", .data = &jz4760_mdma_soc_data },
 	{ .compatible = "ingenic,jz4760-bdma", .data = &jz4760_bdma_soc_data },
Signature · 1 line
2.36.1
maintainer
#4 lore raw

Re: [PATCH v2 2/2] dmaengine: JZ4780: Add support for the JZ4755.

Hi Siarhei,

Quoted 4 lines · Siarhei Volkau

The JZ4755 has 4 DMA channels per DMA unit, two idential DMA units.

The JZ4755 has the similar DMA engine to JZ4725b, so I assume it has the same bug as JZ4725b, see commit a40c94be2336.

Can you verify that?

It should be pretty simple, if it has the bug you'll see I/O errors on the SD card.

Cheers,
-Paul

Quoted 42 lines
---
 drivers/dma/dma-jz4780.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/dma/dma-jz4780.c +7 -0
index 2a483802d..9c1a6e9a9 100644
@@ -1038,6 +1038,13 @@ static const struct jz4780_dma_soc_data 
 jz4725b_dma_soc_data = {
 		 JZ_SOC_DATA_BREAK_LINKS,
 };
 
+static const struct jz4780_dma_soc_data jz4755_dma_soc_data = {
+	.nb_channels = 4,
+	.transfer_ord_max = 5,
+	.flags = JZ_SOC_DATA_PER_CHAN_PM | JZ_SOC_DATA_NO_DCKES_DCKEC |
+		 JZ_SOC_DATA_BREAK_LINKS,
+};
+
 static const struct jz4780_dma_soc_data jz4760_dma_soc_data = {
 	.nb_channels = 5,
drivers/dma/dma-jz4780.c +1 -0
 	.transfer_ord_max = 6,
@@ -1101,6 +1108,7 @@ static const struct jz4780_dma_soc_data 
 x1830_dma_soc_data = {
 static const struct of_device_id jz4780_dma_dt_match[] = {
 	{ .compatible = "ingenic,jz4740-dma", .data = &jz4740_dma_soc_data 
 },
 	{ .compatible = "ingenic,jz4725b-dma", .data = 
 &jz4725b_dma_soc_data },
+	{ .compatible = "ingenic,jz4755-dma", .data = &jz4755_dma_soc_data 

},
{ .compatible = "ingenic,jz4760-dma", .data = &jz4760_dma_soc_data
},
{ .compatible = "ingenic,jz4760-mdma", .data =
&jz4760_mdma_soc_data },
{ .compatible = "ingenic,jz4760-bdma", .data =
&jz4760_bdma_soc_data },
--
2.36.1

#5 lore raw

Re: [PATCH v2 2/2] dmaengine: JZ4780: Add support for the JZ4755.

пн, 17 окт. 2022 г. в 12:34, Paul Cercueil <[email protected]>:

Quoted 4 lines

Can you verify that?

It should be pretty simple, if it has the bug you'll see I/O errors on the SD card.

Well, the result is ambiguous:

Without that 'broken' flag: mmc works poorly, but becomes more or less stable when MMC clock downs to 6MHz (90% boots without errors). On the 12MHz MMC clock the issue doesn't appear in 50-70% cases. On the 24MHz MMC clock the device never boots up.

However with the flag: MMC works stable on 24MHz MMC clock (boot issue observed only once), but if I increase MMC clock speed even a bit the problem appears oftenly ( >70% of cases).

So, that flag definitely helps a lot, but the nature of the problem might be different.

BR,
Siarhei

maintainer
#6 lore raw

Re: [PATCH v2 2/2] dmaengine: JZ4780: Add support for the JZ4755.

Hi,

Quoted 14 lines · Siarhei Volkau

пн, 17 окт. 2022 г. в 12:34, Paul Cercueil <[email protected]>:

Quoted 5 lines

Can you verify that?

It should be pretty simple, if it has the bug you'll see I/O errors
on
the SD card.

Well, the result is ambiguous:

Without that 'broken' flag: mmc works poorly, but becomes more or less stable when MMC clock downs to 6MHz (90% boots without errors). On the 12MHz MMC clock the issue doesn't appear in 50-70% cases. On the 24MHz MMC clock the device never boots up.

Quoted 6 lines

However with the flag: MMC works stable on 24MHz MMC clock (boot issue observed only once), but if I increase MMC clock speed even a bit the problem appears oftenly ( >70% of cases).

So, that flag definitely helps a lot, but the nature of the problem might be different.

If the flag makes any difference then it's needed.

The controller should support up to 50 MHz, make sure that your "mmc" clock is at 50 MHz otherwise changing the max-frequency DT property won't do much.

Cheers,
-Paul

maintainer Reviewed-by on v2 2/2
#7 lore raw

Re: [PATCH v2 2/2] dmaengine: JZ4780: Add support for the JZ4755.

In reply to Siarhei Volkau

Hi Siarhei,

Quoted 6 lines · Siarhei Volkau

The JZ4755 has 4 DMA channels per DMA unit, two idential DMA units.

The JZ4755 has the similar DMA engine to JZ4725b, so I assume it has the same bug as JZ4725b, see commit a40c94be2336.

Cheers,
-Paul

Quoted 41 lines
---
 drivers/dma/dma-jz4780.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/dma/dma-jz4780.c +7 -0
index 2a483802d..9c1a6e9a9 100644
@@ -1038,6 +1038,13 @@ static const struct jz4780_dma_soc_data 
 jz4725b_dma_soc_data = {
 		 JZ_SOC_DATA_BREAK_LINKS,
 };
 
+static const struct jz4780_dma_soc_data jz4755_dma_soc_data = {
+	.nb_channels = 4,
+	.transfer_ord_max = 5,
+	.flags = JZ_SOC_DATA_PER_CHAN_PM | JZ_SOC_DATA_NO_DCKES_DCKEC |
+		 JZ_SOC_DATA_BREAK_LINKS,
+};
+
 static const struct jz4780_dma_soc_data jz4760_dma_soc_data = {
 	.nb_channels = 5,
drivers/dma/dma-jz4780.c +1 -0
 	.transfer_ord_max = 6,
@@ -1101,6 +1108,7 @@ static const struct jz4780_dma_soc_data 
 x1830_dma_soc_data = {
 static const struct of_device_id jz4780_dma_dt_match[] = {
 	{ .compatible = "ingenic,jz4740-dma", .data = &jz4740_dma_soc_data 
 },
 	{ .compatible = "ingenic,jz4725b-dma", .data = 
 &jz4725b_dma_soc_data },
+	{ .compatible = "ingenic,jz4755-dma", .data = &jz4755_dma_soc_data 

},
{ .compatible = "ingenic,jz4760-dma", .data = &jz4760_dma_soc_data
},
{ .compatible = "ingenic,jz4760-mdma", .data =
&jz4760_mdma_soc_data },
{ .compatible = "ingenic,jz4760-bdma", .data =
&jz4760_bdma_soc_data },
--
2.36.1