mtd: rawnand: sunxi: Update OOB layout to match hardware
authorSamuel Holland <samuel@sholland.org>
Sat, 4 Feb 2023 14:35:18 +0000 (08:35 -0600)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 6 Feb 2023 11:53:06 +0000 (12:53 +0100)
commit3998a4611e8be2e9b5833e7aae29619ea0305437
tree63b73543f4e80bff4de4394d68f664b074a7c295
parent4d21176f48124e06c3251af38350b05a50ac4b01
mtd: rawnand: sunxi: Update OOB layout to match hardware

When using the hardware ECC engine, the OOB data is made available in
the NFC_REG_USER_DATA registers, as one 32-bit word per ECC step. Any
additional bytes are only accessible through raw reads and software
descrambling. For efficiency, and to match the vendor driver, ignore
these extra bytes when using hardware ECC.

Note that until commit 34569d869532 ("mtd: rawnand: sunxi: Fix the size
of the last OOB region"), this extra free area was reported with length
zero, so this is not a functional change for any stable kernel user.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230204143520.9682-2-samuel@sholland.org
drivers/mtd/nand/raw/sunxi_nand.c