Hi seL4 Devel,

We are trying to use the General Purpose Timer1 for our i.MX8MQ-based board 
within a simple CAmkES app. GPT1 is initialising and starting OK, but the 
interrupt handler for handling rollover is not being triggered. Through 
instrumenting the code with printf's, the GPT initialisation looks reasonable, 
and the expected rollover interrupt is being generated and seen within 
handleInterrupt(); however, the interrupt handler routine that has been 
registered is not being called.

I'm hoping that someone can give me some ideas where to investigate next please?

A few more details:

>From gpt_init() (in util_libs/libplatsupport/src/mach/imx/gpt.c), 
>instrumentation within allocate_irq_callback() confirms that, for:
gpt->irq_id = ps_irq_register(&gpt->io_ops.irq_ops, irq, gpt_handle_irq, gpt);

our values are:
irq->type = 3; // PS_INTERRUPT
irq->irq.number = 87 (0x57); // 55 (0x37) + 32 = 87 (0x57)

which agrees with the GPT1 entry from our dts file (when combined with the 
offset of 32, which I've seen explained elsewhere):
gpt@302d0000 {...
        reg = < 0x302d0000 0x10000 >;
        interrupts = < 0x00 0x37 0x04 >;...

And gpt_handle_irq() is registered as the interrupt handler, which resets the 
rollover flag and manages the counter's high_bits variable.

Resulting from this call to ps_irq_register(), gpt->irq_id = 27 (0x1b), 
although I'm not sure of the significance of this irq_id value.

Our test app starts GPT1. After ~3 mins, the timer rolls over, as expected. 
Instrumentation in handleInterrupt(irq) is triggered with:
irq = 87 (0x57); // as expected, the GPT1 rollover interrupt

However, gpt_handle_irq() is never called, despite being associated with irq 87 
back in the ps_irq_register() call.

Instrumentation in handleInterrupt() shows that the IRQSignal case is executed 
and sendSignal() is called. Within sendSignal, the NtfnState_Idle case is 
executed, calling ntfn_set_active(ntfnPtr, badge), with badge = 1. I stop 
tracking the flow there, but pick up again that ackInterrupt() is visited with 
irq = 87 (0x57).

Everything looks in order (the right interrupt is generated at the right time 
and is detected) except gpt_handle_irq() is not called. The timer app keeps 
ticking away, but without the rollover management, time ends up skipping.

Thanks for your help,
Mark.
This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient, you are not authorized 
to read, print, retain, copy, disseminate, distribute, or use this message or 
any part thereof. If you receive this message in error, please notify the 
sender immediately and delete all copies of this message.

_______________________________________________
Devel mailing list -- devel@sel4.systems
To unsubscribe send an email to devel-leave@sel4.systems

Reply via email to