Ejemplo n.º 1
0
/*
 *  ======== Mmu_Module_startup ========
 */
Int Mmu_Module_startup(Int phase)
{
    /* disable the MMU */
    Mmu_disable();

    /* zero out the descriptor table entries */
    memset(Mmu_module->tableBuf, 0, 0x4000);

    /*
     *  Initialize the descriptor table based upon static config
     *  This function is generated by the Mmu.xdt file.
     */
    Mmu_initTableBuf(Mmu_module->tableBuf);

    Mmu_init();

    Mmu_setDomainAccessCtrlReg(ENABLE_MEMORY_PROTECTION);

    if (Mmu_enableMMU) {
        /* enable the MMU */
        Mmu_enable();
    }

    return (Startup_DONE);
}
Ejemplo n.º 2
0
/*
 *  ======== Cache_startup ========
 *  Enable cache early if Cache_enableCache == TRUE.
 */
Void Cache_startup()
{
    UInt enabled;

    enabled = Cache_getEnabled();

    /* disable the caches if anything is currently enabled */
    if (enabled) {
        Cache_invL1pAll();
        Cache_disable(Cache_Type_ALL);
    }
    else {
        Cache_invL1pAll();
        Cache_invL1dAll();
    }

    if (Cache_enableCache) {
        /* 
         * CCS reset doesn't disable the MMU.
         * Since the MMU may still be set up and enabled
         * from a previous application, disable the MMU now
         * to prevent miss-configuration, when the cache gets 
         * enabled
         */
        Mmu_disable();          
        Cache_enable(Cache_Type_ALL);
    }
}