1*47e8bc84SDave LiuOverview 2*47e8bc84SDave Liu======== 3*47e8bc84SDave Liu 4*47e8bc84SDave LiuThe overall usage pattern for ECC diagnostic commands is the following: 5*47e8bc84SDave Liu 6*47e8bc84SDave Liu * (injecting errors is initially disabled) 7*47e8bc84SDave Liu 8*47e8bc84SDave Liu * define inject mask (which tells the DDR controller what type of errors 9*47e8bc84SDave Liu we'll be injecting: single/multiple bit etc.) 10*47e8bc84SDave Liu 11*47e8bc84SDave Liu * enable injecting errors - from now on the controller injects errors as 12*47e8bc84SDave Liu indicated in the inject mask 13*47e8bc84SDave Liu 14*47e8bc84SDave LiuIMPORTANT NOTICE: enabling injecting multiple-bit errors is potentially 15*47e8bc84SDave Liudangerous as such errors are NOT corrected by the controller. Therefore caution 16*47e8bc84SDave Liushould be taken when enabling the injection of multiple-bit errors: it is only 17*47e8bc84SDave Liusafe when used on a carefully selected memory area and used under control of 18*47e8bc84SDave Liuthe 'ecc testdw' 'ecc testword' command (see example 'Injecting Multiple-Bit 19*47e8bc84SDave LiuErrors' below). In particular, when you simply set the multiple-bit errors in 20*47e8bc84SDave Liuinject mask and enable injection, U-Boot is very likely to hang quickly as the 21*47e8bc84SDave Liuerrors will be injected when it accesses its code, data etc. 22*47e8bc84SDave Liu 23*47e8bc84SDave Liu 24*47e8bc84SDave LiuUse cases for DDR 'ecc' command: 25*47e8bc84SDave Liu================================ 26*47e8bc84SDave Liu 27*47e8bc84SDave LiuBefore executing particular tests reset target board or clear status registers: 28*47e8bc84SDave Liu 29*47e8bc84SDave Liu=> ecc captureclear 30*47e8bc84SDave Liu=> ecc errdetectclr all 31*47e8bc84SDave Liu=> ecc sbecnt 0 32*47e8bc84SDave Liu 33*47e8bc84SDave Liu 34*47e8bc84SDave LiuInjecting Single-Bit Errors 35*47e8bc84SDave Liu--------------------------- 36*47e8bc84SDave Liu 37*47e8bc84SDave Liu1. Set 1 bit in Data Path Error Inject Mask 38*47e8bc84SDave Liu 39*47e8bc84SDave Liu=> ecc injectdatahi 1 40*47e8bc84SDave Liu 41*47e8bc84SDave Liu2. Run test over some memory region 42*47e8bc84SDave Liu 43*47e8bc84SDave Liu=> ecc testdw 200000 10 44*47e8bc84SDave Liu 45*47e8bc84SDave Liu3. Check ECC status 46*47e8bc84SDave Liu 47*47e8bc84SDave Liu=> ecc status 48*47e8bc84SDave Liu... 49*47e8bc84SDave LiuMemory Data Path Error Injection Mask High/Low: 00000001 00000000 50*47e8bc84SDave Liu... 51*47e8bc84SDave LiuMemory Single-Bit Error Management (0..255): 52*47e8bc84SDave Liu Single-Bit Error Threshold: 255 53*47e8bc84SDave Liu Single Bit Error Counter: 16 54*47e8bc84SDave Liu... 55*47e8bc84SDave LiuMemory Error Detect: 56*47e8bc84SDave Liu Multiple Memory Errors: 0 57*47e8bc84SDave Liu Multiple-Bit Error: 0 58*47e8bc84SDave Liu Single-Bit Error: 0 59*47e8bc84SDave Liu... 60*47e8bc84SDave Liu 61*47e8bc84SDave Liu16 errors were generated, Single-Bit Error flag was not set as Single Bit Error 62*47e8bc84SDave LiuCounter did not reach Single-Bit Error Threshold. 63*47e8bc84SDave Liu 64*47e8bc84SDave Liu4. Make sure used memory region got re-initialized with 0x0123456789abcdef 65*47e8bc84SDave Liu 66*47e8bc84SDave Liu=> md 200000 67*47e8bc84SDave Liu00200000: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 68*47e8bc84SDave Liu00200010: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 69*47e8bc84SDave Liu00200020: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 70*47e8bc84SDave Liu00200030: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 71*47e8bc84SDave Liu00200040: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 72*47e8bc84SDave Liu00200050: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 73*47e8bc84SDave Liu00200060: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 74*47e8bc84SDave Liu00200070: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 75*47e8bc84SDave Liu00200080: deadbeef deadbeef deadbeef deadbeef ................ 76*47e8bc84SDave Liu00200090: deadbeef deadbeef deadbeef deadbeef ................ 77*47e8bc84SDave Liu 78*47e8bc84SDave LiuInjecting Multiple-Bit Errors 79*47e8bc84SDave Liu----------------------------- 80*47e8bc84SDave Liu 81*47e8bc84SDave Liu1. Set more than 1 bit in Data Path Error Inject Mask 82*47e8bc84SDave Liu 83*47e8bc84SDave Liu=> ecc injectdatahi 1 84*47e8bc84SDave Liu=> ecc injectdatalo 1 85*47e8bc84SDave Liu 86*47e8bc84SDave Liu2. Run test over some memory region 87*47e8bc84SDave Liu 88*47e8bc84SDave Liu=> ecc testword 200000 1 89*47e8bc84SDave Liu 90*47e8bc84SDave Liu3. Check ECC status 91*47e8bc84SDave Liu 92*47e8bc84SDave Liu=> ecc status 93*47e8bc84SDave Liu... 94*47e8bc84SDave LiuMemory Data Path Error Injection Mask High/Low: 00000001 00000001 95*47e8bc84SDave Liu... 96*47e8bc84SDave LiuMemory Error Detect: 97*47e8bc84SDave Liu Multiple Memory Errors: 0 98*47e8bc84SDave Liu Multiple-Bit Error: 1 99*47e8bc84SDave Liu Single-Bit Error: 0 100*47e8bc84SDave Liu... 101*47e8bc84SDave Liu 102*47e8bc84SDave LiuThe Multiple Memory Errors flags not set and Multiple-Bit Error flags are set. 103*47e8bc84SDave Liu 104*47e8bc84SDave Liu4. Make sure used memory region got re-initialized with 0x0123456789abcdef 105*47e8bc84SDave Liu 106*47e8bc84SDave Liu=> md 200000 107*47e8bc84SDave Liu00200000: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 108*47e8bc84SDave Liu00200010: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 109*47e8bc84SDave Liu00200020: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 110*47e8bc84SDave Liu00200030: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 111*47e8bc84SDave Liu00200040: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 112*47e8bc84SDave Liu00200050: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 113*47e8bc84SDave Liu00200060: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 114*47e8bc84SDave Liu00200070: 01234567 89abcdef 01234567 89abcdef .#Eg.....#Eg.... 115*47e8bc84SDave Liu00200080: deadbeef deadbeef deadbeef deadbeef ................ 116*47e8bc84SDave Liu00200090: deadbeef deadbeef deadbeef deadbeef ................ 117*47e8bc84SDave Liu 118*47e8bc84SDave Liu 119*47e8bc84SDave LiuTest Single-Bit Error Counter and Threshold 120*47e8bc84SDave Liu------------------------------------------- 121*47e8bc84SDave Liu 122*47e8bc84SDave Liu1. Set 1 bit in Data Path Error Inject Mask 123*47e8bc84SDave Liu 124*47e8bc84SDave Liu=> ecc injectdatahi 1 125*47e8bc84SDave Liu 126*47e8bc84SDave Liu2. Enable error injection 127*47e8bc84SDave Liu 128*47e8bc84SDave Liu=> ecc inject en 129*47e8bc84SDave Liu 130*47e8bc84SDave Liu3. Let u-boot run for a with Single-Bit error injection enabled 131*47e8bc84SDave Liu 132*47e8bc84SDave Liu4. Disable error injection 133*47e8bc84SDave Liu 134*47e8bc84SDave Liu=> ecc inject dis 135*47e8bc84SDave Liu 136*47e8bc84SDave Liu4. Check status 137*47e8bc84SDave Liu 138*47e8bc84SDave Liu=> ecc status 139*47e8bc84SDave Liu 140*47e8bc84SDave Liu... 141*47e8bc84SDave LiuMemory Single-Bit Error Management (0..255): 142*47e8bc84SDave Liu Single-Bit Error Threshold: 255 143*47e8bc84SDave Liu Single Bit Error Counter: 199 144*47e8bc84SDave Liu 145*47e8bc84SDave LiuMemory Error Detect: 146*47e8bc84SDave Liu Multiple Memory Errors: 1 147*47e8bc84SDave Liu Multiple-Bit Error: 0 148*47e8bc84SDave Liu Single-Bit Error: 1 149*47e8bc84SDave Liu... 150*47e8bc84SDave Liu 151*47e8bc84SDave LiuObserve that Single-Bit Error is 'on' which means that Single-Bit Error Counter 152*47e8bc84SDave Liureached Single-Bit Error Threshold. Multiple Memory Errors bit is also 'on', that 153*47e8bc84SDave Liuis Counter reached Threshold more than one time (it wraps back after reaching 154*47e8bc84SDave LiuThreshold). 155