Tests:r-car-gen3-sdhi-dma

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.: ... [   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
 * 1) dmesg | egrep '(sd|mmc)'

"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: 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 13.4726 s, 39.8 MB/s 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 25.1835 s, 21.3 MB/s 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 20.9813 s, 25.6 MB/s
 * 1) dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct
 * 1) dd if=/dev/urandom of=/dev/mmcblk1 bs=1M count=512 oflag=direct
 * 1) dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=512 oflag=direct

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

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: 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 56.9853 s, 9.4 MB/s 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 33.6495 s, 16.0 MB/s (run twice) 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 28.9672 s, 18.5 MB/s
 * 1) dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct
 * 1) dd if=/dev/urandom of=/dev/mmcblk1 bs=1M count=512 oflag=direct
 * 1) dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=512 oflag=direct

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