path: root/flash.h
diff options
authorCarl-Daniel Hailfinger <>2008-11-03 00:02:11 +0000
committerCarl-Daniel Hailfinger <>2008-11-03 00:02:11 +0000
commit6afb613fefbd4b484babafa9680b9570aadb255d (patch)
tree582cf605e44d2d9c92de406d11cf850dd83b9fff /flash.h
parent4311956a807be357848216d5fdf665053b7ca524 (diff)
Add additional SPI sector erase and chip erase command functions
Not all chips support all commands, so allow the implementer to select the matching function. Fix a layering violation in ICH SPI code to be less bad. Still not perfect, but the new code is shorter, more generic and architecturally more sound. TODO (in a separate patch): - move the generic sector erase code to spi.c - decide which erase command to use based on info about the chip - create a generic spi_erase_all_sectors function which calls the generic sector erase function Thanks to Stefan for reviewing and commenting. Corresponding to flashrom svn r337 and coreboot v2 svn r3722. Signed-off-by: Carl-Daniel Hailfinger <> Acked-by: Stefan Reinauer <>
Diffstat (limited to 'flash.h')
1 files changed, 3 insertions, 0 deletions
diff --git a/flash.h b/flash.h
index 769b8d0..5010837 100644
--- a/flash.h
+++ b/flash.h
@@ -424,8 +424,11 @@ int spi_command(unsigned int writecnt, unsigned int readcnt,
const unsigned char *writearr, unsigned char *readarr);
void spi_write_enable();
void spi_write_disable();
+int spi_chip_erase_60(struct flashchip *flash);
int spi_chip_erase_c7(struct flashchip *flash);
int spi_chip_erase_d8(struct flashchip *flash);
+int spi_block_erase_52(const struct flashchip *flash, unsigned long addr);
+int spi_block_erase_d8(const struct flashchip *flash, unsigned long addr);
int spi_chip_write(struct flashchip *flash, uint8_t *buf);
int spi_chip_read(struct flashchip *flash, uint8_t *buf);
uint8_t spi_read_status_register();
OpenPOWER on IntegriCloud