This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x: Questions about GPIO interrupt and McSPI

Other Parts Discussed in Thread: WL1835

Hello,


I have some Questions about Interrupt´s on GPIO and serial Interfaces like SPI on AM335x:

1. I have see, I can configure every GPIO to an interrupt pin. I suppose that I must configure in uboot the GPIO. But how can I associate an interrupt softwareroutine to this GPIO interrupt on a linux system?

For example. I have a C service routine like void gpio_interrupt(void*args); and when an interrupt is triggert it should jump to this routine. Is it possible that this routine must be a function in linux kernel modul?

2. I have see that I can configure SPI to many MODES like Master/Slave or High/Low active states. I should configure this in uboot. But it is possible to change that MODEs after running linux?

Best Regards

  • Hi,

    I will forward this to the software team.
  • Regarding the GPIO part of your question, see the following guides:

     

        -> GPIOs mapped to IRQs

     

     

     

    The configuration of gpio as an IRQ is done in the device tree, for example:

      &mmc3 {

          /* these are on the crossbar and are outlined in the

          xbar-event-map element */

          dmas = <&edma 12

          &edma 13>;

          dma-names = "tx", "rx";

          status = "okay";

          vmmc-supply = <&wlan_en_reg>;

          bus-width = <4>;

          pinctrl-names = "default";

          pinctrl-0 = <&mmc3_pins &wlan_pins>;

          ti,non-removable;

          ti,needs-special-hs-handling;

          cap-power-off-card;

          keep-power-in-suspend;

          #address-cells = <1>;

          #size-cells = <0>;

          wlcore: wlcore@2 {

                 compatible = "ti,wl1835";

                 reg = <2>;

                 interrupt-parent = <&gpio3>;

                 interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;

                 ref-clock-frequency = <38400000>;

           };

    };

    Here wlcore interrupts are connected to gpio3 controller. 

    As for SPI configuration, you can refer to Documentation/devicetree/bindings/spi/omap-spi.txt

    Best Regards, 
    Yordan