diff options
author | Thomas Heijligen <thomas.heijligen@secunet.com> | 2022-09-19 23:46:58 +0200 |
---|---|---|
committer | Thomas Heijligen <src@posteo.de> | 2022-12-14 10:54:36 +0000 |
commit | d1e97db8a2fbb13cbe4b19795adb677746b371e8 (patch) | |
tree | d9fbf1a22d3fd0a7f40605ae2ef92f74549a3131 | |
parent | cb99e8a68bd0e5c91a97ed2b4a5bf0731ff983a8 (diff) | |
download | flashrom-d1e97db8a2fbb13cbe4b19795adb677746b371e8.tar.gz flashrom-d1e97db8a2fbb13cbe4b19795adb677746b371e8.tar.bz2 flashrom-d1e97db8a2fbb13cbe4b19795adb677746b371e8.zip |
spi25.c: Rename spi_get_erasefn_from_opcode to spi25_get_erasefn_from_opcode
This function works only with spi25 chips
Change-Id: Ie054160b0fdd34bcb128285c6a047e3a3fa8be0c
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67716
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | include/chipdrivers.h | 2 | ||||
-rw-r--r-- | sfdp.c | 2 | ||||
-rw-r--r-- | spi25.c | 10 |
3 files changed, 7 insertions, 7 deletions
diff --git a/include/chipdrivers.h b/include/chipdrivers.h index 34e3af8d..d2e13b4e 100644 --- a/include/chipdrivers.h +++ b/include/chipdrivers.h @@ -52,7 +52,7 @@ 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); -enum block_erase_func spi_get_erasefn_from_opcode(uint8_t opcode); +enum block_erase_func spi25_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); @@ -81,7 +81,7 @@ static int sfdp_add_uniform_eraser(struct flashchip *chip, uint8_t opcode, uint3 { int i; uint32_t total_size = chip->total_size * 1024; - enum block_erase_func erasefn = spi_get_erasefn_from_opcode(opcode); + enum block_erase_func erasefn = spi25_get_erasefn_from_opcode(opcode); if (erasefn == NO_BLOCK_ERASE_FUNC || total_size == 0 || block_size == 0 || total_size % block_size != 0) { @@ -621,7 +621,7 @@ int spi_block_erase_dc(struct flashctx *flash, unsigned int addr, unsigned int b static const struct { enum block_erase_func func; uint8_t opcode; -} function_opcode_list[] = { +} spi25_function_opcode_list[] = { {SPI_BLOCK_ERASE_20, 0x20}, {SPI_BLOCK_ERASE_21, 0x21}, {SPI_BLOCK_ERASE_50, 0x50}, @@ -639,12 +639,12 @@ static const struct { {SPI_BLOCK_ERASE_DC, 0xdc}, }; -enum block_erase_func spi_get_erasefn_from_opcode(uint8_t opcode) +enum block_erase_func spi25_get_erasefn_from_opcode(uint8_t opcode) { size_t i; - for (i = 0; i < ARRAY_SIZE(function_opcode_list); i++) { - if (function_opcode_list[i].opcode == opcode) - return function_opcode_list[i].func; + for (i = 0; i < ARRAY_SIZE(spi25_function_opcode_list); i++) { + if (spi25_function_opcode_list[i].opcode == opcode) + return spi25_function_opcode_list[i].func; } msg_cinfo("%s: unknown erase opcode (0x%02x). Please report " "this at flashrom@flashrom.org\n", __func__, opcode); |