Hi Bulat,
After disabled the data cache before doing any read/write operation. still ecc error is not generated by DDR controller.
I am using the below u-boot code to generate the single bit error:
===============================================================================
register u64 *i;
u64 *addr = 0x200000;
u32 count = 0x10;
/*Initilize the ret variable*/
u64 ret = 0xffffffffffffffffUL;
/* The pattern is written into memory to generate error */
u64 pattern = 0xfedcba9876543210UL;
/* After injecting error, re-initialize the memory with the value */
u64 writeback = 0x0123456789abcdefUL;
/*one bit mask in the higher 32 bit*/
ddr->data_err_inject_hi = 0x1;
/*clear all mask in lower 32bit*/
ddr->data_err_inject_lo = 0x0;
/*Disable the interrupts*/
disable_interrupts();
/*Diabled Data cache*/
dcache_disable();
for (i = addr; i < addr + count; i++) {
/* enable injects */
ddr->ecc_err_inject |= ECC_ERR_INJECT_EIEN;
/* write memory location injecting errors */
*((u64 *) i) = pattern;
/* disable injects */
ddr->ecc_err_inject &= ~ECC_ERR_INJECT_EIEN;
/* read data, this generates ECC error */
ret = *((u64 *) i);
/* re-initialize memory, double word write the location again,
* generates new ECC code this time */
*((u64 *) i) = writeback;
}
/*Enabled Data cache*/
dcache_enable();
/*Enable the interrupts*/
enable_interrupts();
===============================================================================
Any sequence,I missed?
Regards,
Karunakaran R