summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Swierk <eswierk@arastra.com>2007-08-13 04:10:32 +0000
committerPeter Stuge <peter@stuge.se>2007-08-13 04:10:32 +0000
commit3436698b6a91a921d7091d141b01c396bdc25dc1 (patch)
treef6b80d9c28900cd14ca1cb5a07cf00d2c937f9e2
parent4d43255bef8ca14f707c1e21dd42d8a6afdf991c (diff)
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. Signed-off-by: Ed Swierk <eswierk@arastra.com> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2744 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r--util/flashrom/sst28sf040.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/util/flashrom/sst28sf040.c b/util/flashrom/sst28sf040.c
index f2d8167de0..c8f71f814e 100644
--- a/util/flashrom/sst28sf040.c
+++ b/util/flashrom/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;
}