2011-04-10 18:08:28 +03:00
|
|
|
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
|
|
|
|
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
|
2012-05-13 18:10:40 +03:00
|
|
|
@@ -1152,6 +1152,9 @@ static int __xipram do_write_oneword(str
|
2011-04-10 18:08:28 +03:00
|
|
|
int retry_cnt = 0;
|
|
|
|
|
|
|
|
adr += chip->start;
|
|
|
|
+#ifdef CONFIG_AMAZON
|
|
|
|
+ adr ^= 2;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
mutex_lock(&chip->mutex);
|
|
|
|
ret = get_chip(map, chip, adr, FL_WRITING);
|
2012-05-13 18:10:40 +03:00
|
|
|
@@ -1420,7 +1423,11 @@ static int __xipram do_write_buffer(stru
|
2011-04-10 18:08:28 +03:00
|
|
|
z = 0;
|
|
|
|
while(z < words * map_bankwidth(map)) {
|
|
|
|
datum = map_word_load(map, buf);
|
|
|
|
+#ifdef CONFIG_AMAZON
|
|
|
|
+ map_write(map, datum, (adr + z) ^ 0x2);
|
|
|
|
+#else
|
|
|
|
map_write(map, datum, adr + z);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
z += map_bankwidth(map);
|
|
|
|
buf += map_bankwidth(map);
|
2012-05-13 18:10:40 +03:00
|
|
|
@@ -1665,6 +1672,9 @@ static int __xipram do_erase_oneblock(st
|
2011-04-10 18:08:28 +03:00
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
adr += chip->start;
|
|
|
|
+#ifdef CONFIG_AMAZON
|
|
|
|
+ adr ^= 2;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
mutex_lock(&chip->mutex);
|
|
|
|
ret = get_chip(map, chip, adr, FL_ERASING);
|
2012-05-13 18:10:40 +03:00
|
|
|
@@ -1793,6 +1803,10 @@ static int do_atmel_lock(struct map_info
|
2011-04-10 18:08:28 +03:00
|
|
|
struct cfi_private *cfi = map->fldrv_priv;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
+#ifdef CONFIG_AMAZON
|
|
|
|
+ adr ^= 2;
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
mutex_lock(&chip->mutex);
|
|
|
|
ret = get_chip(map, chip, adr + chip->start, FL_LOCKING);
|
|
|
|
if (ret)
|
2012-05-13 18:10:40 +03:00
|
|
|
@@ -1828,6 +1842,10 @@ static int do_atmel_unlock(struct map_in
|
2011-04-10 18:08:28 +03:00
|
|
|
struct cfi_private *cfi = map->fldrv_priv;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
+#ifdef CONFIG_AMAZON
|
|
|
|
+ adr ^= 2;
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
mutex_lock(&chip->mutex);
|
|
|
|
ret = get_chip(map, chip, adr + chip->start, FL_UNLOCKING);
|
|
|
|
if (ret)
|