Hi,
I'm using SRIO on the C6455 and obviously I need to enable the SRIO peripheral.
The example does the following:
/* Unlock the powersaver control register */
CSL_FINST (((CSL_DevRegs*)CSL_DEV_REGS)->PERLOCK, DEV_PERLOCK_LOCKVAL, UNLOCK);
/* Enable the SRIO */
CSL_FINST (((CSL_DevRegs*)CSL_DEV_REGS)->PERCFG0, DEV_PERCFG0_SRIOCTL, ENABLE);
This has always worked for me but I'm worried that I'm not explicitly waiting for the SRIO peripheral to become enabled and therefore it is not guaranteed to work. At the moment this code happens to be followed by functions that don't access the SRIO peripheral.
According to the documentation (tms320c6455.pdf) after writing PERCFG0 I need to wait for 16 SYSCLK3 cycles.
Should I add a loop, insert NOPs or not worry about it?
I added NOPs but it's not clear to me that the optimizer couldn't rearrange this code and therefore it's still not guaranteed. Also, I don't know what a SYSCLK3 is and how it relates to a NOP.
CSL_DevRegs *const deviceStateControlRegisters
= reinterpret_cast<CSL_DevRegs*>(CSL_DEV_REGS);
deviceStateControlRegisters->PERLOCK = CSL_FMKT(DEV_PERLOCK_LOCKVAL, UNLOCK);
CSL_FINST(deviceStateControlRegisters->PERCFG0, DEV_PERCFG0_SRIOCTL, ENABLE);
asm(" NOP 8");
asm(" NOP 8");
Any thoughts greatly appreciated,
Matt