I am using evmAM5728 board and SDK 03.00.00.04.
First, there seem to be two issues with IRQHandler in CSL.
To acknowledge the interrupt, interrupt ID must be written to EOIR and this is what IRQHandler is trying to do by
LDMFD r13!, {r2} @ Get active IRO from stack
LDR r1, =addrEoi @ Load global variable addrEoi address into r1
LDR r2, [r1] @ Acknowledge the current IRQ
STR r3, [r2]
But third and fourth instructions are wrong, they should be
LDR r3, [r1] @ Acknowledge the current IRQ
STR r2, [r3]
Another problem is that number of pushed registers on IRQ stack is odd. First it pushes
STMFD r13!, {r0-r3, r12, r14} @ Save context in IRQ stack
and later
STMFD r13!, {r2} @ Save active IRO in stack
It is against AAPCS, which demands stack pointer to be 8-bytes aligned.
I've fixed these bugs locally. Now, the issue I have a real problem with.
I am trying to map RTC interrupt to GIC. For most IRQ numbers it works fine, but for some of them IRQ never fires, although IRQ is reported pending.
I was trying IRQ numbers 4-159. Here is the list of IRQs, which don't work (IRQ never fires). Some of them are reported pending, some are not.
5, 6, 10 - not pending
16-19 - pending
32-35 - pending
48-51 - pending
64-67 - pending
80-83 - pending
131-133 - not pending
139-142 - not pending
Per MPU_INTC Default Interrupt Mapping (spruhz6g.pdf):
IRQs 5 and 6 are N/A.
IRQ 10 is "not functional", whatever it means.
IRQs 131 and 132 are N/A.
IRQ 133 is available, but has some special considerations.
IRQs 139 and 140 are N/A.
Other IRQs (16-19, 32-35, 48-51, 64-67, 80-83, 141, 142) seem to be normal IRQs, but they don't work for me. For IRQs 141 and 142 pending flag is not set, so problem occurs between crossbar and GIC. For all other IRQs interrupt reaches GIC (pending flag on), but, apparently, is not delivered to CPU interface, I don't know why.
I am attaching the test code, which tries all IRQs from 4 to 159 and outputs the results of checkup. Also I am attaching my output log.
I am not using csl_init library in my project and do my own initialization, which is present in main.c. But I am using CSL's init.asm and exceptionhandler.asm (with my bugfixes).
What do I do improperly with these IRQs?
