Skip to contentSkip to conversation

arm, am1808: using mmc1 controller and dma

DISCUSSION Heiko Schocher 3 participants 5 messages Dec 2, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hello,

trying Linux 3.2.0-rc3 on an am1808 based board using MMCSD1 controller, and facing problems with using DMA. Deactivating use_dma=0 in the davinci_mmc controller and mmc works in pio mode without problems. So there are no hardware problems, pinmux is ok, psc are all on.

Tried this on the AM1808 evalboard TMDXEXP1808L, and Linux 3.1 works with DMA without problems. Difference: On the AM1808 Evalboard TMDXEXP1808L MMCSD0 controller is used on my am1808 based board MMCSD1!

Debugging in code and found, that on the am1808 evalboard I get on startup (first DMA access):

CMD13, arg 0x00000000, R1/R5/R6/R7 response

a status back in mmc_davinci_irq():

TRNDNE (0x1000) Transfer done
RSPDNE (0x0004) Response succesfully has received DATDNE (0x0001) The data has been fully transmitted

On the am1808 based board with using MMCSD1 I get:

CMD13, arg 0x00000000, R1/R5/R6/R7 response

TRNDNE (0x1000) Transfer done
DRRDY (0x0400) MMCDRR is ready New data arrived and can be read by cpu or dma RSPDNE (0x0004) Response succesfully has received

after that command, I see no more mmc accesses ... some ideas?

