OSDN Git Service

mtd: rawnand: micron: Fix on-die ECC detection logic
authorBoris Brezillon <boris.brezillon@bootlin.com>
Wed, 18 Jul 2018 08:42:15 +0000 (10:42 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 19 Jul 2018 21:14:14 +0000 (23:14 +0200)
commitdbc44edbf8338d27639214be07fe7ab4f8a903e0
treeb4417f59196306a55eb0baecdda57894420b7205
parent79e1ca37cc0c056f224cc1dd4a301b9dc2f94167
mtd: rawnand: micron: Fix on-die ECC detection logic

Basing the "mandatory on-die" detection on ID byte 2 does not work,
because Micron has plenty of NANDs using the same device ID code, and
not all of them have forcibly enabled on-die ECC.

Since the "Array Operation" feature does not provide the "ECC
enabled/disabled" bit when the ECC can't be disabled, let's try to use
the "ECC enabled/disabled" bit in the READ_ID bytes.

It seems that this bit is dynamically updated on NANDs where on-die ECC
can freely be enabled/disabled, so let's hope it stays at one when we
have a NAND with on-die ECC forcibly enabled.

Fixes: 51f3b3970a8c ("mtd: rawnand: micron: detect forced on-die ECC")
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/nand_micron.c