aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-09-30 07:55:33 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-10-18 07:53:15 -0400
commitbe8f78b8e8b5bcafc19ac85b815e98049aa86314 (patch)
treeb0dc5f12b267365743faa23130b7534c59f05966 /drivers/mtd
parentaaf7ea20000436df3cbb397ccb734ad1e2e5164d (diff)
[MTD] [NOR] AT49BV6416 has swapped erase regions
The CFI information read from AT49BV6416 lists the erase regions in the wrong order, causing problems when trying to erase or update the first or last 64KiB block. Work around this by inverting the "top boot" flag, which will effectively reverse the order of the erase regions. This chip is obsolete, but it's used in some existing designs. Signed-off-by: HÃ¥vard Skinnemoen <haavard.skinnemoen@atmel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0002.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index db16b7b0723f..3e6f5d8609e8 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -213,10 +213,18 @@ static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param)
213 if (atmel_pri.Features & 0x02) 213 if (atmel_pri.Features & 0x02)
214 extp->EraseSuspend = 2; 214 extp->EraseSuspend = 2;
215 215
216 if (atmel_pri.BottomBoot) 216 /* Some chips got it backwards... */
217 extp->TopBottom = 2; 217 if (cfi->id == AT49BV6416) {
218 else 218 if (atmel_pri.BottomBoot)
219 extp->TopBottom = 3; 219 extp->TopBottom = 3;
220 else
221 extp->TopBottom = 2;
222 } else {
223 if (atmel_pri.BottomBoot)
224 extp->TopBottom = 2;
225 else
226 extp->TopBottom = 3;
227 }
220 228
221 /* burst write mode not supported */ 229 /* burst write mode not supported */
222 cfi->cfiq->BufWriteTimeoutTyp = 0; 230 cfi->cfiq->BufWriteTimeoutTyp = 0;