1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 22:43:17 +02:00

tree/: Convert flashchips db to use indirection for erase_block

This paves the way to allow for the conversion of flashchip erase_block
func ptr to enumerate values. This change should be a NOP.

TEST=`diff -u <(objdump -D flashchips.o_bk) <(objdump -D flashchips.o)`.

Change-Id: I122295ec9add0fe0efd27273c9725e5d64f6dbe2
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69131
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Edward O'Callaghan
2022-11-02 12:15:38 +11:00
committed by Edward O'Callaghan
parent 2f0e49c2ab
commit 3c44e12a28
9 changed files with 2007 additions and 1971 deletions

32
spi25.c
View File

@ -622,21 +622,21 @@ static const struct {
erasefunc_t *func;
uint8_t opcode;
} function_opcode_list[] = {
{&spi_block_erase_20, 0x20},
{&spi_block_erase_21, 0x21},
{&spi_block_erase_50, 0x50},
{&spi_block_erase_52, 0x52},
{&spi_block_erase_53, 0x53},
{&spi_block_erase_5c, 0x5c},
{&spi_block_erase_60, 0x60},
{&spi_block_erase_62, 0x62},
{&spi_block_erase_81, 0x81},
{&spi_block_erase_c4, 0xc4},
{&spi_block_erase_c7, 0xc7},
{&spi_block_erase_d7, 0xd7},
{&spi_block_erase_d8, 0xd8},
{&spi_block_erase_db, 0xdb},
{&spi_block_erase_dc, 0xdc},
{SPI_BLOCK_ERASE_20, 0x20},
{SPI_BLOCK_ERASE_21, 0x21},
{SPI_BLOCK_ERASE_50, 0x50},
{SPI_BLOCK_ERASE_52, 0x52},
{SPI_BLOCK_ERASE_53, 0x53},
{SPI_BLOCK_ERASE_5C, 0x5c},
{SPI_BLOCK_ERASE_60, 0x60},
{SPI_BLOCK_ERASE_62, 0x62},
{SPI_BLOCK_ERASE_81, 0x81},
{SPI_BLOCK_ERASE_C4, 0xc4},
{SPI_BLOCK_ERASE_C7, 0xc7},
{SPI_BLOCK_ERASE_D7, 0xd7},
{SPI_BLOCK_ERASE_D8, 0xd8},
{SPI_BLOCK_ERASE_DB, 0xdb},
{SPI_BLOCK_ERASE_DC, 0xdc},
};
erasefunc_t *spi_get_erasefn_from_opcode(uint8_t opcode)
@ -648,7 +648,7 @@ erasefunc_t *spi_get_erasefn_from_opcode(uint8_t opcode)
}
msg_cinfo("%s: unknown erase opcode (0x%02x). Please report "
"this at flashrom@flashrom.org\n", __func__, opcode);
return NULL;
return NO_BLOCK_ERASE_FUNC;
}
uint8_t spi_get_opcode_from_erasefn(erasefunc_t *func)