From d41595e207107f3716535f6fb128a32db6c2fefa Mon Sep 17 00:00:00 2001 From: Aarya Chaumal Date: Thu, 23 Jun 2022 16:21:23 +0530 Subject: spi25.c: Add function to return opcode of passed erase fucntion pointer There is a function, spi_get_erasefn_from_opcode, which returns the erase function for given opcode. Add a function which does the opposite i.e. returns the opcode for given erase function. Change-Id: Ia3aefc9b9465efdd16b1678bb2ada9a23f00d316 Signed-off-by: Aarya Chaumal Reviewed-on: https://review.coreboot.org/c/flashrom/+/65355 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Thomas Heijligen --- include/chipdrivers.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/chipdrivers.h b/include/chipdrivers.h index 2ef7f183..61d43c9f 100644 --- a/include/chipdrivers.h +++ b/include/chipdrivers.h @@ -53,6 +53,7 @@ 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); int spi_block_erase_dc(struct flashctx *flash, unsigned int addr, unsigned int blocklen); erasefunc_t *spi_get_erasefn_from_opcode(uint8_t opcode); +uint8_t spi_get_opcode_from_erasefn(erasefunc_t *func); int spi_chip_write_1(struct flashctx *flash, const uint8_t *buf, unsigned int start, 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); -- cgit v1.2.3