为什么要先配置L1PMPPA=0xffff,
后要还原L1PMPPA为默认值
这样设置后,如果默认值不是0xffff,那不是无法访问相关的地址了吗?
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();
}
Andy Yin1:
是的,具体请看c66x corepac手册关于L1MPPA寄存器的配置描述,当相应bit为1时才允许访问,否则是会决绝相应master的访问。