2fedf3ff66ec836516e3af74531e747ed22422f1
[openwrt/svn-archive/archive.git] / target / linux / ifxmips / patches-2.6.33 / 200-cfi-swap.patch
1 Index: linux-2.6.33.2/drivers/mtd/chips/cfi_cmdset_0001.c
2 ===================================================================
3 --- linux-2.6.33.2.orig/drivers/mtd/chips/cfi_cmdset_0001.c 2010-04-02 01:02:33.000000000 +0200
4 +++ linux-2.6.33.2/drivers/mtd/chips/cfi_cmdset_0001.c 2010-04-02 23:47:32.000000000 +0200
5 @@ -41,7 +41,11 @@
6 /* #define CMDSET0001_DISABLE_WRITE_SUSPEND */
7
8 // debugging, turns off buffer write mode if set to 1
9 -#define FORCE_WORD_WRITE 0
10 +#ifdef CONFIG_IFXMIPS
11 +# define FORCE_WORD_WRITE 1
12 +#else
13 +# define FORCE_WORD_WRITE 0
14 +#endif
15
16 /* Intel chips */
17 #define I82802AB 0x00ad
18 @@ -1494,6 +1498,9 @@
19 int ret=0;
20
21 adr += chip->start;
22 +#ifdef CONFIG_IFXMIPS
23 + adr ^= 2;
24 +#endif
25
26 switch (mode) {
27 case FL_WRITING:
28 Index: linux-2.6.33.2/drivers/mtd/chips/cfi_cmdset_0002.c
29 ===================================================================
30 --- linux-2.6.33.2.orig/drivers/mtd/chips/cfi_cmdset_0002.c 2010-04-02 23:31:00.000000000 +0200
31 +++ linux-2.6.33.2/drivers/mtd/chips/cfi_cmdset_0002.c 2010-04-02 23:47:32.000000000 +0200
32 @@ -1068,7 +1068,9 @@
33 int retry_cnt = 0;
34
35 adr += chip->start;
36 -
37 +#ifdef CONFIG_IFXMIPS
38 + adr ^= 2;
39 +#endif
40 spin_lock(chip->mutex);
41 ret = get_chip(map, chip, adr, FL_WRITING);
42 if (ret) {