From e619a75ff6201b567a539e787aa9af9bc63a3187 Mon Sep 17 00:00:00 2001 From: Justin Treon Date: Wed, 30 Jan 2008 10:25:49 -0800 Subject: [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 Signed-off-by: Jared Hulbert Acked-by: Nicolas Pitre Signed-off-by: David Woodhouse --- drivers/mtd/cmdlinepart.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'drivers/mtd/cmdlinepart.c') 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 @@ * * mtdparts=[; := :[,] - * := [@offset][][ro] + * := [@offset][][ro][lk] * := unique name used in mapping driver/device (mtd->name) * := standard linux memsize OR "-" to denote all remaining space * := '(' NAME ')' @@ -143,6 +143,13 @@ static struct mtd_partition * newpart(char *s, s += 2; } + /* if lk is found do NOT unlock the MTD partition*/ + if (strncmp(s, "lk", 2) == 0) + { + mask_flags |= MTD_POWERUP_LOCK; + s += 2; + } + /* test if more partitions are following */ if (*s == ',') { -- cgit v1.2.3