]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ENGR00173731-3 mxs-dma : rewrite the last parameter of mxs_dma_prep_slave_sg()
authorHuang Shijie <b32955@freescale.com>
Wed, 18 Jan 2012 02:51:40 +0000 (10:51 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:10:47 +0000 (14:10 +0200)
commit17c9ddea4ba2b66e3c6715b3287a23528dca9d6a
tree6b6bc44fce90556401010848ce33524bb26f5100
parentd717dd78a518f51815b809e8ecea34b1a5182fbd
ENGR00173731-3 mxs-dma : rewrite the last parameter of mxs_dma_prep_slave_sg()

[1] Background :
    The GPMI does ECC read page operation with a DMA chain consist of three DMA
    Command Structures. The middle one of the chain is used to enable the BCH,
    and read out the NAND page.

    The WAIT4END(wait for command end) is a comunication signal between
    the GPMI and MXS-DMA.

[2] The current DMA code sets the WAIT4END bit at the last one, such as:

    +-----+               +-----+                      +-----+
    | cmd | ------------> | cmd | ------------------>  | cmd |
    +-----+               +-----+                      +-----+
                                                          ^
                                                          |
                                                          |
                                                     set WAIT4END here

    This chain works fine in the mx23/mx28.

[3] But in the new GPMI version (used in MX50/MX60), the WAIT4END bit should
    be set not only at the last DMA Command Structure,
    but also at the middle one, such as:

    +-----+               +-----+                      +-----+
    | cmd | ------------> | cmd | ------------------>  | cmd |
    +-----+               +-----+                      +-----+
                             ^                            ^
                             |                            |
                             |                            |
                        set WAIT4END here too        set WAIT4END here

    If we do not set WAIT4END, the BCH maybe stalls in "ECC reading page" state.
    In the next ECC write page operation, a DMA-timeout occurs.
    This has been catched in the MX6Q board.

[4] In order to fix the bug, rewrite the last parameter of
    mxs_dma_prep_slave_sg(), and use the dma_ctrl_flags:
    ---------------------------------------------------------
      DMA_PREP_INTERRUPT : append a new DMA Command Structrue.
      DMA_CTRL_ACK       : set the WAIT4END bit for this DMA Command Structure.
    ---------------------------------------------------------

[5] changes to the relative drivers:
    For gpmi-nand driver: use the new flags.

Signed-off-by: Huang Shijie <b32955@freescale.com>
drivers/dma/mxs-dma.c
drivers/mtd/nand/gpmi-nand/gpmi-lib.c