sb/intel/common/spi: Properly check if setting FRP succeeded

Change-Id: Ib0b63c3b0342c62aeabb5c6e418eb9811fc6597d
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33389
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Arthur Heymans 2019-06-11 11:15:10 +02:00 committed by Martin Roth
parent 1264d64a74
commit f957201cf0
1 changed files with 1 additions and 2 deletions

View File

@ -1038,8 +1038,7 @@ static int spi_flash_protect(const struct spi_flash *flash,
/* Set the FPR register and verify it is protected */
write32(&fpr_base[fpr], reg);
reg = read32(&fpr_base[fpr]);
if (!(reg & protect_mask)) {
if (reg != read32(&fpr_base[fpr])) {
printk(BIOS_ERR, "ERROR: Unable to set SPI FPR %d\n", fpr);
return -1;
}