From: xiaoyao Date: Wed, 18 Mar 2015 03:43:16 +0000 (+0800) Subject: rk_sdmmc: recalculate audib rx_wmark X-Git-Tag: firefly_0821_release~4255 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=77e142e21dfd6507f7d1f0464c12f9e5502e1f10;p=firefly-linux-kernel-4.4.55.git rk_sdmmc: recalculate audib rx_wmark AudiB contain a less limitation in rx_wmark. Signed-off-by: xiaoyao Signed-off-by: lintao --- diff --git a/drivers/mmc/host/rk_sdmmc.c b/drivers/mmc/host/rk_sdmmc.c index 227bc7efa9b2..e4488a8de558 100755 --- a/drivers/mmc/host/rk_sdmmc.c +++ b/drivers/mmc/host/rk_sdmmc.c @@ -620,6 +620,7 @@ static void dw_mci_edmac_start_dma(struct dw_mci *host, unsigned int sg_len) u32 sg_elems = host->data->sg_len; u32 fifoth_val, mburst; u32 burst_limit = 0; + u32 idx, rx_wmark, tx_wmark; int ret = 0; /* Set external dma config: burst size, burst width*/ @@ -640,9 +641,18 @@ static void dw_mci_edmac_start_dma(struct dw_mci *host, unsigned int sg_len) if (mburst > burst_limit) { mburst = burst_limit; - fifoth_val = SDMMC_SET_FIFOTH(ilog2(mburst) - 1, - (host->fifo_depth) / 2 - 1, - (host->fifo_depth) / 2); + idx = (ilog2(mburst) > 0) ? (ilog2(mburst) - 1) : 0; + + if (soc_is_rk3126b()) { + idx = 0; + rx_wmark = (host->fifo_depth) / 2 - 1; + } else { + rx_wmark = mszs[idx] - 1; + } + + tx_wmark = (host->fifo_depth) / 2; + fifoth_val = SDMMC_SET_FIFOTH(idx, rx_wmark, tx_wmark); + mci_writel(host, FIFOTH, fifoth_val); }