iMX6D/Q uSDHC read/write methods

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX6D/Q uSDHC read/write methods

1,005 Views
cagatayozdemir
Contributor II

Hi all,

In iMx6Q uSDHC module, there are three options to read from / write to SD Card:

1-> Internal DMA, Over AHB Bus

2-> External DMA, Over IP Bus

3-> PIO, reading a register

What are the advantages/disadvantages or considerations about these methods? In my opinion:

a-) Reading a file via PIO is the slowest one and also makes CPU busy. This is not an efficient way. Then in which circumstances should we think to use this way?

b-) Internal DMA is special to uSDHC. It provides us not to occupy external DMA, so it seems an efficient way to use resources of the chip. However I am not sure about comparison of internal/external DMA speeds.

What are your experiences/thoughts?

Thanks,

Cagatay

Labels (2)
3 Replies

625 Views
cagatayozdemir
Contributor II

Thanks you Yuri. I think I need some more help to be totally clarified..

What determines DMA speed? Can we estimate a number or it depends on the conditions at that moment? To compare with PIO speed, is it the only way to take benchmarks?

As far as I understand from your comment, SDMA optimizes system performance therefore it allocates resources for slowest channels too and that may decrease the throughput for SD read. Is this related to the fact that external DMA  uses IP bus but internal DMA uses AHB bus?

Thanks a lot,

Cagatay

0 Kudos

625 Views
Yuri
NXP Employee
NXP Employee

Hello,

  DMA perofrmance depends on many factors, such as DMA module internal frequency, bus frequency,
internal arbitartion between SOC modules (for heavy loaded systems). We do not have special tool

to estimate it, because of system compexity.

As for performance and implementation of SDMA approach, please look at the following :

“Measure SDMA Memory To Memory Copy Performance on i.MX6Q”

https://community.freescale.com/docs/DOC-103127

Regards,

Yuri.

0 Kudos

625 Views
Yuri
NXP Employee
NXP Employee

Hello,

  Please look at my comments below.

1.

  You mentioned : “reading a file via PIO is the slowest one” - this is not obvious,

since CPU frequency of 1 GHz allows to achieve very high performance for data

read in polling technique. But - You are right - this “also makes CPU busy” and

do not allow to use advantages of multi-tasking. Therefore polling approach is not

suitable for Linux.

2.
  External DMA is used with the SDMA. The SDMA controller helps to optimize system

performance by offloading the CPU in dynamic data routing with relatively slow channels,

such as UART, SSI, SPI. The SDMA is not the best solution to achieve maximal throughput.

   It makes sense to use the internal
DMA for maximal performance.

Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------