summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorVimal Singh <vimal.newwork@gmail.com>2010-02-08 15:50:49 +0530
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-02-26 13:21:49 +0000
commit7d70f334ad2bf1b3aaa1f0699c0f442e14bcc9e0 (patch)
tree2d2b23d7d8145c2fb6b6414708732facdeb27fe7 /include/linux
parent6fe5a6acdc126107e54a6c584536e09ab7dde949 (diff)
downloadop-kernel-dev-7d70f334ad2bf1b3aaa1f0699c0f442e14bcc9e0.zip
op-kernel-dev-7d70f334ad2bf1b3aaa1f0699c0f442e14bcc9e0.tar.gz
mtd: nand: add lock/unlock routines
Add nand lock / unlock routines. At least 'micron' parts support this. Signed-off-by: Vimal Singh <vimalsingh@ti.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/nand.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index ccab9df..48bc2c5 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -38,6 +38,12 @@ extern void nand_release (struct mtd_info *mtd);
/* Internal helper for board drivers which need to override command function */
extern void nand_wait_ready(struct mtd_info *mtd);
+/* locks all blockes present in the device */
+extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
+
+/* unlocks specified locked blockes */
+extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
+
/* The maximum number of NAND chips in an array */
#define NAND_MAX_CHIPS 8
@@ -82,6 +88,10 @@ extern void nand_wait_ready(struct mtd_info *mtd);
#define NAND_CMD_ERASE2 0xd0
#define NAND_CMD_RESET 0xff
+#define NAND_CMD_LOCK 0x2a
+#define NAND_CMD_UNLOCK1 0x23
+#define NAND_CMD_UNLOCK2 0x24
+
/* Extended commands for large page devices */
#define NAND_CMD_READSTART 0x30
#define NAND_CMD_RNDOUTSTART 0xE0
OpenPOWER on IntegriCloud