mtd: spi-nor: spansion: fix writes on S25FS512S
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Mon, 20 Apr 2020 19:13:58 +0000 (22:13 +0300)
committerTudor Ambarus <tudor.ambarus@microchip.com>
Thu, 28 May 2020 07:00:49 +0000 (10:00 +0300)
commit5587fa489747a8e6cbd0558890458c862b797485
tree3b543d8d47037d453fe749786abac27b5496f6c4
parentb8469159632818064084397a010f34e156a393db
mtd: spi-nor: spansion: fix writes on S25FS512S

Spansion S25FS-S family has an issue in the Basic Flash Parameter Table
(BFPT): Dword-11 bits 7:4 specify a page size of 512 bytes.  Actually
this is configurable in the vendor unique register (CR3V) and even the
factory default setting is to "wrap at 256 bytes", so blindly relying
on BFPT breaks the page writes on these chips. Add the post-BFPT fixup
which restores the default page size of 256 bytes -- to properly read
CR3V this early is quite intrusive and should better be done as a new
feature; Alexander Sverdlin had the patch doing that:

https://patchwork.ozlabs.org/project/linux-mtd/patch/20200227123657.26030-1-alexander.sverdlin@nokia.com/

Fixes: dfd2b74530e ("mtd: spi-nor: add Spansion S25FS512S ID")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Tested-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
drivers/mtd/spi-nor/spansion.c