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

= Indicative Speed =

Tests run using the following "basic test procedure" unless noted otherwise:
 * Kernel source: git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git topic/sdr104-v7
 * Cards inserted into SDHI0 slot
 * SDR50 was tested by removing sd-sdr104 property from sdhi0 DT node
 * High Speed was tested by removing sd-uhs-sdr104 and sd-uhs-sdr50 properties from sdhi0 DT node.
 * Tests run using dd to transfer 512Mb as per the following example:

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

r8a7795/Salvator-X
Tests were run both with and without DMA enabled. This is because without DMA transfer speeds are quite low, however, DMA support for R-Car Gen-3 SDHI is not present in mainline.

The "without DMA" tests were run as per the "basic test procedure" described earlier.

The "with DMA" tests were run with the following modification to that procedure:
 * git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git topic/sdr104-v7+sdhi-dma-v3

The topic/sdr104-v7+sdhi-dma-v3 is a merge of the topic/sdr104-v7 branch with prototype R-Car Gen-3 SDHI DMA support| (rebased).

r8a7796/Salvator-X
Tests were run both with and without DMA enabled. The motivation for this and branches used are described in the tests for the r8a7795/Salvator-X.

The for all tests both with and without DMA enabled the following test procedure was used: The transfer speed was then calculated as 512*1024*1024/1000000/real e.g. 512Mb*1024*1024/1000000/71.25s = 7.5Mb/s. 512+0 records in 512+0 records out real   1m 11.25s user   0m 0.01s sys    1m 10.14s
 * SanDisk Card 3 was used in SDHI0 and SanDisk Card 4 was used in SDHI1.
 * Tests run using dd to transfer 512Mb as per the following example.
 * 1) time dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512

The motivation for the above modifications were to the test procedure was the environment available for testing. A comparison of the results of trasnfer speed methodology was made on the r8a7790/Lager board where results between the method in the "basic test procedure" and the one described immediately above appeared to give results that only differed by a small value that appeared to be noise in the results.