aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/cmdlinepart.c
diff options
context:
space:
mode:
authorJustin Treon <justin_treon@yahoo.com>2008-01-30 13:25:49 -0500
committerDavid Woodhouse <dwmw2@infradead.org>2008-02-03 02:25:16 -0500
commite619a75ff6201b567a539e787aa9af9bc63a3187 (patch)
treef13113ce617958181d5cd6b2c56ae9f7b87d0014 /drivers/mtd/cmdlinepart.c
parent842b1a105c95d22c3e4257879539413d3152629e (diff)
[MTD] Unlocking all Intel flash that is locked on power up.
Patch for unlocking all Intel flash that has instant locking on power up. The patch has been tested on Intel M18, P30 and J3D Strata Flash. 1. The automatic unlocking can be disabled for a particular partition in the map or the command line. a. For the bit mask in the map it should look like: .mask_flags = MTD_POWERUP_LOCK, b. For the command line parsing it should look like: mtdparts=0x80000(bootloader)lk 2. This will only unlock parts with instant individual block locking. Intel parts with legacy unlocking will not be unlocked. Signed-off-by: Justin Treon <justin_treon@yahoo.com> Signed-off-by: Jared Hulbert <jaredeh@gmail.com> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/cmdlinepart.c')
-rw-r--r--drivers/mtd/cmdlinepart.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index 23fab14f1637..b44292abd9f7 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -9,7 +9,7 @@
9 * 9 *
10 * mtdparts=<mtddef>[;<mtddef] 10 * mtdparts=<mtddef>[;<mtddef]
11 * <mtddef> := <mtd-id>:<partdef>[,<partdef>] 11 * <mtddef> := <mtd-id>:<partdef>[,<partdef>]
12 * <partdef> := <size>[@offset][<name>][ro] 12 * <partdef> := <size>[@offset][<name>][ro][lk]
13 * <mtd-id> := unique name used in mapping driver/device (mtd->name) 13 * <mtd-id> := unique name used in mapping driver/device (mtd->name)
14 * <size> := standard linux memsize OR "-" to denote all remaining space 14 * <size> := standard linux memsize OR "-" to denote all remaining space
15 * <name> := '(' NAME ')' 15 * <name> := '(' NAME ')'
@@ -143,6 +143,13 @@ static struct mtd_partition * newpart(char *s,
143 s += 2; 143 s += 2;
144 } 144 }
145 145
146 /* if lk is found do NOT unlock the MTD partition*/
147 if (strncmp(s, "lk", 2) == 0)
148 {
149 mask_flags |= MTD_POWERUP_LOCK;
150 s += 2;
151 }
152
146 /* test if more partitions are following */ 153 /* test if more partitions are following */
147 if (*s == ',') 154 if (*s == ',')
148 { 155 {