aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorVimal Singh <vimal.newwork@gmail.com>2010-02-08 05:20:49 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-02-26 08:21:49 -0500
commit7d70f334ad2bf1b3aaa1f0699c0f442e14bcc9e0 (patch)
tree2d2b23d7d8145c2fb6b6414708732facdeb27fe7 /include/linux
parent6fe5a6acdc126107e54a6c584536e09ab7dde949 (diff)
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 ccab9dfc5217..48bc2c54302c 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);
38/* Internal helper for board drivers which need to override command function */ 38/* Internal helper for board drivers which need to override command function */
39extern void nand_wait_ready(struct mtd_info *mtd); 39extern void nand_wait_ready(struct mtd_info *mtd);
40 40
41/* locks all blockes present in the device */
42extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
43
44/* unlocks specified locked blockes */
45extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
46
41/* The maximum number of NAND chips in an array */ 47/* The maximum number of NAND chips in an array */
42#define NAND_MAX_CHIPS 8 48#define NAND_MAX_CHIPS 8
43 49
@@ -82,6 +88,10 @@ extern void nand_wait_ready(struct mtd_info *mtd);
82#define NAND_CMD_ERASE2 0xd0 88#define NAND_CMD_ERASE2 0xd0
83#define NAND_CMD_RESET 0xff 89#define NAND_CMD_RESET 0xff
84 90
91#define NAND_CMD_LOCK 0x2a
92#define NAND_CMD_UNLOCK1 0x23
93#define NAND_CMD_UNLOCK2 0x24
94
85/* Extended commands for large page devices */ 95/* Extended commands for large page devices */
86#define NAND_CMD_READSTART 0x30 96#define NAND_CMD_READSTART 0x30
87#define NAND_CMD_RNDOUTSTART 0xE0 97#define NAND_CMD_RNDOUTSTART 0xE0