]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/mtd/nand/nand_util.c
Merge branch 'master' of git://www.denx.de/git/u-boot-imx
[karo-tx-uboot.git] / drivers / mtd / nand / nand_util.c
index 1e0210a9a416a7513149466a443bc990115da24b..024f6fb4402485bc6337a00af308e1eeb5a3e013 100644 (file)
@@ -14,7 +14,9 @@
  * Copyright (C) 2008 Nokia Corporation: drop_ffs() function by
  * Artem Bityutskiy <dedekind1@gmail.com> from mtd-utils
  *
- * SPDX-License-Identifier:    GPL-2.0+
+ * Copyright 2010 Freescale Semiconductor
+ *
+ * SPDX-License-Identifier:    GPL-2.0
  */
 
 #include <common.h>
@@ -51,7 +53,6 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
        struct jffs2_unknown_node cleanmarker;
        erase_info_t erase;
        unsigned long erase_length, erased_length; /* in blocks */
-       int bbtest = 1;
        int result;
        int percent_complete = -1;
        const char *mtd_device = meminfo->name;
@@ -102,7 +103,7 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
                        puts("Size of erase exceeds limit\n");
                        return -EFBIG;
                }
-               if (!opts->scrub && bbtest) {
+               if (!opts->scrub) {
                        int ret = mtd_block_isbad(meminfo, erase.addr);
                        if (ret > 0) {
                                if (!opts->quiet)
@@ -143,8 +144,8 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
                        ops.mode = MTD_OPS_AUTO_OOB;
 
                        result = mtd_write_oob(meminfo,
-                                                   erase.addr,
-                                                   &ops);
+                                                   erase.addr,
+                                                   &ops);
                        if (result != 0) {
                                printf("\n%s: MTD writeoob failure: %d\n",
                                       mtd_device, result);
@@ -186,6 +187,9 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
 
 #ifdef CONFIG_CMD_NAND_LOCK_UNLOCK
 
+#define NAND_CMD_LOCK_TIGHT     0x2c
+#define NAND_CMD_LOCK_STATUS    0x7a
 /******************************************************************************
  * Support for locking / unlocking operations of some NAND devices
  *****************************************************************************/
@@ -314,7 +318,7 @@ int nand_unlock(struct mtd_info *mtd, loff_t start, size_t length,
        int page;
        struct nand_chip *chip = mtd->priv;
 
-       debug("nand_unlock%s: start: %08llx, length: %d!\n",
+       debug("nand_unlock%s: start: %08llx, length: %zd!\n",
                allexcept ? " (allexcept)" : "", start, length);
 
        /* select the NAND device */