source: trunk/target/linux/ar71xx/patches-3.3/411-mtd-cfi_cmdset_0002-force-word-write.patch @ 30410

Last change on this file since 30410 was 30410, checked in by juhosg, 5 years ago

ar71xx: add preliminary support for 3.3

File size: 1.9 KB
  • drivers/mtd/chips/cfi_cmdset_0002.c

    a b  
    3939#include <linux/mtd/xip.h> 
    4040 
    4141#define AMD_BOOTLOC_BUG 
    42 #define FORCE_WORD_WRITE 0 
     42#define FORCE_WORD_WRITE 1 
    4343 
    4444#define MAX_WORD_RETRIES 3 
    4545 
     
    5050 
    5151static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); 
    5252static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); 
     53#if !FORCE_WORD_WRITE 
    5354static int cfi_amdstd_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); 
     55#endif 
    5456static int cfi_amdstd_erase_chip(struct mtd_info *, struct erase_info *); 
    5557static int cfi_amdstd_erase_varsize(struct mtd_info *, struct erase_info *); 
    5658static void cfi_amdstd_sync (struct mtd_info *); 
    static void fixup_amd_bootblock(struct m 
    183185} 
    184186#endif 
    185187 
     188#if !FORCE_WORD_WRITE 
    186189static void fixup_use_write_buffers(struct mtd_info *mtd) 
    187190{ 
    188191        struct map_info *map = mtd->priv; 
    static void fixup_use_write_buffers(stru 
    192195                mtd->write = cfi_amdstd_write_buffers; 
    193196        } 
    194197} 
     198#endif /* !FORCE_WORD_WRITE */ 
    195199 
    196200/* Atmel chips don't use the same PRI format as AMD chips */ 
    197201static void fixup_convert_atmel_pri(struct mtd_info *mtd) 
    static int cfi_amdstd_write_words(struct 
    13741378/* 
    13751379 * FIXME: interleaved mode not tested, and probably not supported! 
    13761380 */ 
     1381#if !FORCE_WORD_WRITE 
    13771382static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, 
    13781383                                    unsigned long adr, const u_char *buf, 
    13791384                                    int len) 
    static int __xipram do_write_buffer(stru 
    14851490        return ret; 
    14861491} 
    14871492 
    1488  
    14891493static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len, 
    14901494                                    size_t *retlen, const u_char *buf) 
    14911495{ 
    static int cfi_amdstd_write_buffers(stru 
    15641568 
    15651569        return 0; 
    15661570} 
     1571#endif /* !FORCE_WORD_WRITE */ 
    15671572 
    15681573/* 
    15691574 * Handle devices with one erase region, that only implement 
Note: See TracBrowser for help on using the repository browser.