diff options
author | Nico Huber <nico.h@gmx.de> | 2017-10-14 16:50:43 +0200 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2017-12-28 10:42:49 +0000 |
commit | 0ecbacbfca7f919f1780f5062c775d94c7869d81 (patch) | |
tree | 2f84f6406d00bc89dd13dfeff3e69f77671a8f9e /chipdrivers.h | |
parent | a3140d0b18058610a2694fc3592031a849b0c92a (diff) | |
download | flashrom-0ecbacbfca7f919f1780f5062c775d94c7869d81.tar.gz flashrom-0ecbacbfca7f919f1780f5062c775d94c7869d81.tar.bz2 flashrom-0ecbacbfca7f919f1780f5062c775d94c7869d81.zip |
spi25: Use common code for nbyte read/write and block erase
Introduce spi_prepare_address() and spi_write_cmd() and use them in
nbyte_program, nbyte_read and block-erase procedures. The former
abstracts over the address part of a SPI command to make it exten-
sible for 4-byte adressing. spi_write_cmd() implements a WREN + write
operation with address and optionally up to 256 bytes of data. It
provides a common path to reduce overall redundancy.
Also, reduce the polling delay in spi_block_erase_c4() from 500s to
500ms as the comment suggests.
Change-Id: Ibc1ae48acbfbd427a30bcd64bdc080dc3dc20503
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/22383
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Diffstat (limited to 'chipdrivers.h')
-rw-r--r-- | chipdrivers.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/chipdrivers.h b/chipdrivers.h index 16a75a910..12fc5a325 100644 --- a/chipdrivers.h +++ b/chipdrivers.h @@ -55,8 +55,6 @@ int spi_block_erase_d8(struct flashctx *flash, unsigned int addr, unsigned int b int spi_block_erase_db(struct flashctx *flash, unsigned int addr, unsigned int blocklen); erasefunc_t *spi_get_erasefn_from_opcode(uint8_t opcode); int spi_chip_write_1(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); -int spi_byte_program(struct flashctx *flash, unsigned int addr, uint8_t databyte); -int spi_nbyte_program(struct flashctx *flash, unsigned int addr, const uint8_t *bytes, unsigned int len); int spi_nbyte_read(struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len); int spi_read_chunked(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len, unsigned int chunksize); int spi_write_chunked(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len, unsigned int chunksize); |