blob: 0029f08759d611edead742d6323f8978ce62e792 [file] [log] [blame]
Rafal Jaworowskidc9e4992006-03-16 17:46:46 +01001Overview
2========
3
4The overall usage pattern for ECC diagnostic commands is the following:
5
6 * (injecting errors is initially disabled)
7
8 * define inject mask (which tells the DDR controller what type of errors
9 we'll be injecting: single/multiple bit etc.)
10
11 * enable injecting errors - from now on the controller injects errors as
12 indicated in the inject mask
13
14IMPORTANT NOTICE: enabling injecting multiple-bit errors is potentially
15dangerous as such errors are NOT corrected by the controller. Therefore caution
16should be taken when enabling the injection of multiple-bit errors: it is only
17safe when used on a carefully selected memory area and used under control of
Dave Liu47e8bc82007-08-01 15:00:59 +080018the 'ecc testdw' 'ecc testword' command (see example 'Injecting Multiple-Bit
19Errors' below). In particular, when you simply set the multiple-bit errors in
20inject mask and enable injection, U-Boot is very likely to hang quickly as the
21errors will be injected when it accesses its code, data etc.
Marian Balakowiczd326f4a2006-03-16 15:19:35 +010022
23
24Use cases for DDR 'ecc' command:
25================================
26
27Before executing particular tests reset target board or clear status registers:
28
29=> ecc captureclear
30=> ecc errdetectclr all
31=> ecc sbecnt 0
32
33
34Injecting Single-Bit Errors
35---------------------------
36
371. Set 1 bit in Data Path Error Inject Mask
38
39=> ecc injectdatahi 1
40
412. Run test over some memory region
42
Dave Liu47e8bc82007-08-01 15:00:59 +080043=> ecc testdw 200000 10
Marian Balakowiczd326f4a2006-03-16 15:19:35 +010044
453. Check ECC status
46
47=> ecc status
48...
49Memory Data Path Error Injection Mask High/Low: 00000001 00000000
50...
51Memory Single-Bit Error Management (0..255):
52 Single-Bit Error Threshold: 255
53 Single Bit Error Counter: 16
54...
55Memory Error Detect:
56 Multiple Memory Errors: 0
57 Multiple-Bit Error: 0
58 Single-Bit Error: 0
59...
60
6116 errors were generated, Single-Bit Error flag was not set as Single Bit Error
62Counter did not reach Single-Bit Error Threshold.
63
Dave Liu47e8bc82007-08-01 15:00:59 +0800644. Make sure used memory region got re-initialized with 0x0123456789abcdef
Marian Balakowiczd326f4a2006-03-16 15:19:35 +010065
66=> md 200000
Dave Liu47e8bc82007-08-01 15:00:59 +08006700200000: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
6800200010: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
6900200020: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
7000200030: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
7100200040: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
7200200050: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
7300200060: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
7400200070: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
Marian Balakowiczd326f4a2006-03-16 15:19:35 +01007500200080: deadbeef deadbeef deadbeef deadbeef ................
7600200090: deadbeef deadbeef deadbeef deadbeef ................
77
Marian Balakowiczd326f4a2006-03-16 15:19:35 +010078Injecting Multiple-Bit Errors
79-----------------------------
80
811. Set more than 1 bit in Data Path Error Inject Mask
82
Dave Liu47e8bc82007-08-01 15:00:59 +080083=> ecc injectdatahi 1
84=> ecc injectdatalo 1
Marian Balakowiczd326f4a2006-03-16 15:19:35 +010085
862. Run test over some memory region
87
Dave Liu47e8bc82007-08-01 15:00:59 +080088=> ecc testword 200000 1
Marian Balakowiczd326f4a2006-03-16 15:19:35 +010089
903. Check ECC status
91
92=> ecc status
93...
Dave Liu47e8bc82007-08-01 15:00:59 +080094Memory Data Path Error Injection Mask High/Low: 00000001 00000001
Marian Balakowiczd326f4a2006-03-16 15:19:35 +010095...
96Memory Error Detect:
Dave Liu47e8bc82007-08-01 15:00:59 +080097 Multiple Memory Errors: 0
Marian Balakowiczd326f4a2006-03-16 15:19:35 +010098 Multiple-Bit Error: 1
99 Single-Bit Error: 0
100...
101
Dave Liu47e8bc82007-08-01 15:00:59 +0800102The Multiple Memory Errors flags not set and Multiple-Bit Error flags are set.
Marian Balakowiczd326f4a2006-03-16 15:19:35 +0100103
Dave Liu47e8bc82007-08-01 15:00:59 +08001044. Make sure used memory region got re-initialized with 0x0123456789abcdef
Marian Balakowiczd326f4a2006-03-16 15:19:35 +0100105
106=> md 200000
Dave Liu47e8bc82007-08-01 15:00:59 +080010700200000: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
10800200010: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
10900200020: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
11000200030: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
11100200040: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
11200200050: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
11300200060: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
11400200070: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg....
Marian Balakowiczd326f4a2006-03-16 15:19:35 +010011500200080: deadbeef deadbeef deadbeef deadbeef ................
11600200090: deadbeef deadbeef deadbeef deadbeef ................
117
118
119Test Single-Bit Error Counter and Threshold
120-------------------------------------------
121
1221. Set 1 bit in Data Path Error Inject Mask
123
124=> ecc injectdatahi 1
125
1262. Enable error injection
127
128=> ecc inject en
129
1303. Let u-boot run for a with Single-Bit error injection enabled
131
1324. Disable error injection
133
134=> ecc inject dis
135
1364. Check status
137
138=> ecc status
139
140...
141Memory Single-Bit Error Management (0..255):
142 Single-Bit Error Threshold: 255
Dave Liu47e8bc82007-08-01 15:00:59 +0800143 Single Bit Error Counter: 199
Marian Balakowiczd326f4a2006-03-16 15:19:35 +0100144
145Memory Error Detect:
146 Multiple Memory Errors: 1
147 Multiple-Bit Error: 0
148 Single-Bit Error: 1
149...
150
151Observe that Single-Bit Error is 'on' which means that Single-Bit Error Counter
152reached Single-Bit Error Threshold. Multiple Memory Errors bit is also 'on', that
153is Counter reached Threshold more than one time (it wraps back after reaching
154Threshold).