Dave Green wrote:
Artyom Migaev <> migaev@telecard.com.ua> > wrote:
Hi!
I have ARM920T CPU (Atmel’s AT91RM9200) and I can’t understand how to use
internal vectored interrupt controller in my processor. AFAIK QNX use only
Interrupt exception to dispatch interrupts in ARM, but there’s other
archetictures (x86, MIPS) where present interrupt controller and QNX uses
that hardware.
Maybe I need to fill intrinfo structure in startup with some kind of
information, as described in ‘Building Embedded Systems’ guide, but
there’s no info about interrupt controllers with ARM, just “… all ARM
interrupts are handled via the IRQ exception”.
Any thoughts?
Hi Artyom,
It’s a fairly indepth topic, but basically, you will need to write
interrupt callouts for the interrupt controller on the Atmel processor,
and describe the callouts in the init_intrinfo.c routine of your board’s
startup code. ARM interrupt controllers are dealt with in the same way
as on other CPUs that QNX supports; the note in the ‘Building Embedded
Systems’ docs that you mention, which refers to ARM interrupts being
handled via the IRQ exception, really means, “…handled via the IRQ
exception, as opposed to the FIQ exception, which we don’t deal with.”
So, basically, you need to configure the Atmel interrupt controller
to route all interrupts to its IRQ output, not its FIQ output.
It’s a good idea to examine interrupt callouts and the associated
init_intrinfo() routines for other ARM CPUs, which can be found in
the startup library code, and the board level startup directories,
respectively.
David Green (> dgreen@qnx.com> )
QNX Software Systems Ltd.
http://www.qnx.com
Hello David,
before opening this post, I’ve examined the code at BSP6.2.1, but there is
no vectored interrupt controller example. I mean, when the IRQ exception
occures, QNX cathces it, and performes some tasks (interrupt
identification, dispatching, context switch, etc). But can I force QNX to
“interrupt” without IRQ exception, using intrinfo structure, or other
methods? I mean in QNX by default we have (hypothetically):
ARM IRQ exception vector @ 0x00000018
ldr pc, [pc,#QNX_INTERRUPT_DISPATCHER]
and I want to make it by this way:
ARM IRQ exception vector @ 0x00000018
ldr pc, [pc,#SOME_REGISTER_WITH_VECTOR]
so the value “SOME_REGISTER_WITH_VECTOR” generated by hardware. To ensure
that interrupts that I use in OS are correctly serviced I’ll program
corresponding vectors to “QNX_INTERRUPT_DISPATCHER” in init_intrinfo()
function.
Maybe you’re a little bit confused - “is there a real need to process some
interrupts outside the OS?” Yes, there is. Of course, if it’s not
impossible to handle IRQ’s in such way - I’ll do it thru OS, but it will
take more time.
And another question - how QNX handles other ARM exceptions (undefined
instruction, data abort, address abort), if they occure? I found only this
code in startup library (init_cpuinfo.c) to setup’em:
/*
- Set up the trap entry point to be “ldr pc, [pc, #0x18]”
- These jump slot addresses are all zero, so until these have
- been properly set up, any exception will result in a loop.
*/
for (i = 0; i < 8; i++) {
*((unsigned *)pa + i) = 0xe59ff018;
}
Thank you very much for your help.