diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2012-10-28 01:50:08 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2012-10-28 01:50:08 +0000 |
commit | c31243e1739a4ba21d45e3569341aa671939cb8d (patch) | |
tree | eb08f0981a4a4309725c4cb480c7a53e07d7504a /w39.c | |
parent | 78ffbeaa029fb827dcdf9c02262adbda4673e5eb (diff) | |
download | ast2050-flashrom-c31243e1739a4ba21d45e3569341aa671939cb8d.zip ast2050-flashrom-c31243e1739a4ba21d45e3569341aa671939cb8d.tar.gz |
Add support for Winbond W39F010/W39L010/W39L020
W39F010 is a 128kB parallel 5V flash chip, 16k bootblocks.
W39L010 is a 128kB parallel 3.3V flash chip, 8k bootblocks.
W39L020 is a 256kB parallel 3.3V flash chip, 64k/16k bootblocks.
The W39F010 code was tested with a satasii programmer. The first write
attempt after an erase returned with verify failure, but the second
write attempt was succesful:
http://paste.flashrom.org/view.php?id=1418
Corresponding to flashrom svn r1620.
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'w39.c')
-rw-r--r-- | w39.c | 57 |
1 files changed, 57 insertions, 0 deletions
@@ -115,6 +115,15 @@ static int printlock_w39_tblwp(uint8_t lock) return 0; } +static int printlock_w39_single_bootblock(uint8_t lock, uint16_t kB) +{ + msg_cdbg("Software %d kB bootblock locking is %sactive.\n", kB, (lock & 0x03) ? "" : "not "); + if (lock & 0x03) + return -1; + + return 0; +} + static int printlock_w39_bootblock_64k16k(uint8_t lock) { msg_cdbg("Software 64 kB bootblock locking is %sactive.\n", @@ -160,6 +169,54 @@ static int unlock_w39_fwh(struct flashctx *flash) return 0; } +int printlock_w39f010(struct flashctx *flash) +{ + uint8_t lock; + int ret; + + lock = w39_idmode_readb(flash, 0x00002); + msg_cdbg("Bottom boot block:\n"); + ret = printlock_w39_single_bootblock(lock, 16); + + lock = w39_idmode_readb(flash, 0x1fff2); + msg_cdbg("Top boot block:\n"); + ret |= printlock_w39_single_bootblock(lock, 16); + + return ret; +} + +int printlock_w39l010(struct flashctx *flash) +{ + uint8_t lock; + int ret; + + lock = w39_idmode_readb(flash, 0x00002); + msg_cdbg("Bottom boot block:\n"); + ret = printlock_w39_single_bootblock(lock, 8); + + lock = w39_idmode_readb(flash, 0x1fff2); + msg_cdbg("Top boot block:\n"); + ret |= printlock_w39_single_bootblock(lock, 8); + + return ret; +} + +int printlock_w39l020(struct flashctx *flash) +{ + uint8_t lock; + int ret; + + lock = w39_idmode_readb(flash, 0x00002); + msg_cdbg("Bottom boot block:\n"); + ret = printlock_w39_bootblock_64k16k(lock); + + lock = w39_idmode_readb(flash, 0x3fff2); + msg_cdbg("Top boot block:\n"); + ret |= printlock_w39_bootblock_64k16k(lock); + + return ret; +} + int printlock_w39l040(struct flashctx *flash) { uint8_t lock; |