mtd: nand: raw: atmel: Fix pulse read timing for certain NAND flashes
authorAlexander Dahl <ada@thorsis.com>
Mon, 15 Apr 2024 07:57:55 +0000 (09:57 +0200)
committerEugen Hristev <eugen.hristev@linaro.org>
Wed, 12 Feb 2025 08:49:56 +0000 (10:49 +0200)
commit344e2f2cd4a407f847b301804f37d036e8a0a10c
tree457eb9e9d46d4dbc476ca3d4a649ef6313083d2a
parent973143219c41c240ef3f79f58c6732f96f1eca9e
mtd: nand: raw: atmel: Fix pulse read timing for certain NAND flashes

From reading the S34ML02G1 and the SAM9X60 datasheets again, it seems
like we have to wait tREA after rising RE# before sampling the data.
Thus pulse time must be at least tREA.

Without this fix we got PMECC errors when reading, after switching to
ONFI timing mode 3 on SAM9X60 SoC with S34ML02G1 raw NAND flash chip.

The approach to set timings used before worked on sam9g20 and sama5d2
with the same flash (S34ML02G1), probably because those have a slower
mck clock rate and thus the resolution of the timings setup is not as
tight as with sam9x60.

The approach to fix the issue was carried over from at91bootstrap, and
has been successfully tested in at91bootstrap, U-Boot and Linux.

Link: https://github.com/linux4sam/at91bootstrap/issues/174
Cc: Li Bin <bin.li@microchip.com>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
drivers/mtd/nand/raw/atmel/nand-controller.c