diff options
Diffstat (limited to 'src/drivers/spi/spi_flash.c')
-rw-r--r-- | src/drivers/spi/spi_flash.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c index 4757486bf5..7116cbfd99 100644 --- a/src/drivers/spi/spi_flash.c +++ b/src/drivers/spi/spi_flash.c @@ -281,7 +281,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs, /* search the table for matches in shift and id */ for (i = 0; i < ARRAY_SIZE(flashes); ++i) if (flashes[i].shift == shift && flashes[i].idcode == *idp) { -#ifdef __SMM__ +#if CONFIG_SMM_TSEG && defined(__SMM__) /* Need to relocate this function */ tseg_relocate((void **)&flashes[i].probe); #endif @@ -296,6 +296,14 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs, goto err_manufacturer_probe; } +#if CONFIG_SMM_TSEG && defined(__SMM__) + /* Ensure flash handlers are valid for TSEG */ + tseg_relocate((void **)&flash->read); + tseg_relocate((void **)&flash->write); + tseg_relocate((void **)&flash->erase); + tseg_relocate((void **)&flash->name); +#endif + printk(BIOS_INFO, "SF: Detected %s with page size %x, total %x\n", flash->name, flash->sector_size, flash->size); |