大家好, 我再ddr调试中, SYNCRST不了,求助!!!!!
PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_DDR2_MDDR, PSC_POWERDOMAIN_ALWAYS_ON, PSC_MDCTL_NEXT_SYNCRST);
int PSCModuleControl(unsigned int baseAdd, unsigned int moduleId,
unsigned int powerDomain, unsigned int flags) {
volatile unsigned int timeout = 0xFFFFFF;
int retVal = 0;
unsigned int status = 0;
HWREG(baseAdd + PSC_MDCTL(moduleId)) = (flags & PSC_MDCTL_NEXT);
if (powerDomain == 0) {
HWREG(baseAdd + PSC_PTCMD) = PSC_PTCMD_GO0;
} else {
HWREG(baseAdd + PSC_PTCMD) = PSC_PTCMD_GO1; }
if (powerDomain == 0) {
do {
status = HWREG(baseAdd + PSC_PTSTAT) & PSC_PTSTAT_GOSTAT0;
printf("do status = %d\n", status); 停在这里出不来。
} while (status && timeout–);
} else {
do {
status = HWREG(baseAdd + PSC_PTSTAT) & PSC_PTSTAT_GOSTAT1;
} while (status && timeout–);
}
if (timeout != 0) {
timeout = 0xFFFFFF;
status = flags & PSC_MDCTL_NEXT;
do {
timeout–;
printf("timeout = 0x%x\n", timeout);
} while (timeout
&& (HWREG(baseAdd + PSC_MDSTAT(moduleId)) & PSC_MDSTAT_STATE)!= status);
}
if (timeout == 0) {
retVal = -1;
}
return retVal;
}
Shine:
参考e2echina.ti.com/…/159466