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*/
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);
}