1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 14:11:15 +02:00

Fix FEATURE_NO_ERASE chips and add test for them

New check was added to `check_block_eraser` in
commit 0f389aea9e but it was not
handling FEATURE_NO_ERASE chips.

This patch fixes processing such chips and adds test to run
write and verify with dummyflasher for FEATURE_NO_ERASE chips.

Ticket: https://ticket.coreboot.org/issues/553

Change-Id: I582fe00da0715e9b5e92fcc9d15d5a90a2615117
Signed-off-by: Anastasia Klimchuk <aklm@flashrom.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/84203
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
This commit is contained in:
Anastasia Klimchuk
2024-09-04 13:27:32 +10:00
parent d71e88ecfb
commit b6b0eba310
5 changed files with 80 additions and 7 deletions

View File

@ -484,14 +484,15 @@ int check_block_eraser(const struct flashctx *flash, int k, int log)
if (flash->mst->buses_supported & BUS_SPI) {
const uint8_t *opcode = spi_get_opcode_from_erasefn(eraser.block_erase);
for (int i = 0; opcode[i]; i++) {
if (!spi_probe_opcode(flash, opcode[i])) {
if (log)
msg_cdbg("block erase function and layout found "
"but SPI master doesn't support the function. ");
return 1;
if (opcode)
for (int i = 0; opcode[i]; i++) {
if (!spi_probe_opcode(flash, opcode[i])) {
if (log)
msg_cdbg("block erase function and layout found "
"but SPI master doesn't support the function. ");
return 1;
}
}
}
}
// TODO: Once erase functions are annotated with allowed buses, check that as well.
return 0;