aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips/jedec_probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/chips/jedec_probe.c')
-rw-r--r--drivers/mtd/chips/jedec_probe.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c
index f84ab6182148..2f3f2f719ba4 100644
--- a/drivers/mtd/chips/jedec_probe.c
+++ b/drivers/mtd/chips/jedec_probe.c
@@ -1808,9 +1808,7 @@ static inline u32 jedec_read_mfr(struct map_info *map, uint32_t base,
1808 * several first banks can contain 0x7f instead of actual ID 1808 * several first banks can contain 0x7f instead of actual ID
1809 */ 1809 */
1810 do { 1810 do {
1811 uint32_t ofs = cfi_build_cmd_addr(0 + (bank << 8), 1811 uint32_t ofs = cfi_build_cmd_addr(0 + (bank << 8), map, cfi);
1812 cfi_interleave(cfi),
1813 cfi->device_type);
1814 mask = (1 << (cfi->device_type * 8)) - 1; 1812 mask = (1 << (cfi->device_type * 8)) - 1;
1815 result = map_read(map, base + ofs); 1813 result = map_read(map, base + ofs);
1816 bank++; 1814 bank++;
@@ -1824,7 +1822,7 @@ static inline u32 jedec_read_id(struct map_info *map, uint32_t base,
1824{ 1822{
1825 map_word result; 1823 map_word result;
1826 unsigned long mask; 1824 unsigned long mask;
1827 u32 ofs = cfi_build_cmd_addr(1, cfi_interleave(cfi), cfi->device_type); 1825 u32 ofs = cfi_build_cmd_addr(1, map, cfi);
1828 mask = (1 << (cfi->device_type * 8)) -1; 1826 mask = (1 << (cfi->device_type * 8)) -1;
1829 result = map_read(map, base + ofs); 1827 result = map_read(map, base + ofs);
1830 return result.x[0] & mask; 1828 return result.x[0] & mask;
@@ -2067,8 +2065,8 @@ static int jedec_probe_chip(struct map_info *map, __u32 base,
2067 2065
2068 } 2066 }
2069 /* Ensure the unlock addresses we try stay inside the map */ 2067 /* Ensure the unlock addresses we try stay inside the map */
2070 probe_offset1 = cfi_build_cmd_addr(cfi->addr_unlock1, cfi_interleave(cfi), cfi->device_type); 2068 probe_offset1 = cfi_build_cmd_addr(cfi->addr_unlock1, map, cfi);
2071 probe_offset2 = cfi_build_cmd_addr(cfi->addr_unlock2, cfi_interleave(cfi), cfi->device_type); 2069 probe_offset2 = cfi_build_cmd_addr(cfi->addr_unlock2, map, cfi);
2072 if ( ((base + probe_offset1 + map_bankwidth(map)) >= map->size) || 2070 if ( ((base + probe_offset1 + map_bankwidth(map)) >= map->size) ||
2073 ((base + probe_offset2 + map_bankwidth(map)) >= map->size)) 2071 ((base + probe_offset2 + map_bankwidth(map)) >= map->size))
2074 goto retry; 2072 goto retry;