]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mtd: spinand: Introduce a way to avoid raw access
authorTakahiro Kuwano <Takahiro.Kuwano@infineon.com>
Tue, 3 Dec 2024 02:46:49 +0000 (11:46 +0900)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 5 Dec 2024 10:14:21 +0000 (11:14 +0100)
commit6d9d6ab3a82af50e36e13e7bc8e2d1b970e39f79
tree1b82f0c3c0a35333082761a4aa2154e534c1846f
parentc6858779f1f549442ec2fe2f69800d8e9cd904ce
mtd: spinand: Introduce a way to avoid raw access

SkyHigh spinand device has ECC enable bit in configuration register but
it must be always enabled. If ECC is disabled, read and write ops
results in undetermined state. For such devices, a way to avoid raw
access is needed.

Introduce SPINAND_NO_RAW_ACCESS flag to advertise the device does not
support raw access. In such devices, the on-die ECC engine ops returns
error to I/O request in raw mode.

Checking and marking BBM need to be cared as special case, by adding
fallback mechanism that tries read/write OOB with ECC enabled.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/spi/core.c
include/linux/mtd/spinand.h