1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 14:33:18 +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

4
sfdp.c
View File

@ -83,7 +83,7 @@ static int sfdp_add_uniform_eraser(struct flashchip *chip, uint8_t opcode, uint3
uint32_t total_size = chip->total_size * 1024;
erasefunc_t *erasefn = spi_get_erasefn_from_opcode(opcode);
if (erasefn == NULL || total_size == 0 || block_size == 0 ||
if (erasefn == NO_BLOCK_ERASE_FUNC || total_size == 0 || block_size == 0 ||
total_size % block_size != 0) {
msg_cdbg("%s: invalid input, please report to "
"flashrom@flashrom.org\n", __func__);
@ -101,7 +101,7 @@ static int sfdp_add_uniform_eraser(struct flashchip *chip, uint8_t opcode, uint3
return 1;
}
if (eraser->eraseblocks[0].size != 0 ||
eraser->block_erase != NULL) {
eraser->block_erase != NO_BLOCK_ERASE_FUNC) {
msg_cspew(" Block Eraser %d is already occupied.\n",
i);
continue;