[PATCH V3] mtd: nand: add Loongson1 NAND driver

Mychaela Falconia mychaela.falconia at gmail.com
Sat May 28 09:23:51 PDT 2016


On 5/28/16, Kelvin Cheung <keguang.zhang at gmail.com> wrote:
> I have the same feeling as Mychaela, and suffered from the 'high-level
> controllers' as well.

Actually your controller is not as bad as mine: given that you set ECC
to "soft" in your driver, I assume that albeit it goes through DMA and
high-level commands, your controller still returns the bytes as they
come from the NAND chip on page reads and you get to supply all of the
bytes that get written into the NAND chip, so you get to do your own
ECC and thus the code in the generic NAND layer that distinguishes
between normal vs. raw reads and writes becomes sensibly applicable.

The controller I am working with is worse in that it absolutely does
NOT allow raw access to the full range of bytes in the physical NAND
pages: it *forces* you to use their hardware ECC engine along with the
proprietary on-flash data format it implements. In the driver which I
implemented by attaching directly to MTD and foregoing the generic
NAND layer, my implementation of read_oob and write_oob MTD methods
returns -EOPNOTSUPP if someone requests MTD_OPS_RAW, as the controller
hardware absolutely precludes the possibility of such raw access.

M~



More information about the linux-mtd mailing list