linux/drivers/mmc/host
Arindam Nath b513ea250e mmc: sd: add support for tuning during uhs initialization
Host Controller needs tuning during initialization to operate SDR50
and SDR104 UHS-I cards. Whether SDR50 mode actually needs tuning is
indicated by bit 45 of the Host Controller Capabilities register.
A new command CMD19 has been defined in the Physical Layer spec
v3.01 to request the card to send tuning pattern.

We enable Buffer Read Ready interrupt at the very begining of tuning
procedure, because that is the only interrupt generated by the Host
Controller during tuning. We program the block size to 64 in the
Block Size register. We make sure that DMA Enable and Multi Block
Select in the Transfer Mode register are set to 0 before actually
sending CMD19. The tuning block is sent by the card to the Host
Controller using DAT lines, so we set Data Present Select (bit 5) in
the Command register. The Host Controller is responsible for doing
the verfication of tuning block sent by the card at the hardware
level. After sending CMD19, we wait for Buffer Read Ready interrupt.
In case we don't receive an interrupt after the specified timeout
value, we fall back on fixed sampling clock by setting Execute
Tuning (bit 6) and Sampling Clock Select (bit 7) of Host Control2
register to 0. Before exiting the tuning procedure, we disable Buffer
Read Ready interrupt and re-enable other interrupts.

