[MTD] [NOR] AT49BV6416 has swapped erase regions

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Oct 18 07:59:03 EDT 2008


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=be8f78b8e8b5bcafc19ac85b815e98049aa86314
Commit:     be8f78b8e8b5bcafc19ac85b815e98049aa86314
Parent:     aaf7ea20000436df3cbb397ccb734ad1e2e5164d
Author:     Haavard Skinnemoen <haavard.skinnemoen at atmel.com>
AuthorDate: Tue Sep 30 13:55:33 2008 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sat Oct 18 12:53:15 2008 +0100

    [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 at atmel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/chips/cfi_cmdset_0002.c |   16 ++++++++++++----
 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 db16b7b..3e6f5d8 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)
 	if (atmel_pri.Features & 0x02)
 		extp->EraseSuspend = 2;
 
-	if (atmel_pri.BottomBoot)
-		extp->TopBottom = 2;
-	else
-		extp->TopBottom = 3;
+	/* Some chips got it backwards... */
+	if (cfi->id == AT49BV6416) {
+		if (atmel_pri.BottomBoot)
+			extp->TopBottom = 3;
+		else
+			extp->TopBottom = 2;
+	} else {
+		if (atmel_pri.BottomBoot)
+			extp->TopBottom = 2;
+		else
+			extp->TopBottom = 3;
+	}
 
 	/* burst write mode not supported */
 	cfi->cfiq->BufWriteTimeoutTyp = 0;



More information about the linux-mtd-cvs mailing list