Skip to content

Commit ef347c0

Browse files
saschahauermiquelraynal
authored andcommitted
mtd: rawnand: gpmi: Implement exec_op
The gpmi driver performance suffers from NAND operations being split in multiple small DMA transfers. This has been forced by the NAND layer in the former days, but now with exec_op we can use the controller as intended. With this patch gpmi_nfc_exec_op becomes the main entry point to NAND operations. Here all instructions are collected and chained as separate DMA transfers. In the end whole chain is fired and waited to be finished. gpmi_nfc_exec_op only does the hardware operations, bad block marker swapping and buffer scrambling is done by the callers. It's worth noting that the nand_*_op functions always take the buffer lengths for the data that the NAND chip actually transfers. When doing BCH we have to calculate the net data size from the raw data size in some places. This patch has been tested with 2048/64 and 2048/128 byte NAND on i.MX6q. mtd_oobtest, mtd_subpagetest and mtd_speedtest run without errors. nandbiterrs, nandpagetest and nandsubpagetest userspace tests from mtdutils run without errors and UBIFS can successfully be mounted. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
1 parent ceeeb99 commit ef347c0

4 files changed

Lines changed: 444 additions & 690 deletions

File tree

‎drivers/dma/mxs-dma.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
#define BM_CCW_COMMAND (3 << 0)
7979
#define CCW_CHAIN (1 << 2)
8080
#define CCW_IRQ (1 << 3)
81+
#define CCW_WAIT4RDY (1 << 5)
8182
#define CCW_DEC_SEM (1 << 6)
8283
#define CCW_WAIT4END (1 << 7)
8384
#define CCW_HALT_ON_TERM (1 << 8)
@@ -547,6 +548,8 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
547548
ccw->bits |= CCW_TERM_FLUSH;
548549
ccw->bits |= BF_CCW(sg_len, PIO_NUM);
549550
ccw->bits |= BF_CCW(MXS_DMA_CMD_NO_XFER, COMMAND);
551+
if (flags & MXS_DMA_CTRL_WAIT4RDY)
552+
ccw->bits |= CCW_WAIT4RDY;
550553
} else {
551554
for_each_sg(sgl, sg, sg_len, i) {
552555
if (sg_dma_len(sg) > MAX_XFER_BYTES) {

0 commit comments

Comments
 (0)