We are booting dm647 from a host over pci. We use the Local Reset to initialize the dsp before loading code and de-asserting the Local Reset. Occasionally when performing the Local Reset in preparation for re-loading a dsp with an application, our code times out waiting for the LRSTDONE!
Here's the host's routine to perform the Local Reset. The dm647_read/writereg routines are accessing the dsp registers over pci.
static void dm647_local_reset(dm647_t *dsp)
{
u32 reg;
int timeout = 1000;
reg = dm647_readreg(dsp, DM647_PSC_MDSTAT33_ADR);
/* assert local reset bit */
dm647_writereg(dsp, DM647_PSC_MDCTL33_ADR, reg & ~DM647_PSC_MDCTL33_LRST);
au_sync(); /* cpu pipeline flush */
/* spin, waiting for reset to be indicated */
while (--timeout) {
msleep(1);
if ((dm647_readreg(dsp, DM647_PSC_MDSTAT33_ADR) & DM647_PSC_MDSTAT33_LRSTDONE))
break;
}
if (timeout==0)
DM647_SERR(dsp, "%s: Timed out waiting for local reset", __func__);
}
Are we missing something? Do we need to perform some additional action to reset the dsp before loading new code?
Thanks, Geoff