From f957201cf08a9f53cede3567669fccb7ad330ab3 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 11 Jun 2019 11:15:10 +0200 Subject: sb/intel/common/spi: Properly check if setting FRP succeeded Change-Id: Ib0b63c3b0342c62aeabb5c6e418eb9811fc6597d Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/33389 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/southbridge/intel/common/spi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/southbridge') diff --git a/src/southbridge/intel/common/spi.c b/src/southbridge/intel/common/spi.c index d9a77c3bb5..e8c8f01407 100644 --- a/src/southbridge/intel/common/spi.c +++ b/src/southbridge/intel/common/spi.c @@ -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; } -- cgit v1.2.3