Commit 2dbfa764 authored by Federico Vaga's avatar Federico Vaga

sw:drv: better to purge on OFF

By puring on OFF we clean up the HMQs from previous pending messages,
but we leave the possibility to the host to pre-load the HMQs for
the next running firmware
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 69d89dde
......@@ -46,19 +46,19 @@ static void trtl_cpu_reset_clr(struct trtl_dev *trtl, uint8_t mask)
static void trtl_cpu_off(struct trtl_cpu *cpu)
{
struct trtl_dev *trtl = to_trtl_dev(cpu->dev.parent);
int i;
trtl_cpu_reset_set(trtl, (1 << cpu->index));
/* Clean up all the HMQ */
for (i = 0; i < trtl->cfgrom.n_hmq[cpu->index]; ++i)
trtl_hmq_purge(&cpu->hmq[i]);
}
static void trtl_cpu_on(struct trtl_cpu *cpu)
{
struct trtl_dev *trtl = to_trtl_dev(cpu->dev.parent);
int i;
/* Clean up all the HMQ */
for (i = 0; i < trtl->cfgrom.n_hmq[cpu->index]; ++i)
trtl_hmq_purge(&cpu->hmq[i]);
/* now the CPU can run */
trtl_cpu_reset_clr(trtl, (1 << cpu->index));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment