diff options
author | Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> | 2009-11-05 09:53:37 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-11-30 04:51:01 -0500 |
commit | 8dbaea4bfcecacaf496a3e2ae92867baedbcab8e (patch) | |
tree | a30181fe2d82e6d59b49723a47a52f565756b8b3 /drivers/mtd/chips | |
parent | 35016dd7e92cf0eb5ae2e811445dd52320c348d0 (diff) |
mtd: add lock fixup for AT49BV640D and AT49BV640DT chips
This patch sets the MTD_POWERUP_LOCK flag for AT49BV640D and AT49BV640DT
devices, since the devices are locked when powered up and needs to be unlocked
before interfaced.
Quote datasheet; "At power-up and reset, all sectors have their Softlock
protection mode enabled.".
Tested on AVR32 hardware platform with an AT49BV640D flash device.
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0001.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index d923a2d88f9c..94be67e880a7 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c | |||
@@ -51,7 +51,9 @@ | |||
51 | #define M50LPW080 0x002F | 51 | #define M50LPW080 0x002F |
52 | #define M50FLW080A 0x0080 | 52 | #define M50FLW080A 0x0080 |
53 | #define M50FLW080B 0x0081 | 53 | #define M50FLW080B 0x0081 |
54 | /* Atmel chips */ | ||
54 | #define AT49BV640D 0x02de | 55 | #define AT49BV640D 0x02de |
56 | #define AT49BV640DT 0x02db | ||
55 | 57 | ||
56 | static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); | 58 | static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); |
57 | static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); | 59 | static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); |
@@ -199,6 +201,16 @@ static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param) | |||
199 | cfi->cfiq->BufWriteTimeoutMax = 0; | 201 | cfi->cfiq->BufWriteTimeoutMax = 0; |
200 | } | 202 | } |
201 | 203 | ||
204 | static void fixup_at49bv640dx_lock(struct mtd_info *mtd, void *param) | ||
205 | { | ||
206 | struct map_info *map = mtd->priv; | ||
207 | struct cfi_private *cfi = map->fldrv_priv; | ||
208 | struct cfi_pri_intelext *cfip = cfi->cmdset_priv; | ||
209 | |||
210 | cfip->FeatureSupport |= (1 << 5); | ||
211 | mtd->flags |= MTD_POWERUP_LOCK; | ||
212 | } | ||
213 | |||
202 | #ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE | 214 | #ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE |
203 | /* Some Intel Strata Flash prior to FPO revision C has bugs in this area */ | 215 | /* Some Intel Strata Flash prior to FPO revision C has bugs in this area */ |
204 | static void fixup_intel_strataflash(struct mtd_info *mtd, void* param) | 216 | static void fixup_intel_strataflash(struct mtd_info *mtd, void* param) |
@@ -283,6 +295,8 @@ static void fixup_unlock_powerup_lock(struct mtd_info *mtd, void *param) | |||
283 | 295 | ||
284 | static struct cfi_fixup cfi_fixup_table[] = { | 296 | static struct cfi_fixup cfi_fixup_table[] = { |
285 | { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL }, | 297 | { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL }, |
298 | { CFI_MFR_ATMEL, AT49BV640D, fixup_at49bv640dx_lock, NULL }, | ||
299 | { CFI_MFR_ATMEL, AT49BV640DT, fixup_at49bv640dx_lock, NULL }, | ||
286 | #ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE | 300 | #ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE |
287 | { CFI_MFR_ANY, CFI_ID_ANY, fixup_intel_strataflash, NULL }, | 301 | { CFI_MFR_ANY, CFI_ID_ANY, fixup_intel_strataflash, NULL }, |
288 | #endif | 302 | #endif |