NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
Disabling NAND HW ECC support
Contents
Introduction[edit]
This page will walk the user through disabling HW ECC support for DaVinci NAND devices in the TI LSP kernel. This is needed in order to use the YAFFS file system since the YAFFS file system does not use HW ECC.
Disabling HW ECC support[edit]
This section is broken down into 2 subsections. The first section is for the LSP 1.10 kernel shipped with version 1.20 of the DVSDK. The second section is for LSP 1.20 and greater shipped with version 1.30 and greater of the DVSDK. In this example it is assumed that the user has a copy of the LSP kernel in /home/user/workdir/ti-davinci.
LSP 1.10[edit]
In order to disable HW ECC support in LSP 1.10 you must:
- Remove the kernel configuration option for HW ECC
- Patch the nand_davinci.c file located at drivers/mtd/nand/ from the root of the kernel tree to not make calls to the HW ECC functions when the HW ECC is disabled.
- Configure the kernel using xconfig
host$ cd /home/user/workdir/ti-davinci host$ make ARCH=arm CROSS_COMPILE=arm_v5t_le- xconfig
- Disable HW ECC support
The option for HW ECC support is located under Memory Technology Devices (MTD) -> NAND Flash Device Drivers. Uncheck the Hardware ECC Support on NAND Device for DaVinci option. For example you should see a screen like the following:
- Save the configuration and exit xconfig
- Patch the nand_davinci.c file
- Download the patch file to a temporary directory. For this example I will use /tmp
- Unzip the patch file
- host$ cd /tmp
- gunzip disable_hw_ecc_for_yaffs.patch.gz
- Test and apply the patch to the kernel source
- host$ cd /home/user/workdir/ti-davinci
- host$ patch -p1 --dry-run < /tmp/disable_hw_ecc_for_yaffs.patch
- If the above dry-run succeeds patch the kernel for real
- host$ patch -p1 < /tmp/disable_hw_ecc_for_yaffs.patch
LSP 1.20 and greater[edit]
In order to disable HW ECC in LSP 1.20 and greater you need to modify the nand_data structure in the board configuration file for your EVM.
The board configuration file is located in the arch/arm/mach-davinci directory of the kernel tree. The configuration file for the DM644x family is board-evm.c whereas for the DM355 and later devices it is board-<device>-evm.c (i.e. board-dm355-evm.c)
In the board configuration file you need to modify the nand_data structure and change the ".eccmode" member to NAND_ECC_SOFT. For example on the DM6446 the .eccmode member should be changed from
.eccmode = NAND_ECC_HW3_512
To
.eccmode = NAND_ECC_SOFT
Conclusion[edit]
Once you have made the above modifications the kernel is now set to use software ECC for the NAND device rather than HW ECC. You may now use this kernel with the YAFFS file system.