diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2014-08-03 14:15:14 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2014-08-03 14:15:14 +0000 |
commit | 03a9c3c1bbfd1548888ff6386c30165efc4c7c00 (patch) | |
tree | f10ff5edf6a8424d672f6774a00d03b51308629b /jedec.c | |
parent | 7de939325b1c984eefdc65d079b6fe4416c86a12 (diff) | |
download | flashrom-03a9c3c1bbfd1548888ff6386c30165efc4c7c00.tar.gz flashrom-03a9c3c1bbfd1548888ff6386c30165efc4c7c00.tar.bz2 flashrom-03a9c3c1bbfd1548888ff6386c30165efc4c7c00.zip |
Add support for a bunch of 29GL parallel flash chips
29GL chips use a new 3-Byte device ID probing function at addresses
0x01, 0x0E, 0x0F.
Flash chip families supported by this method include...
- EON EN29GL
- Gigadevice GD29GL (if they really exist)
- ISSI (PMC) IS29GL
- Macronix MX29GL (+MX68GL1G0F)
- Spansion S29GL (+S70GL02G)
- Winbond W29GL
This patch adds respective flash chip definitions for chips up to 16 MB from
Eon, ISSI, Macronix and Winbond. Bigger chips as well as those from
Gigadevice and Spansion are left out.
Corresponding to flashrom svn r1835.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'jedec.c')
-rw-r--r-- | jedec.c | 49 |
1 files changed, 49 insertions, 0 deletions
@@ -121,6 +121,55 @@ static void start_program_jedec_common(const struct flashctx *flash, unsigned in chip_writeb(flash, 0xA0, bios + (0x5555 & mask)); } +int probe_jedec_29gl(struct flashctx *flash) +{ + unsigned int mask = getaddrmask(flash->chip); + chipaddr bios = flash->virtual_memory; + const struct flashchip *chip = flash->chip; + + /* Reset chip to a clean slate */ + chip_writeb(flash, 0xF0, bios + (0x5555 & mask)); + + /* Issue JEDEC Product ID Entry command */ + chip_writeb(flash, 0xAA, bios + (0x5555 & mask)); + chip_writeb(flash, 0x55, bios + (0x2AAA & mask)); + chip_writeb(flash, 0x90, bios + (0x5555 & mask)); + + /* Read product ID */ + // FIXME: Continuation loop, second byte is at word 0x100/byte 0x200 + uint32_t man_id = chip_readb(flash, bios + 0x00); + uint32_t dev_id = (chip_readb(flash, bios + 0x01) << 16) | + (chip_readb(flash, bios + 0x0E) << 8) | + (chip_readb(flash, bios + 0x0F) << 0); + + /* Issue JEDEC Product ID Exit command */ + chip_writeb(flash, 0xF0, bios + (0x5555 & mask)); + + msg_cdbg("%s: man_id 0x%02x, dev_id 0x%06x", __func__, man_id, dev_id); + if (!oddparity(man_id)) + msg_cdbg(", man_id parity violation"); + + /* Read the product ID location again. We should now see normal flash contents. */ + uint32_t flashcontent1 = chip_readb(flash, bios + 0x00); // FIXME: Continuation loop + uint32_t flashcontent2 = (chip_readb(flash, bios + 0x01) << 16) | + (chip_readb(flash, bios + 0x0E) << 8) | + (chip_readb(flash, bios + 0x0F) << 0); + + if (man_id == flashcontent1) + msg_cdbg(", man_id seems to be normal flash content"); + if (dev_id == flashcontent2) + msg_cdbg(", dev_id seems to be normal flash content"); + + msg_cdbg("\n"); + if (man_id != chip->manufacture_id || dev_id != chip->model_id) + return 0; + + if (chip->feature_bits & FEATURE_REGISTERMAP) + map_flash_registers(flash); + + return 1; +} + static int probe_jedec_common(struct flashctx *flash, unsigned int mask) { chipaddr bios = flash->virtual_memory; |