A13 External interrupts

Started by bianchina3, November 06, 2012, 10:20:12 PM

Previous topic - Next topic

bianchina3

Does anyone have idea how the external interrupts can be used in this processor ?

Regards.

vinifr

#1
Generally uses up interruption in drivers. I guess you can not use them outside(drivers).
"Interrupt handlers (ISRs) execute in interrupt context."

So you must to write a device driver and insert a interrupt handler(isr).

A good book about this is Essential Linux Device Drivers or Linux Device Drivers;)

bianchina3

My question is not how to write a linux device driver.

My questions are
1) what gpio pin can i use to connect my interrupt pulse ?
2) how to write fex file to use gpio pin as interrupt ?


David Goadby

I'm interested in the solution to this too.

The A13 data sheet seems to indicate that external interrupts EINT0..EINT16 are mapped to I/O pins PG0..PG12, PE0, PE1 and PB2. Even knowing the I/O pins and updating the fex file will not enable the interrupts. What is missing is how we access the interrupt controller to enable them and where the vectors are located.

I think that viniciusfre is correct about writing a driver to handle the interrupts once external interrupts are enabled. Armed (no pun intended) with the information about the Interrupt Controller this is quite easy to do. right now I don't see a way forward.

The problem is the A13 manufacturer does not give us all of the information we need. There are references to the use of interrupts on the A13 on at least two other forums.

I a currently trawling the source code on git-hub to see if there are any clues there.

David Goadby

#4
Here is some very low level information about interrupts: 

https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.0/arch/arm/mach-sun4i/include/mach/platform.h
https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.0/arch/arm/mach-sun4i/include/mach/irqs.h

Now, all we need to do is determine what bits do what and we can write our own interrupt handler..... ;-)

Update: I meant to say device driver. I have written fairly simple drivers for SUSE Linux but on a standard 808X box where we have the information. I'm still delving in the source code for clues.

vinifr

#5
if I'm wrong someone correct me.

Like i said, is not possible to use interrupts outside drivers. The reason is because the operating system does not allow access hardware resources outside drivers! :o Therefore it is necessary to write a driver.

In interrupt context you can to access hardware resources.
"Interrupt handlers (ISRs) execute in interrupt context."
"ISRs are critical pieces of code that directly converse with the hardware. They are given the privilege of instant
execution in the larger interest of system performance."


Example: http://dl.dropbox.com/u/22273442/interrupt.c

meerd

Is there any progress about this subject? Was anyone able to find any information about external interrupt handling via GPIOs?

lorenzo

Hi,

in this thread https://www.olimex.com/forum/index.php?topic=462.0 you can find useful information about how to set an external GPIO as interrupt source. Any of the EINT pin can work as external interrupt source.

Best regards.
Lorenzo

bianchina3


vinifr

#9
Hi, I was wrong, look here: http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=linux&db=bks&srch=&fname=/SGI_Developer/REACTLINUX_PG/sgi_html/ch08.html  ;)

As lorenzo said, yo can to use any EINT, here have a list with all the pins available: http://linux-sunxi.org/A13/PIO