i don't understand how to use the PDSP IRAM (firmware download address) Registers
i've seen in the example
/* This function controls the PDSP to load firmware to it. */
void pdsp_download_firmware(Uint16 pdsp, Uint8 *code, Uint32 size)
{
Uint16 idx;
Uint32 value;
Uint32 *reg;
/* Reset PDSP 1 */
pdsp_disable(pdsp);
/* Confirm PDSP has halted */
do
{
value = pdsp_running(pdsp);
} while (value == 1);
/* Download the firmware */
if (pdsp == 1)
memcpy ((void *)PDSP1_IRAM_REGION, code, size);
else
memcpy ((void *)PDSP2_IRAM_REGION, code, size);
/* Use the command register to sync the PDSP */
if (pdsp == 1)
reg = (Uint32 *)(PDSP1_CMD_REGION);
else
reg = (Uint32 *)(PDSP2_CMD_REGION);
*reg = 0xffffffff;
/* Wait to the memory write to land */
for (idx = 0; idx < 20000; idx++)
{
value = *reg;
if (value == 0xffffffff) break;
}
/* Reset program counter to zero, and clear Soft Reset bit. */
if (pdsp == 1)
reg = (Uint32 *)(PDSP1_REG_REGION + QM_REG_PDSP_CONTROL);
else
reg = (Uint32 *)(PDSP2_REG_REGION + QM_REG_PDSP_CONTROL);
value = *reg;
*reg = value & 0x0000fffe; //PC reset is in upper 16 bits, soft reset in bit 0
/* Enable the PDSP */
pdsp_enable(pdsp);
/* Wait for the command register to clear */
if (pdsp == 1)
reg = (Uint32 *)(PDSP1_CMD_REGION);
else
reg = (Uint32 *)(PDSP2_CMD_REGION);
do
{
value = *reg;
} while (value != 0);
}
But what exactly is the Uint8 *code pointer and how should i use it?
Codes for the different operations are already present somewhere inside the DSP or to be written by me?
How can I choose which operation to perform (QoS, Accumulation, ecc)? I've seen the differences in the Command Buffers section of the Command Interface Registers but i haven't understand how to chose one operation rather than another