Other Parts Discussed in Thread: DM3725, OMAP3530
I am trying to program C64x+ IVA subsystem to standby mode.
Below is the snippet of code to put dsp to sleep from task context with all except mail box interrupt is enabled, tick is disabled.
void pdc_isr(UINT32 irq_id)
{
pdc_isr_count++;
*((volatile int*)0x483060E0) = (*((volatile int*)0x483060E0)&~0x3) | 0x0; //PM_PWSTCTRL_IVA2
*((volatile int*)0x48004048) = 0x3; // CM_CLKSTCTRL_IVA2
*((volatile int*)0x483060C8) = 0x0; //PM_WKDEP_IVA2
*((volatile int*)0x48004000) = 0x0; // CM_FCLKEN_IVA2 EN_IVA2
}
void DSPDomainSleep()
{
UINT32 imask,i, taskKey, swiKey;
UINT32 sys_pdccmd_val;
UINT32 *cm_iva2 = 0x48004000;
UINT32 clksel1_val,clksel2_val;
Bool l1CacheEnabled;
Bool l2CacheEnabled;
/* Disable DSP tick timer to suppress till MCU sends/reconnects */
Clock_tickStop();
/* Disable all except mailbox interrupt */
CLI(imask);
Hwi_disableInterrupt();
....... // disble all irq enable except mail box evt 55
STI(imask);
/* Configure PDC to allow DSP core to to sleep when idle intruction is called with all L1 & L2 memory in low power sleep mode */
sys_pdccmd_val = HWREG(IVA_SYS_PDCCMD);
/* Set IVA DSP PLL to low power mode while in domain sleep & restore later */
clksel1_val = HWREG(CM_CLKSEL1_PLL_IVA2);
clksel2_val = HWREG(CM_CLKSEL2_PLL_IVA2);
putIva2DpllInBypass();
CLI(imask);
/* disable scheduling */
taskKey = Task_disable();
swiKey = Swi_disable();
l1CacheEnabled = 1;
l2CacheEnabled = 1;
if (l1CacheEnabled || l2CacheEnabled) {
//Cache_wbAll();
Cache_wb(0, 0, Cache_Type_ALL, TRUE);/* start=end=0 -> clean bufs */
/* now bypass the caches... */
if (l1CacheEnabled) {
Cache_disable(Cache_Type_L1);
}
if (l2CacheEnabled) {
Cache_disable(Cache_Type_L2);
}
}
*((volatile int*)0x01C21070) = 0xFFFFFFFF;
*((volatile int*)0x01C21074) = 0xFFFFFFFF;
*((volatile int*)0x01C21078) = 0xFFFFFFFF;
*((volatile int*)0x01C21080) = 0xFFFFFFFF;
*((volatile int*)0x01C21084) = 0xFFFFFFFF;
*((volatile int*)0x01C21088) = 0xFFFFFFFF;
*((volatile int*)0x01800040) = 0xFFFFFFFF;
*((volatile int*)0x01800044) = 0xFFFFFFFF;
*((volatile int*)0x01800048) = 0xFFFFFFFF;
*((volatile int*)0x01C21070) = 1<<10;
/* - Allow DSP to go to domain sleep by calling IDLE instruction */
tscl1 = TSCL;
/* PDCCMD IDLE with all memory sleep mode */
HWREG(IVA_SYS_PDCCMD) = 0x15555;//IVA_DOMAIN_SLEEP_PDC_CMD_VAL;
HWREG(IVA_SYS_PDCCMD);
asm("\tmvk 0x2400, b3");
asm("\tmvc csr, b4");
asm("\tmvc csr, b5");
asm("\tor b3, b4, b4");
asm("\tmvc b4, csr");
asm("\tor 1, b4, b4");
asm("\tmvc b4, csr");
asm("\tIDLE");
asm("\tnop");
asm("\tnop");
asm("\tnop");
asm("\tnop");
asm("\tnop");
asm("\tnop");
tscl2 = TSCL;
Task_restore(taskKey);
Swi_restore(swiKey);
STI(imask);
/* restore to normal operation clock mode */
putIva2DpllInLocked();
/* Disable standby on PDC when idle is called */
HWREG(IVA_SYS_PDCCMD) = sys_pdccmd_val;
/* enable all irq required */
....
}
I could see DSP core is going to idle state & can wakeup when mailbox interrupt is raised.
When in idle, TSC is running & PLL clock is not cut from PRCM.
Other IP's such as EDMA or VLCD are not used.
TMS320C64x+ DSP mega module guide mention C64x+ cant program PWRD bit in CSR for power down.
Can any guide, how can i get this DSP mega module in DM3725 in standby mode. Any reference would be help full
Thanks.
Deepak Reddy