ar71xx: fix phy interface selection for the RB-450G
[openwrt.git] / target / linux / ar71xx / patches-2.6.30 / 108-mtd_fix_cfi_cmdset_0002_status_check.patch
1 --- a/drivers/mtd/chips/cfi_cmdset_0002.c
2 +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
3 @@ -39,7 +39,7 @@
4 #include <linux/mtd/xip.h>
5
6 #define AMD_BOOTLOC_BUG
7 -#define FORCE_WORD_WRITE 0
8 +#define FORCE_WORD_WRITE 1
9
10 #define MAX_WORD_RETRIES 3
11
12 @@ -190,6 +190,7 @@ static void fixup_amd_bootblock(struct m
13 }
14 #endif
15
16 +#if !FORCE_WORD_WRITE
17 static void fixup_use_write_buffers(struct mtd_info *mtd, void *param)
18 {
19 struct map_info *map = mtd->priv;
20 @@ -199,6 +200,7 @@ static void fixup_use_write_buffers(stru
21 mtd->write = cfi_amdstd_write_buffers;
22 }
23 }
24 +#endif
25
26 /* Atmel chips don't use the same PRI format as AMD chips */
27 static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param)
28 @@ -1152,7 +1154,7 @@ static int __xipram do_write_oneword(str
29 break;
30 }
31
32 - if (chip_ready(map, adr))
33 + if (chip_good(map, adr, datum))
34 break;
35
36 /* Latency issues. Drop the lock, wait a while and retry */
37 @@ -1436,6 +1438,7 @@ static int __xipram do_write_buffer(stru
38 }
39
40
41 +#if !FORCE_WORD_WRITE
42 static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
43 size_t *retlen, const u_char *buf)
44 {
45 @@ -1514,7 +1517,7 @@ static int cfi_amdstd_write_buffers(stru
46
47 return 0;
48 }
49 -
50 +#endif
51
52 /*
53 * Handle devices with one erase region, that only implement
54 @@ -1579,7 +1582,7 @@ static int __xipram do_erase_chip(struct
55 chip->erase_suspended = 0;
56 }
57
58 - if (chip_ready(map, adr))
59 + if (chip_good(map, adr, map_word_ff(map)))
60 break;
61
62 if (time_after(jiffies, timeo)) {
63 @@ -1667,7 +1670,7 @@ static int __xipram do_erase_oneblock(st
64 chip->erase_suspended = 0;
65 }
66
67 - if (chip_ready(map, adr)) {
68 + if (chip_good(map, adr, map_word_ff(map))) {
69 xip_enable(map, chip, adr);
70 break;
71 }
This page took 0.04714 seconds and 5 git commands to generate.