![Texas Instruments EMIF16 Скачать руководство пользователя страница 30](http://html.mh-extra.com/html/texas-instruments/emif16/emif16_user-manual_1097088030.webp)
3.7 ECC Support
3-6
KeyStone Architecture External Memory Interface (EMIF16) User Guide
SPRUGZ3A—May 2011
Chapter 3—Operating Modes
www.ti.com
In the figure, p1e through p4e are column parities and p8e through p2048e are row
parities. This algorithm can be easily extended for 16-bit NAND device. For 16-bit
device, column parities will run from p1e through p8e whereas row parities will run
from p16e through p2048e.
Note that the above figure applies only for 512 Byte data. To calculate 1-bit ECC for
8-bit NAND device for data less than 512 Bytes, the corresponding parities must be
ignored. For example, for 256 Bytes of data, p2048e and p2048o are unnecessary and
should be discarded. Similarly, for 128 Bytes, discard p1024e, p1024o, p2048e and
p2048o.
EMIF16 also provides 4-bit ECC support for up to 518 Bytes for both 8-bit and 16-bit
NAND devices. However, unlike 1-bit ECC, only one chip select can be selected for
4-bit ECC calculation at one time. Chip select can be selected by setting the
4BIT_ECC_SEL
field in the NAND Flash Control Register (NANDFCR). 4-bit ECC
calculation for the selected chip select can be started by setting the
4BIT_ECC_START
bit in the NANDFCR (
for details on NANDFCR.
Once 4-bit ECC calculation is complete, the calculated syndrome for reads and parity
for writes can be read from the NAND Flash 4-Bit ECC 1-4 registers. On reading any
of these registers, the
4BIT_ECC_START
bit is cleared. The contents of NAND Flash
4-Bit ECC 1-4 registers are cleared when 4-bit ECC calculation is started by setting
4BIT_ECC_START
.
The 4-bit ECC algorithm uses 10 bits. 4-bit ECC calculation in EMIF16 however uses
8-bit values for both 8-bit and 16-bit devices. The 8-bit value is converted to 10 bits and
the upper 2 bits of the 10-bit value are zeroed out by EMIF16. Typically, spare area in
NAND is used to store ECC-related information. For example, after a write, for the
10-bit parity values read from the NAND Flash 4-Bit ECC 1-4 registers to be stored in
the spare area of the NAND device, 10-bit values need to be converted to 8-bit or 16-bit
values depending on bus width of the device being used.
Similarly, for reads, the parity values stored in the spare location for the NAND needs
to be read for further syndrome calculation. These values will be read as multiple 8-bit
or 16-bit values depending on NAND bus width. The 8-bit values for either 8-bit or
16-bit NAND devices should be converted to 10-bit before writing them to the NAND
Flash 4-bit ECC Load register. The 8 to 10-bit conversion and vice-versa should be
done by software.
Table 3-3
4-bit ECC calculation bits in NAND Flash Control Register
Bit
Value
Description
4BIT_ECC_SEL
0x0
0x1
0x2
0x3
4-bit ECC calculation for CS2 (CE0)
4-bit ECC calculation for CS3 (CE1)
4-bit ECC calculation for CS4 (CE2)
4-bit ECC calculation for CS5 (CE3)
4BIT_ECC_START
0x1
Start 4-bit ECC calculation for selected chip select.
Bit is cleared after reading any of the NAND Flash 4-Bit ECC 1-4
registers.
Writing a 0 has no effect.
End of Table 3-3