public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] fix Atmel NOR flash for command set 0002
@ 2007-05-10  8:32 Hans-Christian Egtvedt
  2007-05-10 15:31 ` Hans-Christian Egtvedt
  0 siblings, 1 reply; 2+ messages in thread
From: Hans-Christian Egtvedt @ 2007-05-10  8:32 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

Hello,

Trying to prod my co-worker backfired, so here is the patch with a
changelog.

The included patch corrects the fixup table and properly sets the
BufWriteTimeoutTyp and BufWriteTimeoutMax to zero. Doing this will
disable buffered writing, which Atmel has a different command for and is
only supporting dual word writes.

Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>

-- 
With kind regards,

Hans-Christian Egtvedt, siv.ing. (M.Sc.)
Applications Engineer - AVR32 System Solutions - Atmel Norway

[-- Attachment #2: fix-atmel-cmdset_0002-fixup-table.patch --]
[-- Type: text/x-patch, Size: 1126 bytes --]

diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 1f64458..205977b 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -185,6 +185,10 @@ static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param)
 		extp->TopBottom = 2;
 	else
 		extp->TopBottom = 3;
+
+	/* burst write mode not supported */
+	cfi->cfiq->BufWriteTimeoutTyp = 0;
+	cfi->cfiq->BufWriteTimeoutMax = 0;
 }
 
 static void fixup_use_secsi(struct mtd_info *mtd, void *param)
@@ -217,6 +221,7 @@ static void fixup_use_atmel_lock(struct mtd_info *mtd, void *param)
 }
 
 static struct cfi_fixup cfi_fixup_table[] = {
+	{ CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL },
 #ifdef AMD_BOOTLOC_BUG
 	{ CFI_MFR_AMD, CFI_ID_ANY, fixup_amd_bootblock, NULL },
 #endif
@@ -229,7 +234,6 @@ static struct cfi_fixup cfi_fixup_table[] = {
 #if !FORCE_WORD_WRITE
 	{ CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers, NULL, },
 #endif
-	{ CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL },
 	{ 0, 0, NULL, NULL }
 };
 static struct cfi_fixup jedec_fixup_table[] = {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fix Atmel NOR flash for command set 0002
  2007-05-10  8:32 [PATCH] fix Atmel NOR flash for command set 0002 Hans-Christian Egtvedt
@ 2007-05-10 15:31 ` Hans-Christian Egtvedt
  0 siblings, 0 replies; 2+ messages in thread
From: Hans-Christian Egtvedt @ 2007-05-10 15:31 UTC (permalink / raw)
  To: linux-mtd

On Thu, 2007-05-10 at 10:32 +0200, Hans-Christian Egtvedt wrote:
> Hello,
> 
> Trying to prod my co-worker backfired, so here is the patch with a
> changelog.

Oh, forgot to mention it is diffed against Linux 2.6.20, but as previous
mentioned a similar patch is already applied to the repository. I guess
Michael König ment the MTD repository.

<cut changelog>

-- 
With kind regards,

Hans-Christian Egtvedt, siv.ing. (M.Sc.)
Applications Engineer - AVR32 System Solutions - Atmel Norway

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-10 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-10  8:32 [PATCH] fix Atmel NOR flash for command set 0002 Hans-Christian Egtvedt
2007-05-10 15:31 ` Hans-Christian Egtvedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox