ar71xx: ar934x_nfc: fix RNDOUT operation
authorGabor Juhos <juhosg@openwrt.org>
Mon, 17 Sep 2012 20:30:51 +0000 (20:30 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Mon, 17 Sep 2012 20:30:51 +0000 (20:30 +0000)
SVN-Revision: 33451

target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c

index 86899fd720c65c601dc4fc1e2a0963484a3dd6b2..d889c70b027ae3e0e047d66b3faea5752addda91 100644 (file)
@@ -643,10 +643,14 @@ ar934x_nfc_cmdfunc(struct mtd_info *mtd, unsigned int command, int column,
                break;
 
        case NAND_CMD_RNDOUT:
+               if (WARN_ON(nfc->small_page))
+                       break;
+
                /* emulate subpage read */
-               ar934x_nfc_send_read(nfc, nfc->rndout_read_cmd, column,
+               ar934x_nfc_send_read(nfc, nfc->rndout_read_cmd, 0,
                                     nfc->rndout_page_addr,
-                                    mtd->writesize, false);
+                                    mtd->writesize + mtd->oobsize, false);
+               nfc->buf_index = column;
                break;
 
        case NAND_CMD_ERASE1: