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.
Error Correction User Guide
Contents
Overview[edit]
Note: This document is applicable only to PSP 03.00.01.06 release in AM37x and AM35x SDK v4.0.1.0 which include patches to support ECC modes as described below
Beginning with SDK 4.01, NAND error correction greater than 1-bit has been added to Xloader, Uboot, and the kernel. This document is intended to briefly describe the usage of the 4-bit and 8-bit error correction capabilities. NOTE: Xloader/Uboot/Kernel DEFAULTS are set to 4-bit BCH. If you intend to use something different, check below to understand how to rebuild for different error correction capability.
The 4-bit and 8-bit capabilities are based on a BCH software correction algorithm, and rely on GPMC hardware for BCH computations.
Be careful to be consistent when moving to a system with higher error correction capability. For example, if you desire 4-bit error correction, be sure to build a 4-bit capable Xloader based on the instructions below. Also, be sure to compile a 4-bit version of the kernel (again, see instructions below). Finally, be sure to program all binaries (Xloader/Uboot/kernel) to NAND using 4-bit correction via either Flash tool or Uboot.
X-Loader[edit]
X-loader has compile time selectable support for 4-bit and 8-bit error correction.
When building X-loader, use the following command (for 1 bit ECC):
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm PLATFORM_RELFLAGS+=-DONE_BIT_ERROR_CORRECT
- For 4-bit error correction, use -DFOUR_BIT_ERROR_CORRECT instead.
- For 8-bit error correction, use -DEIGHT_BIT_ERROR_CORRECT instead.
U-boot[edit]
Error correction mode is controlled by U-boot 'nandecc' command. Options for 'nandecc' command:
- nandecc hw - This configures for 1-bit HWECC (ROM Style, for programming images intended for ROM to boot, such as X-loader).
- nandecc sw - This configures for 1-bit SWECC.
- nandecc bch4_sw - This configures for 4-bit BCH error correction.
- nandecc bch8_sw - This configures for 8-bit BCH error correction.
The default mode is 4-bit error correction. This is set at the end of board_nand_init().
Kernel[edit]
You must choose 1bit ECC, 4bit BCH, or 8-bit BCH at compile time.
To change error correction mode, you must modify omap2.c and uncomment either CONFIG_MTD_NAND_OMAP_BCH_4 (to enable 4-bit BCH) or CONFIG_MTD_NAND_OMAP_BCH_8 (to enable 8-bit BCH). The default is 4-bit ECC correction. Comment out both of them if you want 1-bit ECC mode.
Flash Tool[edit]
The Flash Tool has been updated with support for programming images to NAND flash using 1bit SWECC, 1bit HWECC, 4bit BCH, or 8bit BCH. You may use Flash Tool for NAND programming or you may use U-boot, as they have similar functionality.
For more information please consult the Flash User Guide: [Flash v1.5 User's Guide]