1
0

411-mtd-cfi_cmdset_0002-force-word-write.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. --- a/drivers/mtd/chips/cfi_cmdset_0002.c
  2. +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
  3. @@ -40,7 +40,7 @@
  4. #include <linux/mtd/xip.h>
  5. #define AMD_BOOTLOC_BUG
  6. -#define FORCE_WORD_WRITE 0
  7. +#define FORCE_WORD_WRITE 1
  8. #define MAX_WORD_RETRIES 3
  9. @@ -51,7 +51,9 @@
  10. static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
  11. static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
  12. +#if !FORCE_WORD_WRITE
  13. static int cfi_amdstd_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
  14. +#endif
  15. static int cfi_amdstd_erase_chip(struct mtd_info *, struct erase_info *);
  16. static int cfi_amdstd_erase_varsize(struct mtd_info *, struct erase_info *);
  17. static void cfi_amdstd_sync (struct mtd_info *);
  18. @@ -202,6 +204,7 @@ static void fixup_amd_bootblock(struct m
  19. }
  20. #endif
  21. +#if !FORCE_WORD_WRITE
  22. static void fixup_use_write_buffers(struct mtd_info *mtd)
  23. {
  24. struct map_info *map = mtd->priv;
  25. @@ -211,6 +214,7 @@ static void fixup_use_write_buffers(stru
  26. mtd->_write = cfi_amdstd_write_buffers;
  27. }
  28. }
  29. +#endif /* !FORCE_WORD_WRITE */
  30. /* Atmel chips don't use the same PRI format as AMD chips */
  31. static void fixup_convert_atmel_pri(struct mtd_info *mtd)
  32. @@ -1791,6 +1795,7 @@ static int cfi_amdstd_write_words(struct
  33. /*
  34. * FIXME: interleaved mode not tested, and probably not supported!
  35. */
  36. +#if !FORCE_WORD_WRITE
  37. static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
  38. unsigned long adr, const u_char *buf,
  39. int len)
  40. @@ -1919,7 +1924,6 @@ static int __xipram do_write_buffer(stru
  41. return ret;
  42. }
  43. -
  44. static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
  45. size_t *retlen, const u_char *buf)
  46. {
  47. @@ -1994,6 +1998,7 @@ static int cfi_amdstd_write_buffers(stru
  48. return 0;
  49. }
  50. +#endif /* !FORCE_WORD_WRITE */
  51. /*
  52. * Wait for the flash chip to become ready to write data