All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Add enhanced strobe support for emmc version 5.1 or later
@ 2016-04-29  2:42 ` Shawn Lin
  0 siblings, 0 replies; 30+ messages in thread
From: Shawn Lin @ 2016-04-29  2:42 UTC (permalink / raw)
  To: Adrian Hunter, Ulf Hansson
  Cc: Jaehoon Chung, Michal Simek, soren.brinkmann, Rob Herring,
	linux-mmc, linux-kernel, Doug Anderson, Heiko Stuebner,
	linux-rockchip, devicetree, Shawn Lin


Hello Ulf and Adrian,

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

Enchanced strobe is a optional function, so we add a new cap* for drivers to
decide whether to use it.

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 data-read. This feature is optional.

>From the spec(section 6.6.2.3), the standard scenario to select HS400 enhanced
strobe mode illustrated like this:
(1) set HS_TIMIMG (Highspeed)
(2) Host change freq to <= 52Mhz
(3) set the bus width to Enhanced strobe and DDR8Bit(CMD6), EXT_CSD[183] = 0x86
instead of 0x80
(4) set HS_TIMING to 0x3 (HS400)
(5) Host change freq to <= 200Mhz
(6) Host select HS400 enhanced strobe complete

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

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.

If we are sure that our controller supports enhanced strobe mode, just add
mmc-hs400-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. Currently I just limit the callback within ths scope of arasan,sdhci-5.1,
but I prone to believe arasan will use VENDOR_REGISTER to tirgger this mode from now on
because I do believe vendor will consider the registers' compatibility.

With this patchset applied, we can successfully run in HS400 enhanced strobe mode on
RK3399 platform with Samsung eMMC KLMBG2JENB-B041(v5.1, 16GB).

mmc1: new HS400 Enhanced strobe MMC card at address 0001
mmcblk0: mmc1:0001 AJNB4R 14.6 GiB
mmcblk0boot0: mmc1:0001 AJNB4R partition 1 4.00 MiB
mmcblk0boot1: mmc1:0001 AJNB4R partition 2 4.00 MiB
mmcblk0rpmb: mmc1:0001 AJNB4R partition 3 4.00 MiB


Changes in v2:
- switch to HS400ES from Highspeed mode directly

Shawn Lin (6):
  Documentation: mmc: add mmc-hs400-enhanced-strobe
  mmc: core: add mmc-hs400-enhanced-strobe support
  mmc: core: implement enhanced strobe support
  mmc: debugfs: add HS400 enhanced strobe description
  mmc: sdhci: implement enhanced strobe callback
  mmc: sdhci-of-arasan: overwrite enhanced strobe callback

 Documentation/devicetree/bindings/mmc/mmc.txt |  1 +
 drivers/mmc/core/bus.c                        |  3 +-
 drivers/mmc/core/debugfs.c                    |  4 +-
 drivers/mmc/core/host.c                       |  2 +
 drivers/mmc/core/mmc.c                        | 77 ++++++++++++++++++++++++---
 drivers/mmc/host/sdhci-of-arasan.c            | 22 ++++++++
 drivers/mmc/host/sdhci.c                      | 11 ++++
 include/linux/mmc/card.h                      |  1 +
 include/linux/mmc/host.h                      | 18 +++++++
 include/linux/mmc/mmc.h                       |  3 ++
 10 files changed, 134 insertions(+), 8 deletions(-)

-- 
2.3.7

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2016-05-10  8:37 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-29  2:42 [PATCH v2 0/6] Add enhanced strobe support for emmc version 5.1 or later Shawn Lin
2016-04-29  2:42 ` Shawn Lin
2016-04-29  2:42 ` Shawn Lin
2016-04-29  2:46 ` [PATCH v2 1/6] Documentation: mmc: add mmc-hs400-enhanced-strobe Shawn Lin
2016-04-29  2:46   ` Shawn Lin
2016-05-03 17:05   ` Rob Herring
2016-04-29  2:46 ` [PATCH v2 2/6] mmc: core: add mmc-hs400-enhanced-strobe support Shawn Lin
2016-05-04  8:12   ` Ulf Hansson
2016-05-04  9:19     ` Shawn Lin
2016-04-29  2:47 ` [PATCH v2 3/6] mmc: core: implement enhanced strobe support Shawn Lin
2016-04-29  2:47   ` Shawn Lin
2016-05-04 12:02   ` Ulf Hansson
2016-05-04 12:02     ` Ulf Hansson
2016-05-04 12:07     ` Adrian Hunter
2016-05-04 12:07       ` Adrian Hunter
2016-05-05  2:16     ` Shawn Lin
2016-05-05  2:16       ` Shawn Lin
2016-05-09 11:56   ` Adrian Hunter
2016-05-09 11:56     ` Adrian Hunter
2016-05-10  8:29     ` Shawn Lin
2016-05-10  8:29       ` Shawn Lin
2016-04-29  2:48 ` [PATCH v2 4/6] mmc: debugfs: add HS400 enhanced strobe description Shawn Lin
2016-05-09 12:00   ` Adrian Hunter
2016-05-09 12:00     ` Adrian Hunter
2016-04-29  2:48 ` [PATCH v2 5/6] mmc: sdhci: implement enhanced strobe callback Shawn Lin
2016-05-09 12:02   ` Adrian Hunter
2016-05-09 12:02     ` Adrian Hunter
2016-04-29  2:48 ` [PATCH v2 6/6] mmc: sdhci-of-arasan: overwrite " Shawn Lin
2016-04-29 16:01   ` Sören Brinkmann
2016-04-29 16:01     ` Sören Brinkmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.