diff options
author | Ed Swierk <eswierk@arastra.com> | 2007-08-13 04:10:32 +0000 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2007-08-13 04:10:32 +0000 |
commit | 966dc20cc330ba90a8e51e52c70303e41045ff9e (patch) | |
tree | 76faa3413630810abdf24d11ab70c2e98ddd82ce /sst28sf040.c | |
parent | fdd0c58115bb30a40ecda990b5fa0c7de1f9785b (diff) | |
download | flashrom-git-966dc20cc330ba90a8e51e52c70303e41045ff9e.tar.gz |
Fix bug in probe_28sf040() causing flash corruption on SST49LF160C verify
The first byte of the flash chip was read at the start of the function
and later written back to address 0 if the flash chip was not identified
as SST28SF040, which means most of the time. This write caused corruption
of flash contents when verifying a SST49LF160C part.
Corresponding to flashrom svn r126 and coreboot v2 svn r2744.
Signed-off-by: Ed Swierk <eswierk@arastra.com>
Acked-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'sst28sf040.c')
-rw-r--r-- | sst28sf040.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/sst28sf040.c b/sst28sf040.c index f2d8167d..c8f71f81 100644 --- a/sst28sf040.c +++ b/sst28sf040.c @@ -106,10 +106,7 @@ static __inline__ int write_sector_28sf040(volatile uint8_t *bios, int probe_28sf040(struct flashchip *flash) { volatile uint8_t *bios = flash->virtual_memory; - uint8_t id1, id2, tmp; - - /* save the value at the beginning of the Flash */ - tmp = *bios; + uint8_t id1, id2; *bios = RESET; myusec_delay(10); @@ -127,8 +124,6 @@ int probe_28sf040(struct flashchip *flash) if (id1 == flash->manufacture_id && id2 == flash->model_id) return 1; - /* if there is no SST28SF040, restore the original value */ - *bios = tmp; return 0; } |