summaryrefslogtreecommitdiffstats
path: root/sst28sf040.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 /sst28sf040.c
parent21f54963611aa0f3ee3ad16a45395d0cec8363f1 (diff)
downloadflashrom-51c83fb2b204a369e1b1825b66c56e5babcf8022.tar.gz
flashrom-51c83fb2b204a369e1b1825b66c56e5babcf8022.tar.bz2
flashrom-51c83fb2b204a369e1b1825b66c56e5babcf8022.zip
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 'sst28sf040.c')
-rw-r--r--sst28sf040.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sst28sf040.c b/sst28sf040.c
index 930ad5bee..f253e39ea 100644
--- a/sst28sf040.c
+++ b/sst28sf040.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2000 Silicon Integrated System Corporation
* Copyright (C) 2005 coresystems GmbH <stepan@openbios.org>
+ * 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
@@ -50,7 +51,7 @@ static void unprotect_28sf040(chipaddr bios)
chip_readb(bios + 0x041A);
}
-static int erase_sector_28sf040(struct flashchip *flash, unsigned long address, int sector_size)
+int erase_sector_28sf040(struct flashchip *flash, unsigned int address, unsigned int sector_size)
{
chipaddr bios = flash->virtual_memory;
@@ -67,7 +68,7 @@ static int erase_sector_28sf040(struct flashchip *flash, unsigned long address,
return 0;
}
-static int write_sector_28sf040(chipaddr bios, uint8_t *src, chipaddr dst,
+int write_sector_28sf040(chipaddr bios, uint8_t *src, chipaddr dst,
unsigned int page_size)
{
int i;
@@ -162,3 +163,13 @@ int write_28sf040(struct flashchip *flash, uint8_t *buf)
return 0;
}
+
+int erase_chip_28sf040(struct flashchip *flash, unsigned int addr, unsigned int blocklen)
+{
+ if ((addr != 0) || (blocklen != flash->total_size * 1024)) {
+ fprintf(stderr, "%s called with incorrect arguments\n",
+ __func__);
+ return -1;
+ }
+ return erase_28sf040(flash);
+}