| 1 | --- a/drivers/mtd/chips/cfi_cmdset_0002.c |
| 2 | +++ b/drivers/mtd/chips/cfi_cmdset_0002.c |
| 3 | @@ -1107,6 +1107,9 @@ static int __xipram do_write_oneword(str |
| 4 | int retry_cnt = 0; |
| 5 | |
| 6 | adr += chip->start; |
| 7 | +#ifdef CONFIG_AMAZON |
| 8 | + adr ^= 2; |
| 9 | +#endif |
| 10 | |
| 11 | spin_lock(chip->mutex); |
| 12 | ret = get_chip(map, chip, adr, FL_WRITING); |
| 13 | @@ -1389,7 +1392,11 @@ static int __xipram do_write_buffer(stru |
| 14 | z = 0; |
| 15 | while(z < words * map_bankwidth(map)) { |
| 16 | datum = map_word_load(map, buf); |
| 17 | +#ifdef CONFIG_AMAZON |
| 18 | + map_write(map, datum, (adr + z) ^ 0x2); |
| 19 | +#else |
| 20 | map_write(map, datum, adr + z); |
| 21 | +#endif |
| 22 | |
| 23 | z += map_bankwidth(map); |
| 24 | buf += map_bankwidth(map); |
| 25 | @@ -1634,6 +1641,9 @@ static int __xipram do_erase_oneblock(st |
| 26 | int ret = 0; |
| 27 | |
| 28 | adr += chip->start; |
| 29 | +#ifdef CONFIG_AMAZON |
| 30 | + adr ^= 2; |
| 31 | +#endif |
| 32 | |
| 33 | spin_lock(chip->mutex); |
| 34 | ret = get_chip(map, chip, adr, FL_ERASING); |
| 35 | @@ -1762,6 +1772,10 @@ static int do_atmel_lock(struct map_info |
| 36 | struct cfi_private *cfi = map->fldrv_priv; |
| 37 | int ret; |
| 38 | |
| 39 | +#ifdef CONFIG_AMAZON |
| 40 | + adr ^= 2; |
| 41 | +#endif |
| 42 | + |
| 43 | spin_lock(chip->mutex); |
| 44 | ret = get_chip(map, chip, adr + chip->start, FL_LOCKING); |
| 45 | if (ret) |
| 46 | @@ -1798,6 +1812,10 @@ static int do_atmel_unlock(struct map_in |
| 47 | struct cfi_private *cfi = map->fldrv_priv; |
| 48 | int ret; |
| 49 | |
| 50 | +#ifdef CONFIG_AMAZON |
| 51 | + adr ^= 2; |
| 52 | +#endif |
| 53 | + |
| 54 | spin_lock(chip->mutex); |
| 55 | ret = get_chip(map, chip, adr + chip->start, FL_UNLOCKING); |
| 56 | if (ret) |
| 57 | |