void L1P_EDC_setup()
{
Uint32 preL1PMPPA[16];
/* 1. Disable the EDC */
CSL_CGEM_disablePMCErrorDetection();
/* 2. Clear any EDC errors */
CSL_CGEM_clearPMCErrorDetectionStatus(1, 1);
/* 3. Memory Scrubbing with IDMA, generate the parity bits*/
memcpy(preL1PMPPA, (void *)gpCGEM_regs->L1PMPPA, 64);//save protection attributes
L1P_memory_protection_cfg(0xFFFF); //enable IDMA access to L1P
IDMA_copy(0x00E00000, 0x00E00000, 32*1024, DMA_WAIT);
L1_MPPA_setup(gpCGEM_regs->L1PMPPA, preL1PMPPA);//restore protection for L1
/* 4. Enable the EDC*/
CSL_CGEM_enablePMCErrorDetection();
}