This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

enableEMIFA函数的疑问



在6457芯片中给出EMIFA设置的例子,代码如下:

void enableEMIFA()
{
    CSL_PscObj pscObj;
    CSL_PscHandle hPsc;
    CSL_Status status;
    CSL_PscPowerDomain pwrDmn = CSL_PSC_PWRDMN_ALWAYSON;
    CSL_PscPeripherals module = CSL_PSC_MODULE_EMIF64;
    CSL_PscPwrDmnTransState response;

    memset(&pscObj, 0, sizeof(CSL_PscObj));     

    /* Init PSC module */
    CSL_pscInit(NULL);

    /* Open PSC module to get a Handle */
    hPsc = CSL_pscOpen(&pscObj, CSL_PSC, NULL, &status);

    /* Enable power domain for EMIFA */
    CSL_pscHwControl(hPsc, CSL_PSC_CMD_ENABLE_PWRDMN, &pwrDmn);         ----- (1)

    /* Enable clock for the specified module EMIFA */  
    CSL_pscHwControl(hPsc, CSL_PSC_CMD_ENABLE_MODULE, &module);            ----- (2)
 
    /* Enable EMIFA Power domain GO transition */
    CSL_pscHwControl(hPsc, CSL_PSC_CMD_PWRDMN_TRNS, &pwrDmn);              ----- (3)

    response.pwrDmn = CSL_PSC_PWRDMN_ALWAYSON;                  
    response.status = 0x0;                                                                        ----- (4)
    do{   
        CSL_pscGetHwStatus(hPsc, CSL_PSC_QUERY_PWRDMN_TRANS_STAT, (void *)&response);
        (response.status) &= (1 << CSL_PSC_PWRDMN_ALWAYSON);
    }while((response.status) != 0x0);                                  ---- (5)

    /* Close the PSC module */
    CSL_pscClose(hPsc);                       ----- (6)
}

问题1:如果要使用EMIF,必须用CSL_pscHwControl同时实现(1)(2)(3)的设置吗?

问题2:语句4中,response.status 的含义,以及该字段值是0表示逻辑模块ON状态,还是OFF状态?

问题3:do...while的实现功能。我的理解是一直在检测模块是否ON状态了,如果如ON状态就退出检测,但又觉得不对。

问题4:CSL_pscClose的含义,是该模块的设置完毕,关闭设置功能;还是关闭该模块,该模块停止工作哪。

非常谢谢!

 

  • 1. 是的,需要在psc中使能emif module.

    2. 0表示转换完成,1表示还在转换。

    3. 看一下psc使能各个module的步骤,最后要等到status=0才表示转换完成。
    2.3 Executing State Transitions
    http://www.ti.com/lit/ug/sprugl4/sprugl4.pdf 

    4. 关闭设置功能。