Tests:SD-SDHI-SDR104

This document describes how to test the SDR104 functionality of the SDHI MMC driver.

Kernel Version and Configuration
SDR-104 support for the SDHI driver is currently available in a topic branch:

git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git topic/sdr104-v6

For the tests described here the kernel was compiled with the shmobile_defconfig. DEBUG_FS was also enabled.

It is critical that MMC_SDHI is enabled for this testing.

Hardware Environment

 * Boards/Socs
 * Lager/r8a7790 (Gen 2 R-Car H2 SoC)
 * Salvator-X/r8a7795 (Gen 3 R-Car H3 SoC)


 * MMC Cards:
 * SanDisk Card 1: SanDisk Ultra 64Gb microSDXC UHS-1. Identifier on Packaging: SDSQUNC-064G-GN6MA
 * SanDisk Card 2: SanDisk Extreme Pro 8Gb microSDHC UHS-1. Appears to be: SDSDQXP-008G-J35
 * Samsung Card 1: Samsung 32Gb microSDHC Card Class 10 UHS-1 U3. ModelCode: MB-MG32EA/FFP
 * Samsung Card 2: Samsung 32Gb microSDHC Card Class 10 UHS-1 U3. ModelCode: MB-MG32DA/FFP

Verify SDR-104 Support
The patches above enable SDR-104 for
 * SDHI0 slot of the Lager/r8a7790 board
 * SDHI0 and 3 slots of the Salvator-X/r8a7795 board

After inserting a card which supports SDR-104, for example one of the cards listed above, it should be possible to verify that SDR-104 support is enabled.

$ dmesg | grep SDR mmc1: new ultra high speed SDR104 SDHC card at address 0001

clock:         195000000 Hz vdd:            21 (3.3 ~ 3.4 V) bus mode:       2 (push-pull) chip select:   0 (don't care) power mode:    2 (on) bus width:     2 (4 bits) timing spec:   6 (sd uhs SDR104) signal voltage: 1 (1.80 V) driver type:   0 (driver type B)
 * 1) mount -t debugfs none /sys/kernel/debug
 * 2) cat /sys/kernel/debug/mmc1/ios

Lager/r8a7790
Sandisk Card 1: 536870912 bytes (537 MB) copied, 11.901 s, 45.1 MB/s
 * 1) dd bs=1M count=512 iflag=direct if=/dev/mmcblk1 of=/dev/null

Sandisk Card 2: 536870912 bytes (537 MB) copied, 11.1349 s, 48.2 MB/s
 * 1) dd bs=1M count=512 iflag=direct if=/dev/mmcblk1 of=/dev/null

Samsung Card 1: 536870912 bytes (537 MB) copied, 14.697 s, 36.5 MB/s
 * 1) dd bs=1M count=512 iflag=direct if=/dev/mmcblk1 of=/dev/null

Samsung Card 2: 536870912 bytes (537 MB) copied, 14.7366 s, 36.4 MB/s
 * 1) dd bs=1M count=512 iflag=direct if=/dev/mmcblk1 of=/dev/null

Salvator-X/r8a7795
Sandisk Card 1: 536870912 bytes (537 MB) copied, 89.4115 s, 6.0 MB/s
 * 1) dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct

Sandisk Card 2: 536870912 bytes (537 MB) copied, 89.5769 s, 6.0 MB/s
 * 1) dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512 iflag=direct

Salvator-X/r8a7795 (DMA)
The results for Salvator-X/r8a7795 somewhat slow due to the absence of DMA support. Below the tests are a re-run with Prototype Gen 3 R-Car SDHI DMA support rebased and merged with the SDR-104 topic branch described above.The resulting code is in the following branch:

git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git topic/sdr104-v6+sdhi-dma-v3

Sandisk Card 1: 536870912 bytes (537 MB) copied, 14.6187 s, 36.7 MB/s
 * 1) dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct

Sandisk Card 2: 536870912 bytes (537 MB) copied, 13.5069 s, 39.7 MB/s
 * 1) dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512 iflag=direct

Control
These tests are provided to indicate transfer speeds without SDR104 enabled to allow comparison with speeds with SDR104 enabled.

Here the test has been run using a kernel compiled using the topic/sdr104-v5 branch with the dtb modified so the sd-uhs-sdr104 property is absent.

In this test SDR50 is enabled but SDR104 is not.

$ dmesg | grep SDR mmc1: new ultra high speed SDR50 SDHC card at address 0001

clock:         100000000 Hz vdd:            21 (3.3 ~ 3.4 V) bus mode:       2 (push-pull) chip select:   0 (don't care) power mode:    2 (on) bus width:     2 (4 bits) timing spec:   5 (sd uhs SDR50) signal voltage: 1 (1.80 V) driver type:   0 (driver type B)
 * 1) mount -t debugfs none /sys/kernel/debug
 * 2) cat /sys/kernel/debug/mmc1/ios

Lager/r8a7790
Sandisk Card 1: 536870912 bytes (537 MB) copied, 17.7253 s, 30.3 MB/s
 * 1) dd bs=1M count=512 iflag=direct if=/dev/mmcblk1 of=/dev/null

Sandisk Card 2: 536870912 bytes (537 MB) copied, 15.6158 s, 34.4 MB/s
 * 1) dd bs=1M count=512 iflag=direct if=/dev/mmcblk1 of=/dev/null

Samsung Card 1: 536870912 bytes (537 MB) copied, 20.7866 s, 25.8 MB/s
 * 1) dd bs=1M count=512 iflag=direct if=/dev/mmcblk1 of=/dev/null

Samsung Card 2: 536870912 bytes (537 MB) copied, 19.3648 s, 27.7 MB/s
 * 1) dd bs=1M count=512 iflag=direct if=/dev/mmcblk1 of=/dev/null

Salvator-X/r8a7795
Sandisk Card 1: 536870912 bytes (537 MB) copied, 101.898 s, 5.3 MB/s
 * 1) dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct

Sandisk Card 2: 536870912 bytes (537 MB) copied, 102.082 s, 5.3 MB/s
 * 1) dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512 iflag=direct

Salvator-X/r8a7795 (DMA)
Again, test run with DMA enabled.

Here the topic/sdr104-v5+sdhi-dma-v3 branch is used with sd-uhs-sdr104 properties removed.

Sandisk Card 1: 536870912 bytes (537 MB) copied, 25.0257 s, 21.5 MB/s
 * 1) dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct

Sandisk Card 2: 536870912 bytes (537 MB) copied, 24.6166 s, 21.8 MB/s
 * 1) dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512 iflag=direct