用6678写了一个单镜像程序,用仿真器调试每个核都可以实现功能(0-3核每个核点亮evm板上一个灯),加载进去只有0核正常,只有0核的灯点亮,其他核没有跑起来。
程序如下,大家帮忙看下什么原因:
#define BOOT_MAGIC_ADDRESS 0x87fffc
#define BOOT_ENTRY_ADDRESS 0x810000
#define IPC_INTERRUPT_CORE0 0x02620240
#define LOCAL_TO_GLOBAL_ADDR(addr,corenumber) (unsigned int)addr<0x1000000?\
(unsigned int)addr+(0x10000000+corenumber*0x1000000):\
(unsigned int)addr
ulCurrCoreNum = MultiProc_self();
/* 由0核加载各个核心的程序 */
if(ulCurrCoreNum == 0)
{
System_printf ("\n开始加载各核程序\n");
System_printf("core0 0x1087fffc: 0x%x\n",*(UInt32*)0x1087fffc);
CSL_BootCfgUnlockKicker();
/* 逐个核核加载程序 */
for(coreIndex = 1; coreIndex < 8; coreIndex++)
{
bootMagicAddr0 = (unsigned int *)(LOCAL_TO_GLOBAL_ADDR(BOOT_MAGIC_ADDRESS,0));
bootMagicAddr = (unsigned int *)(LOCAL_TO_GLOBAL_ADDR(BOOT_MAGIC_ADDRESS,coreIndex));
if(*bootMagicAddr0 < 0x1000000)
{
bootEntryAddr = LOCAL_TO_GLOBAL_ADDR(*bootMagicAddr0, coreIndex);
// bootEntryAddr = LOCAL_TO_GLOBAL_ADDR(*bootMagicAddr0, 0);
}
else
{
bootEntryAddr = *bootMagicAddr0 + coreIndex * 0x1000000;
// bootEntryAddr = *bootMagicAddr0;
}
*bootMagicAddr = bootEntryAddr;
CSL_IPC_genGEMInterrupt(coreIndex, 0);
}
CSL_BootCfgLockKicker();
System_printf ("\n各核程序加载完成\n");
}