1 --- a/drivers/mtd/chips/cfi_cmdset_0002.c
2 +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
4 #include <linux/mtd/xip.h>
6 #define AMD_BOOTLOC_BUG
7 -#define FORCE_WORD_WRITE 0
8 +#define FORCE_WORD_WRITE 1
10 #define MAX_WORD_RETRIES 3
14 static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
15 static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
16 +#if !FORCE_WORD_WRITE
17 static int cfi_amdstd_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
19 static int cfi_amdstd_erase_chip(struct mtd_info *, struct erase_info *);
20 static int cfi_amdstd_erase_varsize(struct mtd_info *, struct erase_info *);
21 static void cfi_amdstd_sync (struct mtd_info *);
22 @@ -186,6 +188,7 @@ static void fixup_amd_bootblock(struct m
26 +#if !FORCE_WORD_WRITE
27 static void fixup_use_write_buffers(struct mtd_info *mtd, void *param)
29 struct map_info *map = mtd->priv;
30 @@ -195,6 +198,7 @@ static void fixup_use_write_buffers(stru
31 mtd->write = cfi_amdstd_write_buffers;
34 +#endif /* !FORCE_WORD_WRITE */
36 /* Atmel chips don't use the same PRI format as AMD chips */
37 static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param)
38 @@ -472,7 +476,7 @@ struct mtd_info *cfi_cmdset_0002(struct
41 * Valid primary extension versions are: 1.0, 1.1, 1.2, 1.3, 1.4
42 - * see: Spec 1.3 http://cs.ozerki.net/zap/pub/axim-x5/docs/cfi_r20.pdf, page 19
43 + * see: Spec 1.3 http://cs.ozerki.net/zap/pub/axim-x5/docs/cfi_r20.pdf, page 19
44 * http://www.spansion.com/Support/AppNotes/cfi_100_20011201.pdf
45 * Spec 1.4 http://www.spansion.com/Support/AppNotes/CFI_Spec_AN_03.pdf, page 9
47 @@ -1386,6 +1390,7 @@ static int cfi_amdstd_write_words(struct
49 * FIXME: interleaved mode not tested, and probably not supported!
51 +#if !FORCE_WORD_WRITE
52 static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
53 unsigned long adr, const u_char *buf,
55 @@ -1496,7 +1501,6 @@ static int __xipram do_write_buffer(stru
60 static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
61 size_t *retlen, const u_char *buf)
63 @@ -1575,6 +1579,7 @@ static int cfi_amdstd_write_buffers(stru
67 +#endif /* !FORCE_WORD_WRITE */