summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>2014-03-21 16:57:47 +0400
committerTom Rini <trini@ti.com>2014-03-28 15:06:30 -0400
commit17b0da801910b2791cf67817735a3367615922e6 (patch)
tree980ceceb167839653780e2b2ff31283734970145 /board
parenta7b26dbb49139535992c6d4c282bcf258b3f7fa3 (diff)
downloadu-boot-imx-17b0da801910b2791cf67817735a3367615922e6.zip
u-boot-imx-17b0da801910b2791cf67817735a3367615922e6.tar.gz
u-boot-imx-17b0da801910b2791cf67817735a3367615922e6.tar.bz2
axs101: flush DMA buffer descriptors before DMA transactons starts
CPU sets DMA buffer descriptors with data required for inetrnal DMA such as: * Ownership of BD * Buffer size * Pointer to data buffer in memory Then we need to make sure DMA engine of NAND controller gets proper data. For this we flush buffer rescriptor. Then we're ready for DMA transaction. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Tom Rini <trini@ti.com>
Diffstat (limited to 'board')
-rw-r--r--board/synopsys/axs101/nand.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/board/synopsys/axs101/nand.c b/board/synopsys/axs101/nand.c
index 8672803..c7f90c4 100644
--- a/board/synopsys/axs101/nand.c
+++ b/board/synopsys/axs101/nand.c
@@ -107,6 +107,10 @@ static void axs101_nand_write_buf(struct mtd_info *mtd, const u_char *buf,
writel(bbstate.bounce_buffer, &bd->buffer_ptr0);
writel(0, &bd->buffer_ptr1);
+ /* Flush modified buffer descriptor */
+ flush_dcache_range((unsigned long)bd,
+ (unsigned long)bd + sizeof(struct nand_bd));
+
/* Issue "write" command */
NAND_REG_WRITE(AC_FIFO, B_CT_WRITE | B_WFR | B_IWC | B_LC | (len-1));
@@ -137,6 +141,10 @@ static void axs101_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
writel(bbstate.bounce_buffer, &bd->buffer_ptr0);
writel(0, &bd->buffer_ptr1);
+ /* Flush modified buffer descriptor */
+ flush_dcache_range((unsigned long)bd,
+ (unsigned long)bd + sizeof(struct nand_bd));
+
/* Issue "read" command */
NAND_REG_WRITE(AC_FIFO, B_CT_READ | B_WFR | B_IWC | B_LC | (len - 1));