mtd: nand: Fix nand_command_lp() for 8bits opcodes
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Wed, 15 Jun 2016 11:09:51 +0000 (13:09 +0200)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Fri, 23 Sep 2016 07:35:16 +0000 (09:35 +0200)
8 bits opcodes should be followed by a single address cycle. Make the
2nd address cycle dependent of !nand_opcode_8bits(command).

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/nand_base.c

index a74d9e4bd8b2ad3db2b776d942b8e294f917a056..c06146941e1611377b3f527174b1c9c5f7b3d1e1 100644 (file)
@@ -745,7 +745,10 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command,
                                column >>= 1;
                        chip->cmd_ctrl(mtd, column, ctrl);
                        ctrl &= ~NAND_CTRL_CHANGE;
-                       chip->cmd_ctrl(mtd, column >> 8, ctrl);
+
+                       /* Only ouput a single addr cycle for 8bits opcodes. */
+                       if (!nand_opcode_8bits(command))
+                               chip->cmd_ctrl(mtd, column >> 8, ctrl);
                }
                if (page_addr != -1) {
                        chip->cmd_ctrl(mtd, page_addr, ctrl);