diff options
author | Edward O'Callaghan <quasisec@google.com> | 2022-08-29 10:36:21 +1000 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2022-11-11 13:04:07 +0000 |
commit | 3bba710d98b60eba7ebbae0869fd58f7dc987afd (patch) | |
tree | 0a5fc97c3edad996c21b4c66828dd366e9d0792f /include/chipdrivers.h | |
parent | 3c44e12a287ce9a91cf97c3303bf4222f63d25c7 (diff) | |
download | flashrom-3bba710d98b60eba7ebbae0869fd58f7dc987afd.tar.gz flashrom-3bba710d98b60eba7ebbae0869fd58f7dc987afd.tar.bz2 flashrom-3bba710d98b60eba7ebbae0869fd58f7dc987afd.zip |
tree/: Convert flashchip erase_block func ptr to enumerate
This forges the way for flashchips.c to be pure declarative
data and lookup functions for dispatch to be pure. This
means that the flashchips data could be extracted out to
be agnostic data of the flashrom code and algorithms.
Change-Id: I02ae7e4c67c5bf34ec2fd7ffe4af8a2aba6fd5e5
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69133
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'include/chipdrivers.h')
-rw-r--r-- | include/chipdrivers.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/chipdrivers.h b/include/chipdrivers.h index 470d1fe2..3b07afe3 100644 --- a/include/chipdrivers.h +++ b/include/chipdrivers.h @@ -52,8 +52,8 @@ int spi_block_erase_d7(struct flashctx *flash, unsigned int addr, unsigned int b int spi_block_erase_d8(struct flashctx *flash, unsigned int addr, unsigned int blocklen); 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); +enum block_erase_func spi_get_erasefn_from_opcode(uint8_t opcode); +uint8_t spi_get_opcode_from_erasefn(enum block_erase_func 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); |