/*****************************************************************************
Prototype : lock_mem_prot_regs
Description : lock memory protection registers
Input : None
Output : None
Return Value :
History :
1.Date : 2010/12/12
Author : Brighton Feng
Modification : Created function
*****************************************************************************/
#pragma CODE_SECTION (lock_mem_prot_regs, ".text:Core_MPAX")
void lock_mem_prot_regs()
{
int i;
/*1. Write a 1 to the KEYR field of the MPLKCMD register. This resets some internal
status for the MPLK0 through MPLK3 registers.*/
gpCGEM_regs->MPLKCMD = (1<<CSL_CGEM_MPLKCMD_KEYR_SHIFT);
/*2. Write the key to MPLK0 through MPLK3. All four registers must be written
exactly once. They may be written in any order.*/
for(i=0; i<4; i++)
{
gpCGEM_regs->MPLK = mem_prot_key;
}
/*3. Write a 1 to the LOCK field of the MPLKCMD register. This engages the lock.*/
gpCGEM_regs->MPLKCMD = (1<<CSL_CGEM_MPLKCMD_LOCK_SHIFT);
/*wait to make sure it is locked*/
while(0==(gpCGEM_regs->MPLKSTAT&CSL_CGEM_MPLKSTAT_LK_MASK));
}
TI原厂的6678开发板,每次启动仿真运行到KeyStone_common_CPU_init()中 while(0==(gpCGEM_regs->MPLKSTAT&CSL_CGEM_MPLKSTAT_LK_MASK));这个地方时就在这里死循环了,请教各位大侠,如何解决这个问题,在下感谢了。
|