Difference between revisions of "Updating nand flash driver from linux kernel 4.14 to 4.19"
(Created page with "==About== Below are the changes had to be made to update our nand flash driver code from kernel 4.14 to 4.19. The kernel versions mentioned are the rebases from the mainline k...")
Revision as of 11:28, 26 September 2019
Below are the changes had to be made to update our nand flash driver code from kernel 4.14 to 4.19. The kernel versions mentioned are the rebases from the mainline kernel in linux-xlnx repo with xilinx's code:
NAND FLASH chip
- ON-DIE ECC feature supported - they call it internal ECC in the datasheet:
Internal ECC enables 5-bit detection and 4-bit error correction in 512 bytes
- Subpage (or partial) writes are not supported.
Linux Kernel 4.14 and older
Until 4.14 (including) our driver code additions worked unchanged. We basically needed a couple of things:
- LOCK/UNLOCK functions (which were removed in 4.14). The code existed in up to 4.13 release - so it was just taken from there.
- Function to work with the chip's (MT29F8G08ADBDAH4) OTP area. The original code was taken from here
Updating to 4.19
- A lot has changed since 4.14
- new ->exec_op hook vs old ->cmdfunc
- OTP function are not supported yet, and need a minor change to make them more universal
- Old LOCK/UNLOCK function need to be updated to the new codebase
- Set nand-ecc-mode = "on-die"; in the device tree.
- Add NAND_NO_SUBPAGE_WRITE to chip->options for MT29F8G08ADBDAH4
See the code here:
Those arm,nand-cycle-t0-6 can be removed
Didn't make a patch - the changes are for a specific MT29F8G08ADBDAH4. Although they might work for others as well we have only tested the chip we use.