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 @@ -183,6 +185,7 @@ static void fixup_amd_bootblock(struct m
26 +#if !FORCE_WORD_WRITE
27 static void fixup_use_write_buffers(struct mtd_info *mtd)
29 struct map_info *map = mtd->priv;
30 @@ -192,6 +195,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)
38 @@ -1374,6 +1378,7 @@ static int cfi_amdstd_write_words(struct
40 * FIXME: interleaved mode not tested, and probably not supported!
42 +#if !FORCE_WORD_WRITE
43 static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
44 unsigned long adr, const u_char *buf,
46 @@ -1485,7 +1490,6 @@ static int __xipram do_write_buffer(stru
51 static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
52 size_t *retlen, const u_char *buf)
54 @@ -1564,6 +1568,7 @@ static int cfi_amdstd_write_buffers(stru
58 +#endif /* !FORCE_WORD_WRITE */
61 * Handle devices with one erase region, that only implement