Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/84567?usp=email )
Change subject: ichspi: Change the opcode position for reprogramming on the fly 2->4 ......................................................................
ichspi: Change the opcode position for reprogramming on the fly 2->4
The function for reprogramming on the fly was using the default configuration O_ST_M25P as a base and the position 2 as the position to reprogram. Position 2 corresponds to JEDEC_SE which is often useful for chip erase (when less than whole chip needs to be erased).
This patch changes the default position to reprogram to 4, which corresponds to JEDEC_REMS. It is used less often, but if it needs to be used, it will be discovered missing and reprogrammed back.
For erase opcodes, there is usually several of them available. So if one is missing, erase still can be performed with the remaining ones. However, this hides the fact that one of available erase opcodes is missing (it won't be reprogrammed back), and also it gives non-optimal erase layout.
Context: https://ticket.coreboot.org/issues/556
Change-Id: I6bc855daedf0af2e8de191f23a3512de3ebc3fef Signed-off-by: Anastasia Klimchuk aklm@flashrom.org Reviewed-on: https://review.coreboot.org/c/flashrom/+/84567 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Nikolai Artemiev nartemiev@google.com --- M ichspi.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: Nikolai Artemiev: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/ichspi.c b/ichspi.c index d01f2f3..358d9f4 100644 --- a/ichspi.c +++ b/ichspi.c @@ -661,7 +661,7 @@ else // we have an invalid case return SPI_INVALID_LENGTH; } - int oppos = 2; // use original JEDEC_BE_D8 offset + int oppos = 4; // use the original position of JEDEC_REMS curopcodes->opcode[oppos].opcode = opcode; curopcodes->opcode[oppos].spi_type = spi_type; program_opcodes(curopcodes, 0, ich_generation);