ar71xx: ar934x_nfc: fix READ{0,1} operation on large page devices
authorGabor Juhos <juhosg@openwrt.org>
Mon, 17 Sep 2012 20:30:50 +0000 (20:30 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Mon, 17 Sep 2012 20:30:50 +0000 (20:30 +0000)
SVN-Revision: 33450

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

index 65d9186d470f05f373115d9e5cd567bb2a994b61..86899fd720c65c601dc4fc1e2a0963484a3dd6b2 100644 (file)
@@ -613,15 +613,18 @@ ar934x_nfc_cmdfunc(struct mtd_info *mtd, unsigned int command, int column,
 
        case NAND_CMD_READ0:
        case NAND_CMD_READ1:
-               if (nfc->small_page)
+               if (nfc->small_page) {
                        ar934x_nfc_send_read(nfc, command, column, page_addr,
                                             mtd->writesize + mtd->oobsize,
                                             false);
-               else
-                       ar934x_nfc_send_read(nfc, command, column, page_addr,
-                                            mtd->writesize, false);
-               nfc->rndout_page_addr = page_addr;
-               nfc->rndout_read_cmd = command;
+               } else {
+                       ar934x_nfc_send_read(nfc, command, 0, page_addr,
+                                            mtd->writesize + mtd->oobsize,
+                                            false);
+                       nfc->buf_index = column;
+                       nfc->rndout_page_addr = page_addr;
+                       nfc->rndout_read_cmd = command;
+               }
                break;
 
        case NAND_CMD_READOOB: