mbox series

[RFC,v2,0/2] Add support to Disable the flash quad mode

Message ID 1589282819-42358-1-git-send-email-yangyicong@hisilicon.com
Headers show
Series Add support to Disable the flash quad mode | expand

Message

Yicong Yang May 12, 2020, 11:26 a.m. UTC
Previously we didn't disable the flash's quad mode when it's removed
Then comes the problem that if we next time load the flash
in SPI/Dual mode, it will not be correctly enabled as the quad enable
bits has not been cleared. I validated the condition on Cypress s25fs128s1.

This series adds the capability to disable the flash's quad mode. And
restore the flash when it's removed in spi_nor_restore().

RFC:
- I cleared quad mode bit in spi_nor_restore() when flash removed or
shutdown, follow what reset 4byte address does. But I don't know if
there is a situation that the flash is in quad mode by default. If so,
we should disable it in probe stage.
- The issue occurs when the user switch the spi mode of the flash.
Not sure whether a situation exists.

Changes since v1:
- modify the comments and fix the condition suggested by Pratyush's.
Link: https://lore.kernel.org/linux-mtd/1587720044-49172-1-git-send-email-yangyicong@hisilicon.com/

Yicong Yang (2):
  mtd: spi-nor: Add capability to disable flash quad mode
  mtd: spi-nor: Disable the flash quad mode in spi_nor_restore()

 drivers/mtd/spi-nor/core.c | 56 +++++++++++++++++++++++++++++++++-------------
 drivers/mtd/spi-nor/core.h |  8 +++----
 2 files changed, 44 insertions(+), 20 deletions(-)

Comments

Yicong Yang June 15, 2020, 9:19 a.m. UTC | #1
a friendly ping...
any comments on this?

Thanks.


On 2020/5/12 19:26, Yicong Yang wrote:
> Previously we didn't disable the flash's quad mode when it's removed
> Then comes the problem that if we next time load the flash
> in SPI/Dual mode, it will not be correctly enabled as the quad enable
> bits has not been cleared. I validated the condition on Cypress s25fs128s1.
>
> This series adds the capability to disable the flash's quad mode. And
> restore the flash when it's removed in spi_nor_restore().
>
> RFC:
> - I cleared quad mode bit in spi_nor_restore() when flash removed or
> shutdown, follow what reset 4byte address does. But I don't know if
> there is a situation that the flash is in quad mode by default. If so,
> we should disable it in probe stage.
> - The issue occurs when the user switch the spi mode of the flash.
> Not sure whether a situation exists.
>
> Changes since v1:
> - modify the comments and fix the condition suggested by Pratyush's.
> Link: https://lore.kernel.org/linux-mtd/1587720044-49172-1-git-send-email-yangyicong@hisilicon.com/
>
> Yicong Yang (2):
>   mtd: spi-nor: Add capability to disable flash quad mode
>   mtd: spi-nor: Disable the flash quad mode in spi_nor_restore()
>
>  drivers/mtd/spi-nor/core.c | 56 +++++++++++++++++++++++++++++++++-------------
>  drivers/mtd/spi-nor/core.h |  8 +++----
>  2 files changed, 44 insertions(+), 20 deletions(-)
>