SPI: Fix and enable Fast Read support

- Fix handling of 5-byte Fast Read command in the ICH SPI
driver.  This fix is ported from the U-boot driver.
- Allow CONFIG_SPI_FLASH_NO_FAST_READ to be overridden by
defining a name for the bool in Kconfig and removing the
forced select in southbridge config
- Fix use of CONFIG_SPI_FLASH_NO_FAST_READ in SPI drivers
to use #if instead of #ifdef
- Relocate flash functions in SMM so they are usable.
This really only needs to happen for read function pointer
since it uses a global function rather than a static one from
the chip, but it is good to ensure the rest are set up
correctly as well.

Change-Id: Ic1bb0764cb111f96dd8a389d83b39fe8f5e72fbd
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1775
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Duncan Laurie
2012-10-10 14:21:23 -07:00
committed by Ronald G. Minnich
parent a571c70c14
commit 23b0053586
8 changed files with 21 additions and 7 deletions

View File

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