From 730e7e74ebf11560d1c852934b18e98d1200ce53 Mon Sep 17 00:00:00 2001 From: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Date: Wed, 1 May 2013 14:04:19 +0000 Subject: [PATCH] Update spi_get_erasefn_from_opcode() We forgot to add a few SPI erase functions to the helper function that is used for SFDP. Also, sort the declarations in the header. Corresponding to flashrom svn r1672. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> --- chipdrivers.h | 6 +++--- spi25.c | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/chipdrivers.h b/chipdrivers.h index 243b64a..dd20631 100644 --- a/chipdrivers.h +++ b/chipdrivers.h @@ -45,12 +45,12 @@ int spi_write_disable(struct flashctx *flash); int spi_block_erase_20(struct flashctx *flash, unsigned int addr, unsigned int blocklen); int spi_block_erase_50(struct flashctx *flash, unsigned int addr, unsigned int blocklen); int spi_block_erase_52(struct flashctx *flash, unsigned int addr, unsigned int blocklen); -int spi_block_erase_81(struct flashctx *flash, unsigned int addr, unsigned int blocklen); -int spi_block_erase_d7(struct flashctx *flash, unsigned int addr, unsigned int blocklen); -int spi_block_erase_d8(struct flashctx *flash, unsigned int addr, unsigned int blocklen); int spi_block_erase_60(struct flashctx *flash, unsigned int addr, unsigned int blocklen); int spi_block_erase_62(struct flashctx *flash, unsigned int addr, unsigned int blocklen); +int spi_block_erase_81(struct flashctx *flash, unsigned int addr, unsigned int blocklen); int spi_block_erase_c7(struct flashctx *flash, unsigned int addr, unsigned int blocklen); +int spi_block_erase_d7(struct flashctx *flash, unsigned int addr, unsigned int blocklen); +int spi_block_erase_d8(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, uint8_t *buf, unsigned int start, unsigned int len); int spi_byte_program(struct flashctx *flash, unsigned int addr, uint8_t databyte); diff --git a/spi25.c b/spi25.c index a818630..4f1452e 100644 --- a/spi25.c +++ b/spi25.c @@ -729,10 +729,16 @@ erasefunc_t *spi_get_erasefn_from_opcode(uint8_t opcode) return NULL; case 0x20: return &spi_block_erase_20; + case 0x50: + return &spi_block_erase_50; case 0x52: return &spi_block_erase_52; case 0x60: return &spi_block_erase_60; + case 0x62: + return &spi_block_erase_62; + case 0x81: + return &spi_block_erase_81; case 0xc7: return &spi_block_erase_c7; case 0xd7: -- GitLab