Hello,
I have 2 identical boxes running with a DM648 DSP hosted by a PowerPC processor via the PCI port. One Box runs the DM648 with a DSP/Bios (v5.41.02.14) Application only, and another box runs a DSP Application with both a DSP/Bios (v5.41.02.14) Application using the DM648 dvsdk (dvsdk_1_11_00_00_DM648) psp drivers. The PowerPC Host sets up the PSC Controller identically on both boxes as well.
I have specified a User Init Function in the DSP Bios for both applications in the .tcf file, and it is shown below. This code works fine with the DSP/Bios only application, but the DSP Peripherals get into a strange state and will not initialize with the DSP running the DSP/Bios with dvsdk psp drivers. Why is there a problem with the dvsdk version of our application?
The User Initialization code is as follows:
void UserInit(void)
{
setPSCModuleState(PSC_UART, PSC_DISABLE);
// Disable Modules
setPSCModuleState(PSC_VP2, PSC_DISABLE);
setPSCModuleState(PSC_EDMACC, PSC_DISABLE);
// Enable Modules
setPSCModuleState(PSC_VIC, PSC_ENABLE);
setPSCModuleState(PSC_GPIO, PSC_ENABLE);
setPSCModuleState(PSC_I2C, PSC_ENABLE);
setPSCModuleState(PSC_PCI, PSC_ENABLE);
setPSCModuleState(PSC_EDMACC, PSC_ENABLE);
setPSCModuleState(PSC_VP2, PSC_ENABLE);
setPSCModuleState(PSC_MCASP, PSC_ENABLE);
//Turn Off unusued Modules
// Turn Off Ethernet Subsystem
setPSCModuleState(PSC_ETHERNET, PSC_DISABLE);
return;
}
and for your info, SetPSCModule State is shown below (same code as found in DM648 .gel file):
Uint32 setPSCModuleState(Uint32 module, Uint32 state)
/* Changes the module state within the PSC, based on the value
0 = SwRstDisable 1 = SyncRst 2 = Disable 3 = Enable */
{
volatile Uint32 *ctl_addr;
volatile Uint32 *stat_addr;
volatile Uint32 *cmd_reg;
Uint32 lrst = 0x0l;
/* Set Local Reset Variable */
if (module != PSC_C64PLUS_CPU)
{
lrst = PSC_LRST;
}
/* set next state for module */
stat_addr = (Uint32 *)(PSC_MOD_STAT_REG_BASE + (module * 4));
ctl_addr = (Uint32 *)(PSC_MOD_CNTL_REG_BASE + (module * 4));
*ctl_addr = ((*ctl_addr & 0xFFFFFE00) | state | lrst);
/* evaluate next state for given power domain - 'GO' */
cmd_reg = (volatile Uint32 *)(PSC_PTCMD_REG_BASE);
if (module < PSC_ETHERNET)
{
*cmd_reg = PSC_GO0;
}
else
{
*cmd_reg = PSC_GO1;
}
/* poll transition status for completion */
//while (((*(int *)stat_addr & 0x000001F) != state) & (*(int *)PSC_PTSTAT_REG_BASE != 0x0));
while (*((volatile Uint32 *)PSC_PTSTAT_REG_BASE) != 0x0);
return ((*stat_addr) & 0xf);
}