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:
committed by
Martin Roth
parent
1264d64a74
commit
f957201cf0
@ -1038,8 +1038,7 @@ static int spi_flash_protect(const struct spi_flash *flash,
|
|||||||
|
|
||||||
/* Set the FPR register and verify it is protected */
|
/* Set the FPR register and verify it is protected */
|
||||||
write32(&fpr_base[fpr], reg);
|
write32(&fpr_base[fpr], reg);
|
||||||
reg = read32(&fpr_base[fpr]);
|
if (reg != read32(&fpr_base[fpr])) {
|
||||||
if (!(reg & protect_mask)) {
|
|
||||||
printk(BIOS_ERR, "ERROR: Unable to set SPI FPR %d\n", fpr);
|
printk(BIOS_ERR, "ERROR: Unable to set SPI FPR %d\n", fpr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user