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

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.423990] renesas_sdhi_internal_dmac ee100000.sd: Got CD GPIO [   1.429951] renesas_sdhi_internal_dmac ee100000.sd: Got WP GPIO [   1.560503] renesas_sdhi_internal_dmac ee140000.sd: mmc0 base at 0xee140000 max clock rate 200 MHz [   1.569871] renesas_sdhi_internal_dmac ee160000.sd: Got CD GPIO [   1.575846] renesas_sdhi_internal_dmac ee160000.sd: Got WP GPIO ... [   1.638687] renesas_sdhi_internal_dmac ee100000.sd: Got CD GPIO [   1.644661] renesas_sdhi_internal_dmac ee100000.sd: Got WP GPIO [   1.772556] renesas_sdhi_internal_dmac ee100000.sd: mmc1 base at 0xee100000 max clock rate 200 MHz [   1.782613] renesas_sdhi_internal_dmac ee160000.sd: Got CD GPIO [   1.788580] renesas_sdhi_internal_dmac ee160000.sd: Got WP GPIO ... [   1.916589] renesas_sdhi_internal_dmac ee160000.sd: mmc2 base at 0xee160000 max clock rate 200 MHz [   2.060534] mmc1: new ultra high speed SDR50 SDHC card at address e624 [   2.071600] mmcblk1: mmc1:e624 SU08G 7.40 GiB [   2.086875]  mmcblk1: p1 [    2.260532] mmc2: new ultra high speed SDR50 SDHC card at address 0001 [   2.267407] mmcblk2: mmc2:0001 00000 29.8 GiB [   2.281572]  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.

Card 1: 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 13.5376 s, 39.7 MB/s
 * 1) dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct

Card 2: 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 17.5562 s, 30.6 MB/s
 * 1) dd if=/dev/mmcblk2 of=/dev/null bs=1M count=512 iflag=direct

Indicative Speed without DMA
The following results were obtained using the base commit of topic/sdhi-gen3-dma-2017, 6e75316c15df ("mmc: tmio: make sure SDIO gets reinitialized after resume").

Card 1: 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 56.6648 s, 9.5 MB/s
 * 1) dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct

Card 2: 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 56.7809 s, 9.5 MB/s
 * 1) dd if=/dev/mmcblk2 of=/dev/null bs=1M count=512 iflag=direct