]> asedeno.scripts.mit.edu Git - linux.git/commit
mtd: cfi_cmdset_0002: Add support for polling status register
authorVignesh Raghavendra <vigneshr@ti.com>
Tue, 25 Jun 2019 07:57:42 +0000 (13:27 +0530)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 27 Jun 2019 17:47:45 +0000 (19:47 +0200)
commit4844ef80305d0180051d0787cd91c63573255dc2
treec03947497f3fe8e373b8c249f7af88db00da039a
parent99a125f8edec391e423962847c6fd1d6994f0ad8
mtd: cfi_cmdset_0002: Add support for polling status register

HyperFlash devices are compliant with CFI AMD/Fujitsu Extended Command
Set (0x0002) for flash operations, therefore
drivers/mtd/chips/cfi_cmdset_0002.c can be used as is. But these devices
do not support DQ polling method of determining chip ready/good status.
These flashes provide Status Register whose bits can be polled to know
status of flash operation.

Cypress HyperFlash datasheet here[1], talks about CFI Amd/Fujitsu
Extended Query version 1.5. Bit 0 of "Software Features supported" field
of CFI Primary Vendor-Specific Extended Query table indicates
presence/absence of status register and Bit 1 indicates whether or not
DQ polling is supported. Using these bits, its possible to determine
whether flash supports DQ polling or need to use Status Register.

Add support for polling Status Register to know device ready/status of
erase/write operations when DQ polling is not supported.
Print error messages on erase/program failure by looking at related
Status Register bits.

[1] https://www.cypress.com/file/213346/download

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Tokunori Ikegami <ikegami.t@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/chips/cfi_cmdset_0002.c
include/linux/mtd/cfi.h