diff options
author | Aaron Durbin <adurbin@chromium.org> | 2020-01-03 15:58:11 -0700 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2020-01-10 04:55:09 +0000 |
commit | 1c3086a6036f9908c8c09c823c5ad1718eac7ce0 (patch) | |
tree | 185d0795575f7329d9b552a3605e5139979f086d /src/drivers/spi/spi_flash.c | |
parent | 73451fdea266e24a3ce99e1bf41f49735dc62d28 (diff) |
drivers/spi/spi_flash: explicitly handle STMicro deep power state
In order to provide more consistent probing in future refactorings, pull out
the release from deep sleep path in STMicro's SPI flash probing function.
Call that function explicitly when RDID doesn't return anything at all.
The old STMicro parts, even if supporting RDID, won't decode that
instruction while in a deep power down state. Instead of re-issuing RDID after
the successful wake assume the id fixup is valid.
Change-Id: I46c47abcfb1376c1c3ce772f6f232857b8c54202
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38167
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/drivers/spi/spi_flash.c')
-rw-r--r-- | src/drivers/spi/spi_flash.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c index ff69a9a1c1..4a86146503 100644 --- a/src/drivers/spi/spi_flash.c +++ b/src/drivers/spi/spi_flash.c @@ -368,9 +368,6 @@ static struct { { 0, VENDOR_ID_WINBOND, spi_flash_probe_winbond, }, #endif /* Keep it sorted by best detection */ -#if CONFIG(SPI_FLASH_STMICRO) - { 0, VENDOR_ID_STMICRO_FF, spi_flash_probe_stmicro, }, -#endif #if CONFIG(SPI_FLASH_ADESTO) { 0, VENDOR_ID_ADESTO, spi_flash_probe_adesto, }, #endif @@ -402,6 +399,15 @@ int spi_flash_generic_probe(const struct spi_slave *spi, printk(BIOS_INFO, "Manufacturer: %02x\n", *idp); + /* If no result from RDID command and STMicro parts are enabled attempt + to wake the part from deep sleep and obtain alternative id info. */ + if (CONFIG(SPI_FLASH_STMICRO) && *idp == 0xff) { + if (stmicro_release_deep_sleep_identify(spi, idcode)) + return -1; + idp = idcode; + shift = 0; + } + /* search the table for matches in shift and id */ for (i = 0; i < (int)ARRAY_SIZE(flashes); ++i) if (flashes[i].shift == shift && flashes[i].idcode == *idp) { |