Looking in the sprufu5.pdf (AM18x ARM Microprocessor Enhanced Direct Memory Access (EDMA3) Controller" chapter "2.6 Event, Channel, and PaRAM Mapping":

"Most of the DMA channels are tied to a specific hardware peripheral event, thus allowing transfers to be triggered by events from device peripherals or external hardware."

The mapping is defined in the device specific manual
http://www.ti.com/lit/ds/sprs653b/sprs653b.pdf
chapter "5.9.1 EDMA3 Channel Synchronization Events"

and there I found:

EDMA0 Controller Event 16 MMCSD0 Receive
EDMA0 Controller Event 17 MMCSD0 Transmit

EDMA1 Controller Event 28 MMCSD1 Receive
EDMA1 Controller Event 29 MMCSD1 Transmit

The Linux 3.1 Code is using
EDMA1 Controller Event 28 MMCSD1 Receive
EDMA1 Controller Event 29 MMCSD1 Transmit

as events for the MMCSD1 controller ... so, this should be ok ... I see no more differences between MMCSD0 and MMCSD1 ... maybe I miss something?

Have somebody running an am1808 based board with using MMCSD controller 1?

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#1 lore raw

Hi,

Quoted 7 lines · Heiko Schocher

Hello,

trying Linux 3.2.0-rc3 on an am1808 based board using MMCSD1 controller, and facing problems with using DMA. Deactivating use_dma=0 in the davinci_mmc controller and mmc works in pio mode without problems. So there are no hardware problems, pinmux is ok, psc are all on.

Please refer to the discussion at [1] where similar issue was discussed. Go through the entire thread. In the patch posted by Juha in this link, I see that except for the below hunk all others are integrated.

@@ -1508,7 +1506,7 @@ static int __init edma_probe(struct platform_device *pdev)

                 * started by the codec engine will not cause audio defects.
                 */
                for (i = 0; i < edma_info[j]->num_channels; i++)

- map_dmach_queue(j, i, EVENTQ_1);
+ map_dmach_queue(j, i, edma_info[j]->default_queue);

                queue_tc_mapping = info[j].queue_tc_mapping;
                queue_priority_mapping = info[j].queue_priority_mapping;

Can you check whether the above patch fixes your issue?

[1] http://www.mail-archive.com/[email protected]/msg17926.html

Thanks,
Sudhakar

#2 lore raw

Hello Rajashekhara, Sudhakar,

Quoted 5 lines · Sudhakar

Hi,

Quoted 2 lines · Heiko Schocher

Hello,

Quoted 7 lines
Quoted 5 lines

trying Linux 3.2.0-rc3 on an am1808 based board using MMCSD1 controller, and facing problems with using DMA. Deactivating use_dma=0 in the davinci_mmc controller and mmc works in pio mode without problems. So there are no hardware problems, pinmux is ok, psc are all on.

Please refer to the discussion at [1] where similar issue was discussed. Go through the

Oh, sorry, missed this! Thanks for the hint!

Quoted 13 lines

entire thread. In the patch posted by Juha in this link, I see that except for the below hunk all others are integrated.

(quoted diff) +1 -1
@@ -1508,7 +1506,7 @@ static int __init edma_probe(struct platform_device *pdev)
                 * started by the codec engine will not cause audio defects.
                 */
                for (i = 0; i < edma_info[j]->num_channels; i++)
-                       map_dmach_queue(j, i, EVENTQ_1);
+                       map_dmach_queue(j, i, edma_info[j]->default_queue);
 
                queue_tc_mapping = info[j].queue_tc_mapping;
                queue_priority_mapping = info[j].queue_priority_mapping;
Quoted 1 line

Can you check whether the above patch fixes your issue?

Yuhu! that works for me! But I had to fix it a little, because "edma_info" is now named "info". Here my diff:

arch/arm/mach-davinci/dma.c +1 -1
index da90103..e10a251 100644
@@ -1513,7 +1513,7 @@ static int __init edma_probe(struct platform_device *pdev)
                 * started by the codec engine will not cause audio defects.
                 */
                for (i = 0; i < edma_cc[j]->num_channels; i++)
-                       map_dmach_queue(j, i, EVENTQ_1);
+                       map_dmach_queue(j, i, info[j]->default_queue);
 
                queue_tc_mapping = info[j]->queue_tc_mapping;
                queue_priority_mapping = info[j]->queue_priority_mapping;
Quoted 1 line

[1] http://www.mail-archive.com/[email protected]/msg17926.html

Do you prepare a patch, or should I send it?

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw

Hi,

Quoted 15 lines · Heiko Schocher

Hello Rajashekhara, Sudhakar,

Quoted 12 lines · Sudhakar

Hi,

Quoted 7 lines · Heiko Schocher

Hello,

trying Linux 3.2.0-rc3 on an am1808 based board using MMCSD1 controller, and facing problems with using DMA. Deactivating use_dma=0 in the davinci_mmc controller and mmc works in pio mode without problems. So there are no hardware problems, pinmux is ok, psc are all on.

Please refer to the discussion at [1] where similar issue was discussed. Go through the

[...]

Quoted 4 lines

Yuhu! that works for me! But I had to fix it a little, because "edma_info" is now named "info". Here my diff:

Yup, this patch was on an older version.

Quoted 14 lines
arch/arm/mach-davinci/dma.c +1 -1
index da90103..e10a251 100644
@@ -1513,7 +1513,7 @@ static int __init edma_probe(struct platform_device *pdev)
                 * started by the codec engine will not cause audio defects.
                 */
                for (i = 0; i < edma_cc[j]->num_channels; i++)
-                       map_dmach_queue(j, i, EVENTQ_1);
+                       map_dmach_queue(j, i, info[j]->default_queue);
 
                queue_tc_mapping = info[j]->queue_tc_mapping;
                queue_priority_mapping = info[j]->queue_priority_mapping;
Quoted 4 lines
Quoted 1 line

[1] http://www.mail-archive.com/[email protected]/msg17926.html

Do you prepare a patch, or should I send it?

You can go ahead and submit the patch but Juha was the person who found out this issue.

Thanks,
Sudhakar

#4 lore raw

Hello Juha,

Quoted 37 lines · Sudhakar

Hi,

Quoted 14 lines · Heiko Schocher

Hello Rajashekhara, Sudhakar,

Quoted 11 lines · Sudhakar

Hi,

Quoted 7 lines · Heiko Schocher

Hello,

trying Linux 3.2.0-rc3 on an am1808 based board using MMCSD1 controller, and facing problems with using DMA. Deactivating use_dma=0 in the davinci_mmc controller and mmc works in pio mode without problems. So there are no hardware problems, pinmux is ok, psc are all on.

Please refer to the discussion at [1] where similar issue was discussed. Go through the

[...]

Quoted 3 lines

Yuhu! that works for me! But I had to fix it a little, because "edma_info" is now named "info". Here my diff:

Yup, this patch was on an older version.

Quoted 11 lines
arch/arm/mach-davinci/dma.c +1 -1
index da90103..e10a251 100644
@@ -1513,7 +1513,7 @@ static int __init edma_probe(struct platform_device *pdev)
                 * started by the codec engine will not cause audio defects.
                 */
                for (i = 0; i < edma_cc[j]->num_channels; i++)
-                       map_dmach_queue(j, i, EVENTQ_1);
+                       map_dmach_queue(j, i, info[j]->default_queue);
 
Quoted 8 lines
Quoted 6 lines
arch/arm/mach-davinci/dma.c +0 -0
                queue_tc_mapping = info[j]->queue_tc_mapping;
                queue_priority_mapping = info[j]->queue_priority_mapping;
Quoted 2 lines

[1] http://www.mail-archive.com/[email protected]/msg17926.html

Do you prepare a patch, or should I send it?

You can go ahead and submit the patch but Juha was the person who found out this issue.

Juha, can you post this patch, or is it ok for you, if I post it with your "Reported-by" and "Signed-off-by"?

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany