ECC function is guaranteed by hardware, no chance for malfunction. Injection test requires following sequence (this assumes DDR controller is up with D_INIT bit set and cache disabled):
1) DATA_ERR_INJECT_LO = 00000001 (the LSbit of 64-bit word is going to be inverted);
2) ERR_INJECT[EIEN]=1; enable injection 2a) read back ERR_INJECT to make sure it has been written;
3) write 0x0000000000000000 to some DDR location (actually 0x0000000000000001 will be written due to above steps);
4) repeat step 3 for a number of address locations to inject the number of single bit errors;
5) ERR_INJECT[EIEN]=0; disable injection
Reading of the location used in step 3 should result in value 0000000000000000 (LSbit is corrected). ERR_DETECT register should report a single-bit ECC error, ERR_SBE[SBEC] counts errors.