feat(nxp-mmc): flush and invalidate buffers

When the uSDHC driver is used with enabled caches on the core setting
the transfer, the caches associated with the memory region used for data
transfer must be invalidated before reading from the buffer and flushed
before the buffer is passed to the controller.

Change-Id: I8213f120b655146772306ef57ee8204596fb05e9
Signed-off-by: Larisa Grigore <larisa.grigore@nxp.com>
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
diff --git a/drivers/imx/usdhc/imx_usdhc.c b/drivers/imx/usdhc/imx_usdhc.c
index dd99734..7b5c072 100644
--- a/drivers/imx/usdhc/imx_usdhc.c
+++ b/drivers/imx/usdhc/imx_usdhc.c
@@ -375,11 +375,13 @@
 
 static int imx_usdhc_prepare(int lba, uintptr_t buf, size_t size)
 {
+	flush_dcache_range(buf, size);
 	return imx_usdhc_save_buf_data(buf, size);
 }
 
 static int imx_usdhc_read(int lba, uintptr_t buf, size_t size)
 {
+	inv_dcache_range(buf, size);
 	return 0;
 }