diff options
author | Peng Fan <Peng.Fan@freescale.com> | 2015-07-21 16:15:21 +0800 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2015-08-25 22:53:59 -0500 |
commit | ecfb8768b16ebf6781ee0df45742674bda8a9543 (patch) | |
tree | 08ccaaa3bb470b0f6cc21c7b7f73d7e14cf82f9e /drivers | |
parent | 63b29d80823be9ce7763cadc115012d0fba69700 (diff) | |
download | u-boot-imx-ecfb8768b16ebf6781ee0df45742674bda8a9543.zip u-boot-imx-ecfb8768b16ebf6781ee0df45742674bda8a9543.tar.gz u-boot-imx-ecfb8768b16ebf6781ee0df45742674bda8a9543.tar.bz2 |
mtd: nand: mxs invalidate dcache before DMA read
Follow linux dma flow:
Before DMA read, be sure to invalidate the cache over the address
range of DMA buffer to prevent cache coherency problems.
After DMA read, invalidate dcache again.
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/mxs_nand.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c index 33ce817..1d68901 100644 --- a/drivers/mtd/nand/mxs_nand.c +++ b/drivers/mtd/nand/mxs_nand.c @@ -462,6 +462,9 @@ static void mxs_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int length) mxs_dma_desc_append(channel, d); + /* Invalidate caches */ + mxs_nand_inval_data_buf(nand_info); + /* Execute the DMA chain. */ ret = mxs_dma_go(channel); if (ret) { @@ -628,6 +631,9 @@ static int mxs_nand_ecc_read_page(struct mtd_info *mtd, struct nand_chip *nand, mxs_dma_desc_append(channel, d); + /* Invalidate caches */ + mxs_nand_inval_data_buf(nand_info); + /* Execute the DMA chain. */ ret = mxs_dma_go(channel); if (ret) { |