MMU
MMU
MMU
MMU 初始化部分分析
void MMU_Init(MMU_Table table[])
{
//========================== IMPORTANT NOTE =========================
//The current stack and code area can't be re-mapped in this routine.
//If you want memory map mapped freely, your own sophiscated MMU
//initialization code is needed.
//===================================================================
上面部分的中文意思是 : 这段程序不能实现当前堆栈和代码区域的重新映射 , 假如你想让存
储区域自由映射,需要你自己编写一个细致入微的 MMU 初始化代码。
MMU_DisableDCache();
MMU_DisableICache();
MMU_InvalidateDCache(); //invalidate data cache all
MMU_DCacheCleanInvalidateAll();
MMU_InvalidateICache();
#if 0
//To complete MMU_Init() fast, Icache may be turned on here.
MMU_EnableICache();
#endif
MMU_DisableMMU();
MMU_InvalidateTLB();
for(; table->vEnd; table++)
MMU_SetMTT(table->vStart, table->vEnd, table->pStart, table->attr);
MMU_SetTTBase(_MMUTT_STARTADDRESS);
MMU_SetDomain(0x55555550|DOMAIN1_ATTR|DOMAIN0_ATTR);
//DOMAIN1: no_access, DOMAIN0,2~15=client(AP is checked)
MMU_SetProcessId(0x0);
MMU_EnableAlignFault();
MMU_EnableMMU();
MMU_EnableICache();
MMU_EnableDCache(); //DCache should be turned on after MMU is turned on.
}
评论1
最新资源