@@ -28,6 +28,8 @@ Optional properties:
28
28
"ham1" 1-bit Hamming ecc code
29
29
"bch4" 4-bit BCH ecc code
30
30
"bch8" 8-bit BCH ecc code
31
+ "bch16" 16-bit BCH ECC code
32
+ Refer below "How to select correct ECC scheme for your device ?"
31
33
32
34
- ti,nand-xfer-type: A string setting the data transfer type. One of:
33
35
@@ -90,3 +92,46 @@ Example for an AM33xx board:
90
92
};
91
93
};
92
94
95
+ How to select correct ECC scheme for your device ?
96
+ --------------------------------------------------
97
+ Higher ECC scheme usually means better protection against bit-flips and
98
+ increased system lifetime. However, selection of ECC scheme is dependent
99
+ on various other factors also like;
100
+
101
+ (1) support of built in hardware engines.
102
+ Some legacy OMAP SoC do not have ELM harware engine, so those SoC cannot
103
+ support ecc-schemes with hardware error-correction (BCHx_HW). However
104
+ such SoC can use ecc-schemes with software library for error-correction
105
+ (BCHx_HW_DETECTION_SW). The error correction capability with software
106
+ library remains equivalent to their hardware counter-part, but there is
107
+ slight CPU penalty when too many bit-flips are detected during reads.
108
+
109
+ (2) Device parameters like OOBSIZE.
110
+ Other factor which governs the selection of ecc-scheme is oob-size.
111
+ Higher ECC schemes require more OOB/Spare area to store ECC syndrome,
112
+ so the device should have enough free bytes available its OOB/Spare
113
+ area to accomodate ECC for entire page. In general following expression
114
+ helps in determining if given device can accomodate ECC syndrome:
115
+ "2 + (PAGESIZE / 512) * ECC_BYTES" >= OOBSIZE"
116
+ where
117
+ OOBSIZE number of bytes in OOB/spare area
118
+ PAGESIZE number of bytes in main-area of device page
119
+ ECC_BYTES number of ECC bytes generated to protect
120
+ 512 bytes of data, which is:
121
+ '3' for HAM1_xx ecc schemes
122
+ '7' for BCH4_xx ecc schemes
123
+ '14' for BCH8_xx ecc schemes
124
+ '26' for BCH16_xx ecc schemes
125
+
126
+ Example(a): For a device with PAGESIZE = 2048 and OOBSIZE = 64 and
127
+ trying to use BCH16 (ECC_BYTES=26) ecc-scheme.
128
+ Number of ECC bytes per page = (2 + (2048 / 512) * 26) = 106 B
129
+ which is greater than capacity of NAND device (OOBSIZE=64)
130
+ Hence, BCH16 cannot be supported on given device. But it can
131
+ probably use lower ecc-schemes like BCH8.
132
+
133
+ Example(b): For a device with PAGESIZE = 2048 and OOBSIZE = 128 and
134
+ trying to use BCH16 (ECC_BYTES=26) ecc-scheme.
135
+ Number of ECC bytes per page = (2 + (2048 / 512) * 26) = 106 B
136
+ which can be accomodate in the OOB/Spare area of this device
137
+ (OOBSIZE=128). So this device can use BCH16 ecc-scheme.
0 commit comments