summaryrefslogtreecommitdiffstats
path: root/sst_fwhub.c
diff options
context:
space:
mode:
authorSean Nelson <audiohacked@gmail.com>2010-01-20 20:55:53 +0000
committerSean Nelson <audiohacked@gmail.com>2010-01-20 20:55:53 +0000
commit51c83fb2b204a369e1b1825b66c56e5babcf8022 (patch)
treeaf901ed6d2a2214445035d483c29492217ee7727 /sst_fwhub.c
parent21f54963611aa0f3ee3ad16a45395d0cec8363f1 (diff)
downloadast2050-flashrom-51c83fb2b204a369e1b1825b66c56e5babcf8022.zip
ast2050-flashrom-51c83fb2b204a369e1b1825b66c56e5babcf8022.tar.gz
Convert various SST chips to use block_erasers
Convert the following chips to block_erasers: SST28SF040A SST29EE010 SST29LE010 SST29EE020A SST29LE020 SST39SF010A SST39SF020A SST39SF040 SST39VF512 SST39VF010 SST39VF020 SST39VF040 SST39VF080 SST49LF002A/B SST49LF003A/B SST49LF004C SST49LF008A SST49LF008C SST49LF016C SST49LF020 SST49LF020A SST49LF040 SST49LF040B SST49LF080A SST49LF160C . Extend sst28sf040 to include chip and sector functions for block_eraser. Extend sst49lfxxxc to include chip, sector, block erasers functions for block_erasers. Extend sst_fwhub to include chip and sector functions for block_erasers. Add copyrights to changed files. Killed erase_sst_fwhub. Killed erase_49lfxxxc. NULL A/A mux mode full chip erasers. Ignore block locks in erase/write. Change comments from "PP mode" to "A/A mux mode" Corresponding to flashrom svn r877. Signed-off-by: Sean Nelson <audiohacked@gmail.com> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Diffstat (limited to 'sst_fwhub.c')
-rw-r--r--sst_fwhub.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sst_fwhub.c b/sst_fwhub.c
index b29722f..75d9e05 100644
--- a/sst_fwhub.c
+++ b/sst_fwhub.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2000 Silicon Integrated System Corporation
* Copyright (C) 2009 Kontron Modular Computers
+ * Copyright (C) 2009 Sean Nelson <audiohacked@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -114,6 +115,25 @@ int erase_sst_fwhub_block(struct flashchip *flash, unsigned int offset, unsigned
return 0;
}
+int erase_sst_fwhub_sector(struct flashchip *flash, unsigned int offset, unsigned int page_size)
+{
+ uint8_t blockstatus = clear_sst_fwhub_block_lock(flash, offset);
+
+ if (blockstatus) {
+ printf("Sector lock clearing failed, not erasing sector "
+ "at 0x%06x\n", offset);
+ return 1;
+ }
+
+ if (erase_sector_jedec(flash, offset, page_size)) {
+ fprintf(stderr, "ERASE FAILED!\n");
+ return -1;
+ }
+ toggle_ready_jedec(flash->virtual_memory);
+
+ return 0;
+}
+
int erase_sst_fwhub(struct flashchip *flash)
{
int i;
OpenPOWER on IntegriCloud