mtd: gpmi: issue with raw access support

Han Xu xhnjupt at gmail.com
Mon Jan 25 13:49:24 PST 2016


Hi Boris,

There is an issue on Kernel 4.1 with your gpmi raw access support
patch. I can understand with your implementation all data are stored
in BCH layout, even without HW ECC. But for NAND boot function on i.MX
family, it requires to write BOOT CONFIGURATION DATA at the beginning
of NAND chip, so ROM code could understand how to configure BCH
register to read data with proper ECC handling.

All these BOOT CONFIURATION DATA must be written with proper ROM
defined format, including data layout, parity checking algorithm( NOT
BCH ECC for some platforms). A user-space tool, named kobs-ng was
provided to generate all necessary data, and it called the mtd raw
functions to write the UNFORMATTED data to NAND chip.

With the new patch, all NAND boot function on kernel 4.1 failed since
ROM couldn't read the proper configuration. To solve the issue, I am
planning to export a switch in debugfs to let the user applications to
choose raw access mode, unformatted mode or BCH layout one, while I
got stuck.

The problem is how could I dynamically change the raw functions from
the new ones you provided to the default ones in nand_base. It more or
less a hacking either getting the pointer of functions
nand_read_page_raw /nand_write_page_raw or copy-pasting the implement
of these two functions to gpmi layer. So I was wondering if you have
any better idea for this issue? Thanks.



More information about the linux-mtd mailing list