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>
This commit is contained in:
Arthur Heymans 2018-02-11 19:41:05 +01:00 committed by Martin Roth
parent 7be74dbb38
commit 950332b6e4
1 changed files with 6 additions and 0 deletions

View File

@ -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;
}