]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/nand/mpc5121_nfc.c
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
[u-boot] / drivers / mtd / nand / mpc5121_nfc.c
index 856cb36c0c5f1bdaaf2f2e641617891590946065..7233bfc12796c10d18ccf877c969fc8e5b953aaa 100644 (file)
@@ -8,19 +8,7 @@
  * of drivers/mtd/nand/mxc_nand.c. Reworked and extended
  * Piotr Ziecik <kosmo@semihalf.com>.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -29,7 +17,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/nand_ecc.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
 
 #include <asm/errno.h>
 #include <asm/io.h>
@@ -334,6 +322,7 @@ static void mpc5121_nfc_command(struct mtd_info *mtd, unsigned command,
        case NAND_CMD_ERASE2:
        case NAND_CMD_READID:
        case NAND_CMD_STATUS:
+       case NAND_CMD_RESET:
                break;
 
        default:
@@ -470,6 +459,7 @@ static void mpc5121_nfc_write_buf(struct mtd_info *mtd,
        mpc5121_nfc_buf_copy(mtd, (u_char *) buf, len, 1);
 }
 
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 /* Compare buffer with NAND flash */
 static int mpc5121_nfc_verify_buf(struct mtd_info *mtd,
                                  const u_char * buf, int len)
@@ -490,6 +480,7 @@ static int mpc5121_nfc_verify_buf(struct mtd_info *mtd,
 
        return 0;
 }
+#endif
 
 /* Read byte from NFC buffers */
 static u8 mpc5121_nfc_read_byte(struct mtd_info *mtd)
@@ -618,9 +609,11 @@ int board_nand_init(struct nand_chip *chip)
        chip->read_word = mpc5121_nfc_read_word;
        chip->read_buf = mpc5121_nfc_read_buf;
        chip->write_buf = mpc5121_nfc_write_buf;
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
        chip->verify_buf = mpc5121_nfc_verify_buf;
+#endif
        chip->select_chip = mpc5121_nfc_select_chip;
-       chip->options = NAND_NO_AUTOINCR | NAND_USE_FLASH_BBT;
+       chip->bbt_options = NAND_BBT_USE_FLASH;
        chip->ecc.mode = NAND_ECC_SOFT;
 
        /* Reset NAND Flash controller */