So, the EDAC provides what we need.
linux/drivers/edac/
layerscape_edac.c
fsl_ddr_edac.c
edac_mc.c
The edac_mc.c maintains the statistics. Layerscape_edac is a wrapper around fsl_ddr_edac.c that does much of the work. So, this does error checking, stats, and scrubbing. Since this is simply the mpc85xx_edac.c renamed.
If you can find out if there are any kernel or uboot changes required to support this edac driver, this would be very helpful. I need to backport this driver to SDK 2.0 and need to know if there are any IFC/ECC related configuration changes I need to do in the kernel and/or u-boot to support this EDAC driver. ECC is already enabled and the IFC/DDR design already fully supports ECC.
For example, is the ECC_FIX_EN enabled or why is it not enabled in the EDAC driver? The ECC_FIX_EN cues the DDR controller that it should “fix” an ECC error by issuing a new transaction to read the address with the failing bit, the DDR controller (internal to LS1043A SoC) will then correct the bit and write the data back to memory. Also, the DDR controller will periodically issue a read to all memory at the interval defined by ECC_SCRUB_INT. So this is definitely part of the patrol scrub operation that the EDAC driver manages, but is it enabled? And why is it not enabled if not?
The ECC_FIX_EN is a feature of the IFC that does the following:
The DDR controller supports ECC fixing in memory. In this mode, the DDR controller will automatically fix
any detected single-bit errors by issuing a new transaction to read the address with the failing bit,
correcting the bit, and writing the data back to memory. The single-bit error will still be counted in the
ERR_SBE register for this case, but the controller will automatically fix the error. Note that during the
'read back', the single-bit error will not be double counted in the ERR_SBE register. In addition, the DDR
controller will periodically issue a read to memory at the interval defined by ECC_SCRUB_INT. If a
single-bit error is detected during a periodic read, it will be fixed. In this case, the error will be reported as
an SSBE in the ERR_SBE register. If a multi-bit eror is detected, then it will be reported in the
ERR_DETECT register. Also note that if a subsequent single-bit error is detected at the same address
while a first error is being fixed, then the second error will not be reported. Also, after a first SBE is
detected, no other SBEs will be fixed until the first SBE has been fixed in memory.This bit should only be
set if DDR_SDRAM_CFG[ECC_EN] is also set.
Here are the three questions I have for you:
1. What changes are required to configure ECC in the kernel and uboot to support the EDAC driver for ARM?
2. Where are the kernel and uboot changes to support the EDAC driver need to be made, what files?
3. Why does the EDAC driver not require ECC_FIX_IN to be set?
For example, why is ECC_FIX_IN not set in U-boot after the D_INIT or set by the EDAC driver?