A20-SOM-EVB mainline kernel and external interrupt not raising..

Started by aventuri, May 06, 2015, 04:13:34 PM

Previous topic - Next topic



i'm new here and i write for an issue i get with an A20-SOM + A20-SOM-EVB.

i'd like to test external interrupt working with my setup (running on mainline kernel 4.0 ,so with DTS).

i tried to follow the advice and code in: http://linux-sunxi.org/External_interrupts

they do look like pretty simple and clear to me. anway no raising interrupts. see the details here:

i have my module "eint.ko" compiled and installed, with a proper entry in lsmod:
Quote# lsmod
Module                  Size  Used by    Tainted: G 
eint                    1183  -

in kernel module i added a message when request_irq() is ok!

Quotestatic int __init rebooter_probe(struct platform_device *pdev)

        irq = platform_get_irq_byname (pdev, "restart");
        if (request_irq(irq, &irqHandlerInit, IRQF_TRIGGER_LOW, "rebooter_irq", NULL)) {
                printk(KERN_ERR "rebooter-irq: cannot register IRQ %d\n", irq);
                return -EIO;
        } else 
                printk(KERN_ERR "rebooter-irq: registered IRQ %d\n", irq);
        return 0;

so the dmesg says:
[   74.476204] rebooter-irq: registered IRQ 72

BTW i'm trying to bind with gpio pin PI10 which is EINT22 in A20 user manual, so in DTS i have these two snippets:

Quote// test of EINT22
  rebooter {
     compatible = "prismlx-rebooter";
     pinctrl-names = "default";
     pinctrl-0 = <&init_pins_a20_som_evb>;
     interrupt-parent = <&pio>;
     interrupts = <22 IRQ_TYPE_EDGE_FALLING>;
     //interrupts-extended = <&pio 22  IRQ_TYPE_LEVEL_LOW>; // commented out
     interrupt-names = "restart";
     status = "okay";

Quoteinit_pins_a20_som_evb: init_pins@0 {
           allwinner,pins = "PI10"; // PI10 is EINT22
           allwinner,function = "irq";
           allwinner,drive = <SUN4I_PINCTRL_20_MA>; // was in example <0>;
           allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; // was in example <1>;

i see in /proc/interrupts, the bind of the module too.
# cat /proc/interrupts | grep reboot
72:          0          0         -  22  rebooter_irq
but if i connect the PIN 37 of GPIO-1 of A20-SOM-EVB to GND or VCC, there's no counter raising.. :-)

any hint for where to watch and more test to try?




sorry if i reply to myself; just a further note.

i discovered that the example works if i use a EINT up to EINT21 in PH port (as the one described in the example page..) but it doesn't work on EINT between EINT22 and EINT31 in PI port.

these are A20 only EINT but the linux-sunxi PIO port doesn't describe them.


maybe there's something to be added for their support..



Odd.  EINT22 etc look to be in the PINCTRL things so I suggest you report this on the linux-sunxi ML.  (Maxime hangs out there.)



thanx for the reply.

yes i've started a thread on linux-sunxi ML too.. https://groups.google.com/forum/#!topic/linux-sunxi/lPP1aO9tWvI

we'll see what comes up..




In file script.bin for A20SOM, pins PI10 to PI19 (EINT22 to EINT31) are dedicated for SPI0 and SPI1. Probably this causes inability to use them for other functions.
spi_used = 0
spi_cs_bitmap = 1
spi_cs0 = port:PI10<2><default><default><default>
spi_cs1 = port:PI14<2><default><default><default>
spi_sclk = port:PI11<2><default><default><default>
spi_mosi = port:PI12<2><default><default><default>
spi_miso = port:PI13<2><default><default><default>

spi_used = 1
spi_cs_bitmap = 1
spi_cs0 = port:PI16<2><default><default><default>
spi_sclk = port:PI17<2><default><default><default>
spi_mosi = port:PI18<2><default><default><default>
spi_miso = port:PI19<2><default><default><default>
A Lone Rider