soc/amd/common/block/spi/fch_spi_ctrl: handle failure in execute_command
When wait_for_ready returned a timeout, execute_command still ended up returning success. Fix this be returning a failure in this case. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Id012e74e26065c12d003793322dcdd448df758b0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/60119 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
parent
a3930dafd4
commit
1105fe8913
|
@ -97,9 +97,10 @@ static int execute_command(void)
|
||||||
|
|
||||||
spi_write8(SPI_CMD_TRIGGER, SPI_CMD_TRIGGER_EXECUTE);
|
spi_write8(SPI_CMD_TRIGGER, SPI_CMD_TRIGGER_EXECUTE);
|
||||||
|
|
||||||
if (wait_for_ready())
|
if (wait_for_ready()) {
|
||||||
printk(BIOS_ERR,
|
printk(BIOS_ERR, "FCH_SC Error: Timeout executing command\n");
|
||||||
"FCH_SC Error: Timeout executing command\n");
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
dump_state(SPI_DUMP_STATE_AFTER_CMD);
|
dump_state(SPI_DUMP_STATE_AFTER_CMD);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue