Tests:eMMC-fixed-drive-strength

From eLinux.org
Revision as of 03:11, 14 September 2017 by W sang (talk | contribs) (first very early draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

!DRAFT! This document describes how to test that setting a fixed drive strength for eMMC works properly.

Setup

Kernel Version and Configuration

Support for this feature is expected to land upstream in v4.15. It is currently available in a topic branch:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/topic/emmc-drive-strength

It is critical that CONFIG_MMC_SDHI and CONFIG_MMC_DEBUG is enabled for these tests. All debug messages examined in this test are automatically created during boot. There is no need to trigger the messages by some event.

Hardware Environment

  • Salvator-XS/r8a7795 (R-Car H3 ES2.0 SoC) with on-board eMMC.

Testing

Testing upstream kernel *without* this topic branch

First, the behaviour of an unmodified kernel is examined. From the bootlog, look for any output starting with mmc0: req done (CMD18):.

mmc1: req done (CMD18): 0: 00000900 00000900 00000b00 00000900
mmc1:     4096 bytes transferred: 0
mmc1:     (CMD12): 0: 00000000 00000000 00000000 00000000

On the last line, you can see which suitable stop command for this transfer was provided by the MMC core (CMD12). It's response registers are reported back to the MMC core to be all 0. This is not correctly filled since at least the CURRENT_STATE bits of a R1 command will be non-0.

Testing upstream kernel with this topic branch

The bootlog output now looks like this:

mmc1: req done (CMD18): 0: 00000900 00000900 00000b00 00000900
mmc1:     4096 bytes transferred: 0
mmc1:     (CMD12): 0: 00000b00 00000000 00000000 00000000

We can see now on the last line, that a proper value was reported back to the MMC core. The value 0x00000b00 means the card is in DATA state and is ready for new data.