MLK-16354-1 mmc: sdhci: add usdhc support for IOMMU
authorHaibo Chen <haibo.chen@nxp.com>
Fri, 1 Sep 2017 09:05:26 +0000 (17:05 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:38:30 +0000 (15:38 -0500)
commitad29c793d32a1d5597f481c9338a7497d273213e
tree4788e3b1db85c253de97b05efc0a6951785bd90e
parentd3cef6422aa0bc98d13db2b8be5ed948033e6a6c
MLK-16354-1 mmc: sdhci: add usdhc support for IOMMU

The default max segment size of IOMMU is 64KB, which exceed the ADMA
limitation. ADMA only support max to 65535, 64KB - 1Byte. IOMMU will
optimize the segments it received, merge the little segment into one
big segment. If we use the default IOMMU config, then ADMA will get
some segments which it's size is 64KB. Then ADMA error will shows up.

Currently, when use standard tuning, driver default disable DMA. But
on i.MX usdhc, this is not enough. Need also clear DMA_SEL. If not,
once the DMA_SEL select AMDA2, even dma already disabled, when send
tuning command, usdhc will still prefetch the ADMA script from wrong
DMA address, then we will see IOMMU report some error which show
lack of TLB mapping.

This patch fix these two issue, make sure usdhc can work well by
operate data through IOMMU.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
drivers/mmc/host/sdhci.c