Difference between revisions of "Tests:r-car-gen3-sdhi-dma"

From eLinux.org
Jump to: navigation, search
(Indicative Speed)
(Indicative Speed without DMA)
 
(24 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
DMA support R-Car Gen3 SoCs for the SDHI driver is currently available in a topic branch:
 
DMA support R-Car Gen3 SoCs for the SDHI driver is currently available in a topic branch:
  
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git topic/sdhi-gen3-dma
+
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git topic/sdhi-gen3-dma-2017-v3
  
 
For the tests described here the kernel was compiled with the arm64 defconfig.
 
For the tests described here the kernel was compiled with the arm64 defconfig.
MMC_SDHI was also enabled.
 
  
 
It is critical that MMC_SDHI is enabled for this testing.
 
It is critical that MMC_SDHI is enabled for this testing.
  
 
== Hardware Environment ==
 
== Hardware Environment ==
* Board/Soc: Salvator-X/r8a7795 (Gen 3 R-Car H3 SoC)
+
* Board/Soc: Salvator-X/r8a7796 (Gen 3 R-Car M3-W ES1.0 SoC)
* MMC Card: SanDisk Card: SanDisk Ultra class 6 30MB/s 4GB marked with SD HC I
+
* MMC Cards:
 +
** Card 1:
 +
*** Description: SanDisk Extreme Pro 8Gb microSDHC UHS-1
 +
*** Product ID: SDSDQXP-008G-X46
 +
*** CID: 035344535530384780b1b8a11200d300
 +
** Card 2:
 +
*** Description: Samsung Pro+ SDHC UHS-1
 +
*** Product ID: MB-SD32D/EU
 +
*** CID: 1b534d3030303030103916141700f600
  
 
==Verifying SDHI Driver Initialisation==
 
==Verifying SDHI Driver Initialisation==
Line 21: Line 28:
 
e.g.:
 
e.g.:
 
<pre>
 
<pre>
# dmesg | egrep "(sdhi|tmio|mmc)"
+
# dmesg | egrep '(sd|mmc)'
[    1.740328] sh_mobile_sdhi ee100000.sd: Got CD GPIO
+
...
[    1.745235] sh_mobile_sdhi ee100000.sd: Got WP GPIO
+
[    1.430237] renesas_sdhi_internal_dmac ee100000.sd: Got CD GPIO
[    1.750381] sh_mobile_sdhi ee160000.sd: Got CD GPIO
+
[    1.436224] renesas_sdhi_internal_dmac ee100000.sd: Got WP GPIO
[    1.755292] sh_mobile_sdhi ee160000.sd: Got WP GPIO
+
[    1.564915] renesas_sdhi_internal_dmac ee140000.sd: mmc0 base at 0xee140000 max clock rate 200 MHz
[    1.845880] sh_mobile_sdhi ee100000.sd: Got CD GPIO
+
[    1.574277] renesas_sdhi_internal_dmac ee160000.sd: Got CD GPIO
[    1.850806] sh_mobile_sdhi ee100000.sd: Got WP GPIO
+
[    1.580250] renesas_sdhi_internal_dmac ee160000.sd: Got WP GPIO
[    1.949051] sh_mobile_sdhi ee100000.sd: mmc0 base at 0xee100000 max clock rate 99 MHz
+
...
[    1.957274] sh_mobile_sdhi ee160000.sd: Got CD GPIO
+
[    1.643641] renesas_sdhi_internal_dmac ee100000.sd: Got CD GPIO
[    1.963337] sh_mobile_sdhi ee160000.sd: Got WP GPIO
+
[    1.649678] renesas_sdhi_internal_dmac ee100000.sd: Got WP GPIO
[    2.061016] sh_mobile_sdhi ee160000.sd: mmc1 base at 0xee160000 max clock rate 99 MHz
+
[    1.780987] renesas_sdhi_internal_dmac ee100000.sd: mmc1 base at 0xee100000 max clock rate 200 MHz
alarm ~ # [   34.461032] mmc0: new high speed SDHC card at address aaaa
+
[    1.791301] renesas_sdhi_internal_dmac ee160000.sd: Got CD GPIO
[   34.471230] mmcblk0: mmc0:aaaa SU04G 3.69 GiB  
+
[    1.797269] renesas_sdhi_internal_dmac ee160000.sd: Got WP GPIO
[   34.491549mmcblk0: p1
+
...
 +
[    1.933007] renesas_sdhi_internal_dmac ee160000.sd: mmc2 base at 0xee160000 max clock rate 200 MHz
 +
[   2.080957] mmc1: new ultra high speed SDR50 SDHC card at address e624
 +
[    2.087962] mmcblk1: mmc1:e624 SU08G 7.40 GiB
 +
[    2.103240]  mmcblk1: p1
 +
[    2.188956] mmc2: new ultra high speed SDR50 SDHC card at address 0001
 +
[   2.195833] mmcblk2: mmc2:0001 00000 29.8 GiB  
 +
[   2.209999mmcblk2: p1
 
</pre>
 
</pre>
 +
 +
"renesas_sdhi_internal_dmac" indicates that the variant of the SDHI driver added in the topic branch is in use.
  
 
== Hardware Environment ==
 
== Hardware Environment ==
* Board/Soc: Salvator-X/r8a7795 (Gen 3 R-Car H3 SoC)
+
* Board/Soc: Salvator-X/r8a7796 (Gen 3 R-Car M3-W ES1.0 SoC)
* MMC Card: SanDisk Card: SanDisk Ultra class 6 30MB/s 4GB marked with SD HC I
+
* MMC Cards:
 +
** Card 1:
 +
*** Description: SanDisk Extreme Pro 8Gb microSDHC UHS-1
 +
*** Product number: SDSDQXP-008G-X46
 +
*** CID: 035344535530384780b1b8a11200d300
 +
** Card 2:
 +
*** Description: Samsung Pro+ 32Gb SD UHS-1
 +
*** Product number: MB-SD32D/EU
 +
*** CID: 1b534d3030303030103916141700f600
 +
 
 +
== Indicative Speed with DMA ==
 +
 
 +
The following results were obtained using topic/sdhi-gen3-dma-2017-v3
 +
 
 +
Card 1:
 +
<pre>
 +
# dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct
 +
512+0 records in
 +
512+0 records out
 +
536870912 bytes (537 MB) copied, 13.4726 s, 39.8 MB/s
 +
# dd if=/dev/urandom of=/dev/mmcblk1 bs=1M count=512 oflag=direct
 +
512+0 records in
 +
512+0 records out
 +
536870912 bytes (537 MB) copied, 25.1835 s, 21.3 MB/s
 +
# dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=512 oflag=direct
 +
512+0 records in
 +
512+0 records out
 +
536870912 bytes (537 MB) copied, 20.9813 s, 25.6 MB/s
 +
</pre>
 +
 
 +
Card 2:
 +
<pre>
 +
# dd if=/dev/mmcblk2 of=/dev/null bs=1M count=512 iflag=direct
 +
512+0 records in
 +
512+0 records out
 +
536870912 bytes (537 MB) copied, 17.4752 s, 30.7 MB/s
 +
# dd if=/dev/urandom of=/dev/mmcblk2 bs=1M count=512 oflag=direct
 +
512+0 records in
 +
512+0 records out
 +
536870912 bytes (537 MB) copied, 25.9727 s, 20.7 MB/s
 +
# dd if=/dev/zero of=/dev/mmcblk2 bs=1M count=512 oflag=direct
 +
512+0 records in
 +
512+0 records out
 +
536870912 bytes (537 MB) copied, 21.4667 s, 25.0 MB/s
 +
</pre>
 +
 
 +
== Indicative Speed without DMA ==
  
== Indicative Speed ==
+
The following results were obtained using the base commit of topic/sdhi-gen3-dma-2017-v3,
 +
2fe35968fecc ("mmc: renesas-sdhi: improve checkpatch cleanness").
  
 +
Card 1:
 
<pre>
 
<pre>
# dd if=/dev/mmcblk0 of=/dev/null bs=1M count=16
+
# dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct
16777216 bytes (17 MB, 16 MiB) copied, 3.53326 s, 4.7 MB/s
+
512+0 records in
 +
512+0 records out
 +
536870912 bytes (537 MB) copied, 56.9853 s, 9.4 MB/s
 +
# dd if=/dev/urandom of=/dev/mmcblk1 bs=1M count=512 oflag=direct
 +
512+0 records in
 +
512+0 records out
 +
536870912 bytes (537 MB) copied, 33.6495 s, 16.0 MB/s
 +
(run twice)
 +
# dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=512 oflag=direct
 +
512+0 records in
 +
512+0 records out
 +
536870912 bytes (537 MB) copied, 28.9672 s, 18.5 MB/s
 
</pre>
 
</pre>
  
The above result appears to indicate that DMA is not functioning as a speed closer to 30MB/s is expected.
+
Card 2:
Further investigation is in progress.
+
<pre>
 +
# dd if=/dev/mmcblk2 of=/dev/null bs=1M count=512 iflag=direct
 +
512+0 records in
 +
512+0 records out
 +
536870912 bytes (537 MB) copied, 56.6979 s, 9.5 MB/s
 +
# dd if=/dev/urandom of=/dev/mmcblk2 bs=1M count=512 oflag=direct
 +
512+0 records in
 +
512+0 records out
 +
536870912 bytes (537 MB) copied, 32.6627 s, 16.4 MB/s
 +
# dd if=/dev/zero of=/dev/mmcblk2 bs=1M count=512 oflag=direct
 +
512+0 records in
 +
512+0 records out
 +
536870912 bytes (537 MB) copied, 28.0254 s, 19.2 MB/s
 +
</pre>

Latest revision as of 23:49, 22 June 2017

This document describes how to test the DMA support for R-Car Gen-3 SoCs in the SDHI driver.

Kernel Version and Configuration

DMA support R-Car Gen3 SoCs for the SDHI driver is currently available in a topic branch:

git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git topic/sdhi-gen3-dma-2017-v3

For the tests described here the kernel was compiled with the arm64 defconfig.

It is critical that MMC_SDHI is enabled for this testing.

Hardware Environment

  • Board/Soc: Salvator-X/r8a7796 (Gen 3 R-Car M3-W ES1.0 SoC)
  • MMC Cards:
    • Card 1:
      • Description: SanDisk Extreme Pro 8Gb microSDHC UHS-1
      • Product ID: SDSDQXP-008G-X46
      • CID: 035344535530384780b1b8a11200d300
    • Card 2:
      • Description: Samsung Pro+ SDHC UHS-1
      • Product ID: MB-SD32D/EU
      • CID: 1b534d3030303030103916141700f600

Verifying SDHI Driver Initialisation

Verify that the driver initialised the sdhi cores as described in DT.

e.g.:

# dmesg | egrep '(sd|mmc)'
...
[    1.430237] renesas_sdhi_internal_dmac ee100000.sd: Got CD GPIO
[    1.436224] renesas_sdhi_internal_dmac ee100000.sd: Got WP GPIO
[    1.564915] renesas_sdhi_internal_dmac ee140000.sd: mmc0 base at 0xee140000 max clock rate 200 MHz
[    1.574277] renesas_sdhi_internal_dmac ee160000.sd: Got CD GPIO
[    1.580250] renesas_sdhi_internal_dmac ee160000.sd: Got WP GPIO
...
[    1.643641] renesas_sdhi_internal_dmac ee100000.sd: Got CD GPIO
[    1.649678] renesas_sdhi_internal_dmac ee100000.sd: Got WP GPIO
[    1.780987] renesas_sdhi_internal_dmac ee100000.sd: mmc1 base at 0xee100000 max clock rate 200 MHz
[    1.791301] renesas_sdhi_internal_dmac ee160000.sd: Got CD GPIO
[    1.797269] renesas_sdhi_internal_dmac ee160000.sd: Got WP GPIO
...
[    1.933007] renesas_sdhi_internal_dmac ee160000.sd: mmc2 base at 0xee160000 max clock rate 200 MHz
[    2.080957] mmc1: new ultra high speed SDR50 SDHC card at address e624
[    2.087962] mmcblk1: mmc1:e624 SU08G 7.40 GiB 
[    2.103240]  mmcblk1: p1
[    2.188956] mmc2: new ultra high speed SDR50 SDHC card at address 0001
[    2.195833] mmcblk2: mmc2:0001 00000 29.8 GiB 
[    2.209999]  mmcblk2: p1

"renesas_sdhi_internal_dmac" indicates that the variant of the SDHI driver added in the topic branch is in use.

Hardware Environment

  • Board/Soc: Salvator-X/r8a7796 (Gen 3 R-Car M3-W ES1.0 SoC)
  • MMC Cards:
    • Card 1:
      • Description: SanDisk Extreme Pro 8Gb microSDHC UHS-1
      • Product number: SDSDQXP-008G-X46
      • CID: 035344535530384780b1b8a11200d300
    • Card 2:
      • Description: Samsung Pro+ 32Gb SD UHS-1
      • Product number: MB-SD32D/EU
      • CID: 1b534d3030303030103916141700f600

Indicative Speed with DMA

The following results were obtained using topic/sdhi-gen3-dma-2017-v3

Card 1:

# dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 13.4726 s, 39.8 MB/s
# dd if=/dev/urandom of=/dev/mmcblk1 bs=1M count=512 oflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 25.1835 s, 21.3 MB/s
# dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=512 oflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 20.9813 s, 25.6 MB/s

Card 2:

# dd if=/dev/mmcblk2 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 17.4752 s, 30.7 MB/s
# dd if=/dev/urandom of=/dev/mmcblk2 bs=1M count=512 oflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 25.9727 s, 20.7 MB/s
# dd if=/dev/zero of=/dev/mmcblk2 bs=1M count=512 oflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 21.4667 s, 25.0 MB/s

Indicative Speed without DMA

The following results were obtained using the base commit of topic/sdhi-gen3-dma-2017-v3, 2fe35968fecc ("mmc: renesas-sdhi: improve checkpatch cleanness").

Card 1:

# dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 56.9853 s, 9.4 MB/s
# dd if=/dev/urandom of=/dev/mmcblk1 bs=1M count=512 oflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 33.6495 s, 16.0 MB/s
(run twice)
# dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=512 oflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 28.9672 s, 18.5 MB/s

Card 2:

# dd if=/dev/mmcblk2 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 56.6979 s, 9.5 MB/s
# dd if=/dev/urandom of=/dev/mmcblk2 bs=1M count=512 oflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 32.6627 s, 16.4 MB/s
# dd if=/dev/zero of=/dev/mmcblk2 bs=1M count=512 oflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 28.0254 s, 19.2 MB/s