Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106401
b: refs/heads/master
c: 5c9c11e
h: refs/heads/master
i:
  106399: d2254be
v: v3
  • Loading branch information
Mike Rapoport authored and David Woodhouse committed Jun 4, 2008
1 parent b9d4729 commit 8af107b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8fd310a1cc3aadb7a17d844beeefae66b1a169c6
refs/heads/master: 5c9c11e1c47c2101253a95c54ef72e13edcc728a
19 changes: 16 additions & 3 deletions trunk/drivers/mtd/chips/jedec_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#define MANUFACTURER_ST 0x0020
#define MANUFACTURER_TOSHIBA 0x0098
#define MANUFACTURER_WINBOND 0x00da
#define CONTINUATION_CODE 0x007f


/* AMD */
Expand Down Expand Up @@ -1760,9 +1761,21 @@ static inline u32 jedec_read_mfr(struct map_info *map, uint32_t base,
{
map_word result;
unsigned long mask;
u32 ofs = cfi_build_cmd_addr(0, cfi_interleave(cfi), cfi->device_type);
mask = (1 << (cfi->device_type * 8)) -1;
result = map_read(map, base + ofs);
int bank = 0;

/* According to JEDEC "Standard Manufacturer's Identification Code"
* (http://www.jedec.org/download/search/jep106W.pdf)
* several first banks can contain 0x7f instead of actual ID
*/
do {
uint32_t ofs = cfi_build_cmd_addr(0 + (bank << 8),
cfi_interleave(cfi),
cfi->device_type);
mask = (1 << (cfi->device_type * 8)) - 1;
result = map_read(map, base + ofs);
bank++;
} while ((result.x[0] & mask) == CONTINUATION_CODE);

return result.x[0] & mask;
}

Expand Down

0 comments on commit 8af107b

Please sign in to comment.