spi-nor: intel-spi: Fall back to use SW sequencer to erase
authorBin Meng <bmeng.cn@gmail.com>
Mon, 11 Sep 2017 09:42:00 +0000 (02:42 -0700)
committerCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
Wed, 11 Oct 2017 07:57:50 +0000 (09:57 +0200)
commit3163d125b7b1f9c6844fc3448f8080ad268a8f63
tree2a29af22767ab6b8e653e319040b24ca8b8c8032
parent2421f1ccbd4e7c8fc10c5f6a6e9cc403ace4e449
spi-nor: intel-spi: Fall back to use SW sequencer to erase

According to the datasheet, the HW sequencer has a predefined list
of opcodes, with only the erase opcode being programmable in LVSCC
and UVSCC registers. If these registers don't contain a valid erase
opcode (eg: BIOS does not program it), erase cannot be done using
the HW sequencer, even though the erase operation does not report
any error, the flash remains not erased.

If such register setting is detected, let's fall back to use the SW
sequencer to erase instead.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
drivers/mtd/spi-nor/intel-spi.c