6e62f9bd3ac6df79be7419c953fcc2421ce8f910
[openwrt/openwrt.git] / target / linux / ifxmips / patches / 200-cfi-swap.patch
1 Index: linux-2.6.35.8/drivers/mtd/chips/cfi_cmdset_0001.c
2 ===================================================================
3 --- linux-2.6.35.8.orig/drivers/mtd/chips/cfi_cmdset_0001.c 2010-10-29 06:52:43.000000000 +0200
4 +++ linux-2.6.35.8/drivers/mtd/chips/cfi_cmdset_0001.c 2010-11-01 13:01:30.000000000 +0100
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 @@ -1491,6 +1495,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.35.8/drivers/mtd/chips/cfi_cmdset_0002.c
29 ===================================================================
30 --- linux-2.6.35.8.orig/drivers/mtd/chips/cfi_cmdset_0002.c 2010-11-01 13:01:29.000000000 +0100
31 +++ linux-2.6.35.8/drivers/mtd/chips/cfi_cmdset_0002.c 2010-11-01 15:14:17.000000000 +0100
32 @@ -40,7 +40,11 @@
33 #include <linux/mtd/xip.h>
34
35 #define AMD_BOOTLOC_BUG
36 -#define FORCE_WORD_WRITE 0
37 +#ifdef CONFIG_IFXMIPS
38 +# define FORCE_WORD_WRITE 1
39 +#else
40 +# define FORCE_WORD_WRITE 0
41 +#endif
42
43 #define MAX_WORD_RETRIES 3
44
45 @@ -1156,6 +1160,10 @@
46
47 adr += chip->start;
48
49 +#ifdef CONFIG_IFXMIPS
50 + adr ^= 2;
51 +#endif
52 +
53 mutex_lock(&chip->mutex);
54 ret = get_chip(map, chip, adr, FL_WRITING);
55 if (ret) {