Skip to content

Commit cc59e6b

Browse files
Yicong Yangambarus
authored andcommitted
mtd: spi-nor: Disable the flash quad mode in spi_nor_restore()
If the flash's quad mode is enabled, it'll remain in the quad mode when it's removed. If we drive the flash next time in Standard/Dual SPI mode, the QE bit is not cleared and the function of flash's WP# and RESET#/HOLD# have been switched to IO2 and IO3 and are not restored. Disable the Quad mode in spi_nor_restore(), then the flash's QE bit will be cleared when removed. This will make sure the flash always enter the Standard/Dual SPI mode when loaded. Signed-off-by: Yicong Yang <[email protected]> Signed-off-by: Tudor Ambarus <[email protected]> Reviewed-by: Pratyush Yadav <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent be19220 commit cc59e6b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/mtd/spi-nor/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3000,6 +3000,8 @@ void spi_nor_restore(struct spi_nor *nor)
30003000
if (nor->addr_width == 4 && !(nor->flags & SNOR_F_4B_OPCODES) &&
30013001
nor->flags & SNOR_F_BROKEN_RESET)
30023002
nor->params->set_4byte_addr_mode(nor, false);
3003+
3004+
spi_nor_quad_enable(nor, false);
30033005
}
30043006
EXPORT_SYMBOL_GPL(spi_nor_restore);
30053007

0 commit comments

Comments
 (0)