lkml.org 
[lkml]   [2019]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] mtd: rawnand: call onfi_fill_data_interface() once again after nand_detect
    Date
    nand_scan_ident() calls onfi_fill_data_interface() at its entry
    to set up the initial timing parameters.

    The timing parameters are needed not only for ->setup_data_interface(),
    but also for giving the correct delay to NAND_OP_WAIT_RDY, for example.

    If the driver sets the NAND_KEEP_TIMINGS flag, or does not support
    ->setup_data_interface() hook, those parameters will never updated.

    Before nand_detect(), we never know whether the chip is ONFi or not.
    So, onfi_fill_data_interface() has to assume the worst case, i.e.
    non-ONFi.

    After nand_detect(), if the chip turns out to be ONFi-compliant,
    we can optimize tPROG_max, tBERS_max, etc.

    Call onfi_fill_data_interface() once again.

    Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
    ---

    drivers/mtd/nand/raw/nand_base.c | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
    index 9b3d7ff..35e543c 100644
    --- a/drivers/mtd/nand/raw/nand_base.c
    +++ b/drivers/mtd/nand/raw/nand_base.c
    @@ -5040,6 +5040,9 @@ static int nand_scan_ident(struct nand_chip *chip, unsigned int maxchips,

    nand_deselect_target(chip);

    + /* If the chip turns out ONFi, we can optimize timing parameters. */
    + onfi_fill_data_interface(chip, NAND_SDR_IFACE, 0);
    +
    /* Check for a chip array */
    for (i = 1; i < maxchips; i++) {
    u8 id[2];
    --
    2.7.4
    \
     
     \ /
      Last update: 2019-02-07 11:00    [W:2.667 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site