I have a few questions on the C6457 CSL regarding the PSC (power sleep controller).
(1)
CSL_PscmoduleState PscmoduleState;
PscmoduleState.module = CSL_PSC_MODULE_EMIF64;
CSL_pscGetHwStatus(hPsc, CSL_PSC_QUERY_MODULE_STAT, &PscmoduleState);
One would expect the above code to give either 0x0 (SwRstDisable) or 0x3 (Enabled) for the PscmoduleState.state datum. However, I am seeing 13 decimal which would be a reserved state.
Obviously, I've already done the CSL_pscInit and CSL_pscOpen. I just expected that with the query requested of the CSL that the "state" of the appropriate MDSTAT register would be returned.
(2)
CSL_PscPowerDomain pwrDmn = CSL_PSC_PWRDMN_ALWAYSON;
CSL_PscPeripherals module = CSL_PSC_MODULE_EMIF64;
CSL_PscPwrDmnTransState response;
response.pwrDmn = pwrDmn;
response.status = false;
do
{
CSL_pscGetHwStatus
(hPsc, CSL_PSC_QUERY_PWRDMN_TRANS_STAT, (void*)&response);
} while (response.status);
// Enable power domain for the module ...
CSL_pscHwControl(hPsc, CSL_PSC_CMD_ENABLE_PWRDMN, &pwrDmn);
// Enable clock for the specified module ...
CSL_pscHwControl(hPsc, CSL_PSC_CMD_ENABLE_MODULE, &module);
// Enable power domain GO transition ...
CSL_pscHwControl(hPsc, CSL_PSC_CMD_PWRDMN_TRNS, &pwrDmn);
response.pwrDmn = pwrDmn;
response.status = false;
do
{
CSL_pscGetHwStatus
(hPsc, CSL_PSC_QUERY_PWRDMN_TRANS_STAT, (void*)&response);
} while (response.status);
Again, I've already done CSL_pscInit and CSL_pscOpen as before but the first loop does not exit: The CSL_pscGetHwStatus always returns true in response.status. I am following TI recommended protocol from section 2.3.4 of the SPRUGL4 "TMS320C6457 DSP Power/Sleep Controller (PSC)".
(3)
Also, in the CSL "examples" for the EMIFA, the method "enableEMIFA" does the following for its "wait for transition to finish loop":
response.pwrDmn = CSL_PSC_PWRDMN_ALWAYSON;
response.status = 0x0;
do{
CSL_pscGetHwStatus(hPsc, CSL_PSC_QUERY_PWRDMN_TRANS_STAT, (void *)&response);
(response.status) &= (1 << CSL_PSC_PWRDMN_ALWAYSON);
}while((response.status) != 0x0);
This appears to be incorrect because the response.status is a Bool as defined in CSL_PscPwrDmnTransState in <csl_psc.h>
I'm confused: In summary, if appears that the "wait for PTSTAT.GOSTAT[x]" is not finishing, I cannot read the module status which should be 0 or 3 (I see 13) and the CSL sample code to show how to enable the EMIFA module appears incorrect.
Any ideas?