mmc: fix dest address

After reading data from mmc, dest pointer will point to
the end address. To calculate the start of dest pointer
number of bytes copied has to be subtracted.

Signed-off-by: Rajkumar Ayyasamy <arajkuma@codeaurora.org>
Change-Id: I24610a3b3bb498c4ee4ebba58e557d109c6af1ef
This commit is contained in:
Rajkumar Ayyasamy 2020-09-04 14:47:54 +05:30 committed by Gerrit - the friendly Code Review server
parent 8f22bd73ef
commit 76d4b7de87

View file

@ -272,7 +272,8 @@ static ulong mmc_bread(int dev_num, lbaint_t start, lbaint_t blkcnt, void *dst)
dst += cur * mmc->read_bl_len;
} while (blocks_todo > 0);
#if !defined(CONFIG_SYS_DCACHE_OFF)
flush_cache((unsigned long)dst, blkcnt * mmc->read_bl_len);
flush_cache((unsigned long)dst - ( blkcnt * mmc->read_bl_len),
blkcnt * mmc->read_bl_len);
#endif
return blkcnt;