Tested by Zhangfei Gao with a Toshiba uhs card and general hs card,
on mmp2 in SDMA mode.

Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Reviewed-by: Philip Rakity <prakity@marvell.com>
Tested-by: Philip Rakity <prakity@marvell.com>
Acked-by: Zhangfei Gao <zhangfei.gao@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-05-24 23:53:46 -04:00
..
at91_mci.c mmc: at91_mci: fix multiblock SDIO transfers 2010-12-21 11:46:32 -08:00
atmel-mci-regs.h atmel-mci: add MCI2 register definitions 2009-06-13 22:43:01 +02:00
atmel-mci.c Fix common misspellings 2011-03-31 11:26:23 -03:00
au1xmmc.c tree-wide: fix comment/printk typos 2010-11-01 15:38:34 -04:00
bfin_sdh.c mmc: bfin_sdh: fix alloc size for private data 2011-01-26 00:28:41 -05:00
cb710-mmc.c mmc: cb710: Return err value in cb710_wait_while_busy() 2011-03-15 13:49:42 -04:00
cb710-mmc.h mmc: Driver for CB710/720 memory card reader (MMC part) 2009-06-13 22:42:58 +02:00
davinci_mmc.c mmc: davinci: add support for SDIO irq handling 2011-01-09 19:16:18 -05:00
dw_mmc.c mmc: dw_mmc: set fixed burst in BMOD register 2011-03-25 10:30:49 -04:00
dw_mmc.h mmc: dw_mmc: support DDR mode 2011-03-15 13:51:47 -04:00
imxmmc.c mmc: Remove distinction between hw and phys segments 2010-10-23 21:11:11 +08:00
imxmmc.h imxmmc: use readl/writel 2008-12-16 14:58:17 +01:00
jz4740_mmc.c mmc: jz4740: don't treat NULL clk as an error 2011-01-25 21:53:51 -05:00
Kconfig mmc: sdhci: change CONFIG of MMC_SDHCI_TEGRA from 'tristate' to 'bool' 2011-05-24 20:59:34 -04:00
Makefile mmc: tmio: convert the SDHI MMC driver from MFD to a platform driver 2011-03-25 10:39:23 -04:00
mmc_spi.c Fix common misspellings 2011-03-31 11:26:23 -03:00
mmci.c mmc: mmci: Add ARM variant with extended FIFO 2011-03-25 10:30:49 -04:00
mmci.h ARM: mmci: add dmaengine-based DMA support 2011-02-04 13:25:49 +00:00
msm_sdcc.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc 2011-03-18 22:32:40 -07:00
msm_sdcc.h mmc: msm_sdcc: Add gpio handling function to driver 2011-01-21 16:58:00 -08:00
mvsdio.c mmc: Remove distinction between hw and phys segments 2010-10-23 21:11:11 +08:00
mvsdio.h mmc: SDIO driver for Marvell SoCs 2009-03-24 21:30:03 +01:00
mxcmmc.c mmc: mxcmmc: use dmaengine API 2011-03-15 13:49:32 -04:00
mxs-mmc.c mmc: mxs-mmc: add mmc host driver for i.MX23/28 2011-03-15 13:49:37 -04:00
of_mmc_spi.c mmc: of_mmc_spi: Need to include irq.h and of_irq.h 2011-03-25 10:30:49 -04:00
omap_hsmmc.c drivers/mmc/host/omap_hsmmc.c: use resource_size() 2011-03-22 17:44:15 -07:00
omap.c mmc: omap: Fix possible NULL pointer deref 2011-04-27 19:15:12 -04:00
pxamci.c mmc: Move regulator handling closer to core 2010-10-23 21:11:16 +08:00
pxamci.h [ARM] pxa: mmc: add 1st host controller support for pxa3xx 2008-01-26 15:07:53 +00:00
s3cmci.c Fix common misspellings 2011-03-31 11:26:23 -03:00
s3cmci.h s3cmci: DMA fixes 2009-10-01 16:11:15 -07:00
sdhci-cns3xxx.c mmc: sdhci-pltfm: move .h file into appropriate subdir 2010-10-23 21:11:21 +08:00
sdhci-dove.c mmc: Add support for the Marvell Dove SDHCI controller 2011-01-08 21:48:48 -05:00
sdhci-esdhc-imx.c mmc: sdhci-esdhc: enable esdhc on imx53 2011-03-25 10:30:50 -04:00
sdhci-esdhc.h mmc: sdhci-esdhc: remove SDHCI_QUIRK_NO_CARD_NO_RESET from esdhc 2011-03-25 10:30:49 -04:00
sdhci-of-core.c dt: Eliminate of_platform_{,un}register_driver 2011-02-28 13:22:46 -07:00
sdhci-of-esdhc.c mmc: sdhci-esdhc: remove SDHCI_QUIRK_NO_CARD_NO_RESET from esdhc 2011-03-25 10:30:49 -04:00
sdhci-of-hlwd.c sdhci: build fix: rename SDHCI I/O accessor functions 2010-05-27 09:12:40 -07:00
sdhci-of.h sdhci-of: add support for the wii sdhci controller 2009-12-17 15:45:32 -08:00
sdhci-pci.c mmc: sdhci: Fix read-only detection with JMicron 388 chip 2011-05-24 21:02:42 -04:00
sdhci-pltfm.c mmc: add sdhci-tegra driver for Tegra SoCs 2011-01-08 23:52:23 -05:00
sdhci-pltfm.h mmc: sdhci-esdhc: use writel/readl as general APIs 2011-03-25 10:30:50 -04:00
sdhci-pxa.c mmc: sdhci: 8-bit bus width changes 2010-11-22 15:12:04 -05:00
sdhci-s3c.c mmc: sdhci-s3c: Auto CMD12 support 2011-03-15 13:48:25 -04:00
sdhci-spear.c drivers: Final irq namespace conversion 2011-03-29 14:48:19 +02:00
sdhci-tegra.c mmc: tegra: add pm_flags 2011-05-24 20:59:30 -04:00
sdhci.c mmc: sd: add support for tuning during uhs initialization 2011-05-24 23:53:46 -04:00
sdhci.h mmc: sd: add support for tuning during uhs initialization 2011-05-24 23:53:46 -04:00
sdricoh_cs.c tree-wide: fix comment/printk typos 2010-11-01 15:38:34 -04:00
sh_mmcif.c mmc: sh_mmcif: support aggressive clock gating 2011-03-16 12:30:25 -04:00
sh_mobile_sdhi.c mmc: tmio: convert the SDHI MMC driver from MFD to a platform driver 2011-03-25 10:39:23 -04:00
tifm_sd.c mmc: Remove distinction between hw and phys segments 2010-10-23 21:11:11 +08:00
tmio_mmc_dma.c mmc: tmio_mmc: Move some defines into a shared header 2011-03-26 15:58:50 -04:00
tmio_mmc_pio.c mmc: tmio: fix .set_ios(MMC_POWER_UP) handling 2011-04-27 19:16:29 -04:00
tmio_mmc.c mmc: tmio: split core functionality, DMA and MFD glue 2011-03-25 10:39:11 -04:00
tmio_mmc.h mmc: tmio_mmc: Move some defines into a shared header 2011-03-26 15:58:50 -04:00
ushc.c mmc: ushc: Remove duplicate include of usb.h 2011-01-25 21:53:43 -05:00
via-sdmmc.c mmc: use pci_dev->revision 2011-03-25 10:30:49 -04:00
wbsd.c Fix common misspellings 2011-03-31 11:26:23 -03:00
wbsd.h