]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: spi-nor: Fix the writing of the Status Register on micron flashes
authorTudor Ambarus <tudor.ambarus@microchip.com>
Tue, 3 Dec 2019 14:50:01 +0000 (14:50 +0000)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 9 Jan 2020 19:11:34 +0000 (20:11 +0100)
commit9d2c8724d9a28d0ebccc3f70f4149d8532ae7502
tree43879919e3508cfd3ac274f5eb90040a0d1f7842
parent6c74daa6168a07cc8fcb9a4120c02ad9808cab19
mtd: spi-nor: Fix the writing of the Status Register on micron flashes

Micron flashes do not support 16 bit writes on the Status Register.
According to micron datasheets, when using the Write Status Register
(01h) command, the chip select should be driven LOW and held LOW until
the eighth bit of the last data byte has been latched in, after which
it must be driven HIGH. If CS is not driven HIGH, the command is not
executed, flag status register error bits are not set, and the write enable
latch remains set to 1. This fixes the lock operations on micron flashes.

Reported-by: John Garry <john.garry@huawei.com>
Fixes: 5be14a30a6cc ("mtd: spi-nor: Fix clearing of QE bit on lock()/unlock()")
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Tested-by: John Garry <john.garry@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/spi-nor/spi-nor.c