[U-Boot] [PATCH 5/5] mtd: spi_flash: preserve Spansion's original value during reboot

Ahmed Samir Khalil engkhalil86 at gmail.com
Sun Oct 1 01:20:44 UTC 2017


Spansion flash has QEB in the same status register as well.
Therefore, preserve the original values while rebooting.
Otherwise, some SPI controllers may be unable to access
the flash correctly e.g. receive garbage bytes instead.

Signed-off-by: Ahmed S. Khalil <engkhalil86 at gmail.com>
---
 drivers/mtd/spi/spi_flash.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index b6b56fe..2e603ed 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -984,7 +984,8 @@ int spi_flash_scan(struct spi_flash *flash)
 	 */
 	if (JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_ATMEL ||
 	   (JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_SST) ||
-	   (JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_MACRONIX)) {
+	   (JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_MACRONIX) ||
+	   (JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_SPANSION)) {
 		u8 sr = 0;
 
 		if (JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_MACRONIX) {
-- 
2.7.4



More information about the U-Boot mailing list