NOTICE: The Processors Wiki will End-of-Life in December of 2020. It is recommended to download any files or other content you may need that are hosted on The site is now set to read only.

Disabling NAND HW ECC support

From Texas Instruments Wiki
Jump to: navigation, search


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

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

In order to disable HW ECC support in LSP 1.10 you must:

  1. Remove the kernel configuration option for HW ECC
  2. 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:

HW ECC disable.jpg

  • Save the configuration and exit xconfig
  • Patch the nand_davinci.c file
  1. Download the patch file to a temporary directory. For this example I will use /tmp
  2. Unzip the patch file
    1. host$ cd /tmp
    2. gunzip disable_hw_ecc_for_yaffs.patch.gz
  3. Test and apply the patch to the kernel source
    1. host$ cd /home/user/workdir/ti-davinci
    2. host$ patch -p1 --dry-run < /tmp/disable_hw_ecc_for_yaffs.patch
    3. If the above dry-run succeeds patch the kernel for real
    4. host$ patch -p1 < /tmp/disable_hw_ecc_for_yaffs.patch

LSP 1.20 and greater

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


   .eccmode = NAND_ECC_SOFT


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.