OSDN Git Service

mtd: nand: atmel: Avoid ECC errors when leaving backup mode
authorRomain Izard <romain.izard.pro@gmail.com>
Thu, 28 Sep 2017 09:46:23 +0000 (11:46 +0200)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Sat, 7 Oct 2017 09:28:05 +0000 (11:28 +0200)
commit143b0ab97d7a40df399cfbc6e925107bed1c7953
treec24127b71537b6d88468040c0cb47877ff57bb76
parent8d6b6d7e135e9bbfc923d34a45cb0e72695e63ed
mtd: nand: atmel: Avoid ECC errors when leaving backup mode

During backup mode, the contents of all registers will be cleared as the
SoC will be completely powered down. For a product that boots on NAND
Flash memory, the bootloader will obviously use the related controller
to read the Flash and correct any detected error in the memory, before
handling back control to the kernel's resuming entry point.

But it does not clean the NAND controller registers after use and on its
side the kernel driver expects the error locator to be powered down and
in a clean state. Add a resume hook for the PMECC error locator, and
reset its registers.

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/atmel/nand-controller.c
drivers/mtd/nand/atmel/pmecc.c
drivers/mtd/nand/atmel/pmecc.h