[RFC PATCH 0/4] Add enhanced strobe support for emmc version 5.1 or later

From: Shawn Lin
Date: Wed Mar 02 2016 - 21:43:55 EST



Hello Ulf and Adrian,

This RFC patch is going to support enhanced strobe function
for emmc version 5.1+ introduced by JEDEC recently.

Firstlyïfrom the former discussion of sdhci, I write these code
inspired by Adrian's patch[0] for variant drivers to overwrite the
callback in order not to add new callback into sdhci. And enchanced
strobe is a optional function, so we add a new cap* for drivers to
decide whether to use it.

1. History
When introduing hs400 mode, JEDEC asks controllers to use data strobe line
to latch the data from emmc devives. But for cmd-reponse, not mentioned yet.
Since emmc version 5.1 published, JEDEC adds enhanced strobe function to deal
with cmd-response the same way as dara-read. This feature is optional.

2. Current situation
I can't find a upstreamed controller claimed to support it, as well as the
mmc stack. But my "arasan,sdhci-5.1" actially supports this function. So I decide
to work for this part.

3. About the code
1)This patchset is taken from Yi Sun's patch[1], but after reviewing the details
and applying to test, I find some problems. We ask devices to switch to enhanced
strobe mode, but we don't notify drivers to enable enhanced strobe mode. And we can't
force controller to use enhanced strobe even if devices claims to support it. So I
rework most of the code and take over the ownership from Yi Sun(If any objections
here, please let know).
2)By looking into the SDHCI spec, I find there isn't any registers to enable the
enhanced strobe function. But from my "arasan,sdhci-5.1" databook, it describes a
register called VENDOR_REGISTER(0x78) to trigger this mode. So I guess other sdhci
variant drivers may also need s vendor specific register to deal with it.

4. Howto
If we are sure that our controller supports enhanced strobe mode, just add
cap-enhanced-strobe in DT. Once emmc devices claims to support this mode,
we enable it automatically. Of course, other sdhci*/non-sdhci drivers should
implement/overwrite the prepare_enhanced_strobe by themselves. I believe all of the
platforms which need to support this mode should do some basic preparation for their
controllers.

Reference:
[0]: https://patchwork.kernel.org/patch/8262231/
[1]: https://patchwork.kernel.org/patch/6545421/



Shawn Lin (4):
mmc: core: add cap-enhanced-strobe support
mmc: core: implement enhanced strobe support
mmc: sdhci: implement enhanced strobe callback
mmc: sdhci-of-arasan: overwrite enhanced strobe callback

Documentation/devicetree/bindings/mmc/mmc.txt | 1 +
drivers/mmc/core/host.c | 2 +
drivers/mmc/core/mmc.c | 54 ++++++++++++++++++++++++++-
drivers/mmc/host/sdhci-of-arasan.c | 20 ++++++++++
drivers/mmc/host/sdhci.c | 11 ++++++
include/linux/mmc/card.h | 1 +
include/linux/mmc/host.h | 8 ++++
include/linux/mmc/mmc.h | 2 +
8 files changed, 98 insertions(+), 1 deletion(-)

--
2.3.7