diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2012-08-22 16:49:42 -0500 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2012-09-17 17:32:10 -0500 |
commit | eee623a5049963d0c085be37128bbd22bee1ba1e (patch) | |
tree | 315346f1597dbeebd2a0d071325bac7fea9de16f /common | |
parent | d62e9caaaf7e6f5c7d86c9ea19170bfa5adda8be (diff) |
nand: Add support for unlock.invert
NAND unlock command allows an invert bit to be set to unlock all but
the selected page range.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
[scottwood@freescale.com: updated docs and added comment about invert bit]
Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_nand.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/common/cmd_nand.c b/common/cmd_nand.c index a91ccf4df3..f737c06f84 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -749,11 +749,18 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) return 0; } - if (strcmp(cmd, "unlock") == 0) { + if (strncmp(cmd, "unlock", 5) == 0) { + int allexcept = 0; + + s = strchr(cmd, '.'); + + if (s && !strcmp(s, ".allexcept")) + allexcept = 1; + if (arg_off_size(argc - 2, argv + 2, &dev, &off, &size) < 0) return 1; - if (!nand_unlock(&nand_info[dev], off, size)) { + if (!nand_unlock(&nand_info[dev], off, size, allexcept)) { puts("NAND flash successfully unlocked\n"); } else { puts("Error unlocking NAND flash, " @@ -807,7 +814,7 @@ U_BOOT_CMD( "\n" "nand lock [tight] [status]\n" " bring nand to lock state or display locked pages\n" - "nand unlock [offset] [size] - unlock section" + "nand unlock[.allexcept] [offset] [size] - unlock section" #endif #ifdef CONFIG_ENV_OFFSET_OOB "\n" |