summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2018-02-11 19:41:05 +0100
committerMartin Roth <martinroth@google.com>2018-02-20 23:21:20 +0000
commit950332b6e4c736bf948d2ebe8721bde568f5dfc0 (patch)
treeb624ae56cff0a1da46fbef96ec5f920381d367e6 /src
parent7be74dbb38e41534055dbb27837e61f480c7db56 (diff)
driver/spi: Warn when probed SF size differs from CONFIG_ROM_SIZE
Some assumptions are made with respect to CONFIG_ROM_SIZE being the actual size of the boot medium, e.g. when automatically creating an fmap with and RW_MRC_CACHE region. With this patch the user is warned when this is detected. Change-Id: Ib5d6cc61ea29214d338d4c52ff799d6620a9cac7 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/23695 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/spi/spi_flash.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c
index 93335de24a..f0f119addb 100644
--- a/src/drivers/spi/spi_flash.c
+++ b/src/drivers/spi/spi_flash.c
@@ -374,6 +374,12 @@ int spi_flash_probe(unsigned int bus, unsigned int cs, struct spi_flash *flash)
printk(BIOS_INFO, "SF: Detected %s with sector size 0x%x, total 0x%x\n",
flash->name, flash->sector_size, flash->size);
+ if (bus == CONFIG_BOOT_DEVICE_SPI_FLASH_BUS
+ && flash->size != CONFIG_ROM_SIZE) {
+ printk(BIOS_ERR, "SF size 0x%x does not correspond to"
+ " CONFIG_ROM_SIZE 0x%x!!\n", flash->size,
+ CONFIG_ROM_SIZE);
+ }
return 0;
}