ubi: Do not zero out EC and VID on ECC-ed NOR flashes
authorPratyush Yadav <p.yadav@ti.com>
Tue, 1 Dec 2020 10:27:09 +0000 (15:57 +0530)
committerRichard Weinberger <richard@nod.at>
Sun, 13 Dec 2020 20:57:21 +0000 (21:57 +0100)
commitf669e74be820386244290d5824938969d397b8fb
tree791a212ff9c265e305e1a4bb93ba3ea14ea1fc9e
parent22bdb8b6fd8eb4d67b94287f97220c8bf58666b0
ubi: Do not zero out EC and VID on ECC-ed NOR flashes

For NOR flashes EC and VID are zeroed out before an erase is issued to
make sure UBI does not mistakenly treat the PEB as used and associate it
with an LEB.

But on some flashes, like the Cypress Semper S28 SPI NOR flash family,
multi-pass page programming is not allowed on the default ECC scheme.
This means zeroing out these magic numbers will result in the flash
throwing a page programming error.

Do not zero out EC and VID for such flashes. A writesize > 1 is an
indication of an ECC-ed flash.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/ubi/build.c
drivers/mtd/ubi/io.c