source: trunk/target/linux/ar71xx/patches-2.6.35/111-mtd-cfi_cmdset_0002-force-word-write.patch @ 21734

Last change on this file since 21734 was 21734, checked in by acoul, 7 years ago

ar71xx: add kernel 2.6.35 preliminary support

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 
     
    5555 
    5656static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); 
    5757static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); 
     58#if !FORCE_WORD_WRITE 
    5859static int cfi_amdstd_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); 
     60#endif 
    5961static int cfi_amdstd_erase_chip(struct mtd_info *, struct erase_info *); 
    6062static int cfi_amdstd_erase_varsize(struct mtd_info *, struct erase_info *); 
    6163static void cfi_amdstd_sync (struct mtd_info *); 
    static void fixup_amd_bootblock(struct m 
    190192} 
    191193#endif 
    192194 
     195#if !FORCE_WORD_WRITE 
    193196static void fixup_use_write_buffers(struct mtd_info *mtd, void *param) 
    194197{ 
    195198        struct map_info *map = mtd->priv; 
    static void fixup_use_write_buffers(stru 
    199202                mtd->write = cfi_amdstd_write_buffers; 
    200203        } 
    201204} 
     205#endif /* !FORCE_WORD_WRITE */ 
    202206 
    203207/* Atmel chips don't use the same PRI format as AMD chips */ 
    204208static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param) 
    static int cfi_amdstd_write_words(struct 
    13041308/* 
    13051309 * FIXME: interleaved mode not tested, and probably not supported! 
    13061310 */ 
     1311#if !FORCE_WORD_WRITE 
    13071312static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, 
    13081313                                    unsigned long adr, const u_char *buf, 
    13091314                                    int len) 
    static int __xipram do_write_buffer(stru 
    14151420        return ret; 
    14161421} 
    14171422 
    1418  
    14191423static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len, 
    14201424                                    size_t *retlen, const u_char *buf) 
    14211425{ 
    static int cfi_amdstd_write_buffers(stru 
    14941498 
    14951499        return 0; 
    14961500} 
     1501#endif /* !FORCE_WORD_WRITE */ 
    14971502 
    14981503/* 
    14991504 * Handle devices with one erase region, that only implement 
Note: See TracBrowser for help on using the repository browser.