[PATCH 2/2] mtd: spi-nor: Disable the flash quad mode in spi_nor_restore()

Yicong Yang yangyicong at hisilicon.com
Tue Sep 1 07:41:13 EDT 2020


Hi Matthias,


On 2020/9/1 14:16, Matthias Weißer wrote:
> Am Di., 16. Juni 2020 um 15:03 Uhr schrieb Yicong Yang
> <yangyicong at hisilicon.com>:
>> 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 SPI/Dual mode, then
>> problem occurs as the flash's quad enable bit is not cleared.
> On flash devices with a non-volatile quad enable bit (we use S25FL512S)
> this will wear out the quad enable bit as on every boot the bit is
> set and reset on shutdown. Or do I miss something here?
>
>> Disable the quad mode in spi_nor_restore(), the flash will leave
>> quad mode when remove. This will make sure the flash always enter the
>> correct mode when loaded.
> We have a system which relies on an enabled quad mode on boot
> (bootloader uses quad mode without enabling it) so using this patch
> will prevent our device from booting.

For flashes boot with standard spi mode and with quad mode enabled in kernel,
it will stay in quad mode when shutdown and next time boot. This patch intends
to address this issue as we should restore the flash's original state.

For the flashes boot with quad mode, seems we don't `restore` the flash's state
correctly. It's better to record the flash's quad mode state and if it's in quad
mode when boot, we'll not disable it when shutdown or remove.

Regards,
Yicong

>
> Regards,
> Matthias
> .
>




More information about the linux-mtd mailing list