summaryrefslogtreecommitdiffstats
path: root/flash.h
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2007-10-18 00:24:07 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2007-10-18 00:24:07 +0000
commit6b44496c562b4c4be1ea32c7122904095210b33f (patch)
tree56258d0ba9fba8ea65739f8493936b7ec5782beb /flash.h
parenta502dcea3df45326898b99dc9f5f3744a776339d (diff)
downloadflashrom-6b44496c562b4c4be1ea32c7122904095210b33f.tar.gz
flashrom-6b44496c562b4c4be1ea32c7122904095210b33f.tar.bz2
flashrom-6b44496c562b4c4be1ea32c7122904095210b33f.zip
Add generic SPI flash erase and write support
The first chip the code was tested and verified with is the Macronix MX25L4005, but other chips should work as well. Timeouts are still hardcoded to data sheet maxima, but the status register checking code is already there. Thanks to Harald Gutmann for the initial code on which this is loosely based. Corresponding to flashrom svn r152 and coreboot v2 svn r2874. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de>
Diffstat (limited to 'flash.h')
-rw-r--r--flash.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/flash.h b/flash.h
index 0e419fff6..1fd864bd3 100644
--- a/flash.h
+++ b/flash.h
@@ -210,6 +210,11 @@ extern char *lb_part, *lb_vendor;
/* spi.c */
int probe_spi(struct flashchip *flash);
int it87xx_probe_spi_flash(const char *name);
+int generic_spi_command(unsigned char writecnt, unsigned char readcnt, const unsigned char *writearr, unsigned char *readarr);
+void generic_spi_write_enable();
+void generic_spi_write_disable();
+int generic_spi_chip_erase(struct flashchip *flash);
+int generic_spi_chip_write(struct flashchip *flash, uint8_t *buf);
/* 82802ab.c */
int probe_82802ab(struct flashchip *flash);