mtd: nand: atmel: Fix EDO mode check
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Mon, 31 Jul 2017 08:32:21 +0000 (10:32 +0200)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Wed, 2 Aug 2017 08:26:43 +0000 (10:26 +0200)
EDO mode should be used when tRC is less than 30ns, but timings are
expressed in picoseconds in the nand_sdr_timings struct.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Fixes: f9ce2eddf176 ("mtd: nand: atmel: Add ->setup_data_interface() hooks")
Reported-by: Alexander Dahl <ada@thorsis.com>
Tested-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/atmel/nand-controller.c

index d922a88e407f119bbf52aae494c632e08d113e7f..2c8baa0c2c4e11f2b5d1c39d4c3ad795d634135a 100644 (file)
@@ -1201,7 +1201,7 @@ static int atmel_smc_nand_prepare_smcconf(struct atmel_nand *nand,
         * tRC < 30ns implies EDO mode. This controller does not support this
         * mode.
         */
-       if (conf->timings.sdr.tRC_min < 30)
+       if (conf->timings.sdr.tRC_min < 30000)
                return -ENOTSUPP;
 
        atmel_smc_cs_conf_init(smcconf);