mtd: rawnand: Add support for Macronix NAND randomizer
authorMason Yang <masonccyang@mxic.com.tw>
Mon, 17 Feb 2020 06:56:39 +0000 (14:56 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 11 Mar 2020 15:17:54 +0000 (16:17 +0100)
commit84234652595f8dc29a92a33a6ae504c7df2e11c8
treef959c711e2408646357f218a95738360057e1f2c
parent16d00cd612068965134a08c08a43355b4b4ac58f
mtd: rawnand: Add support for Macronix NAND randomizer

Macronix NANDs support randomizer operation for user data scrambled,
which can be enabled with a SET_FEATURE.

User data written to the NAND device without randomizer is still readable
after randomizer function enabled.
The penalty of randomizer are subpage accesses prohibited and more time
period is needed in program operation and entering deep power-down mode.
i.e., tPROG 300us to 340us(randomizer enabled)

For more high-reliability concern, if subpage write not available with
hardware ECC and then to enable randomizer is recommended by default.
Driver checks byte 167 of Vendor Blocks in ONFI parameter page table
to see if this high-reliability function is supported. By adding a new
specific DT property in children nodes to enable randomizer function.

Signed-off-by: Mason Yang <masonccyang@mxic.com.tw>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/1581922600-25461-2-git-send-email-masonccyang@mxic.com.tw
drivers/mtd/nand/raw/nand_macronix.c