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 irq definition

Other Parts Discussed in Thread: DA8XX, AM3358

HI,

i AM USING AM335X PROCESSOR AND TRY TO CONFIGURE GPIO AS IRQ FOR WLAN. BUT IT IS NOT SHOWING UNDER CAT /PROC/INTERRUPTS. 

HOW TO CALCULATE THE IRQ NUMBER

I HAVE DEFINED IN MY BOARD FILE (board-am335xevm.c) AS BELOW  

#define AM335XEVM_WLAN_IRQ_GPIO GPIO_TO_PIN(3, 19)

.irq = OMAP_GPIO_IRQ(AM335XEVM_WLAN_IRQ_GPIO)

BUT IT IS NOT SHOWING THE IRQ NUMBER. HOW TO ASSIGN THE NUMBER DIRECT

.irq=xxxx140???????

THANKS,

LOFNA

  • Hi,

    I will ask the SW team to look at this.

  • Hi Lofna,

    Which SDK version (kernel versio respectively) do you use?

    In your board file, have you configured the pinmux (?), so that the corresponding GPIO pin (gpio3_19) is muxed on the device pad? Set the conf_mcasp_fsr[2:0]conf_mcasp_fsr_mmode = 0x7 : gpio3_19 is muxed on pad mcasp_fsr, see Table 4-1. Ball Characteristics (ZCE and ZCZ Packages) in AM335x Data Manual. CTRL Module register offset is 994h, see table Table 9-7. CONTROL_MODULE REGISTERS in AM335x TRM.
    You should also configure the inputenable option on the device pad; set the RXACTIVE bit in the corresponding pad control register (conf_mcasp_fsr[5]conf_mcasp_fsr_rxactive = 0x1).

    Hope this helps.

    Best Regards,
    Yordan
  • Hi Yordan,

    I am using Linux 3.2 version and took from SDK5 & 6

    I have configured gpio3_19 mux setup as: {"mcasp0_fsr.gpio3_19", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},

    we are using ZCZ package.

    Thanks,
    Lofna
  • Hi,

    lofna kumari said:

    I am using Linux 3.2 version and took from SDK5 & 6

    Having in mind that you customize the kernel (using sources from two sdk versions), can you verify that this gpio pin is NOT used by other part of your system (that may be overriding your settings)?


    Best Regards,

    Yordan

  • What's the result of running "devmem2 0x44e10994" after the board is booted? Also what is the result of "cat /proc/interrupts"?
  • Hi,

    Please find the status:

    root@am335x-evm:/home# devmem2 0x44e10994

    /dev/mem opened.
    Memory mapped at address 0x40163000.
    Read at address 0x44E10994 (0x40163994): 0x00000027

    root@am335x-evm:/home# cat /proc/interrupts 

    CPU0
    4: 0 INTC omap2_elm
    12: 4770 INTC edma
    14: 0 INTC edma_error
    16: 1 INTC tsc
    18: 56 INTC musb-hdrc.0
    19: 138 INTC musb-hdrc.1
    29: 13 INTC mmc1
    36: 65088 INTC da8xx_lcdc
    40: 0 INTC cpsw.0
    43: 0 INTC cpsw.0
    64: 14553 INTC mmc0
    68: 7207 INTC gp timer
    70: 197 INTC omap_i2c
    71: 0 INTC omap_i2c
    72: 2385 INTC OMAP UART0
    75: 0 INTC rtc0
    76: 0 INTC rtc0
    77: 0 INTC wkup_m3
    78: 1 INTC wkup_m3_txev
    93: 0 INTC cpsw.0
    94: 0 INTC cpsw.0
    166: 0 GPIO mmc0
    Err: 0

    Please let us know if there is any issue.

    Thanks,

    Lofna

  • Hi Lofna,

    root@am335x-evm:/home# cat /proc/interrupts  shows that you've correctly muxed the gpio pin on AM335x pads.

    Here is what I would check:

    -  Check that the corresponding interrupt line is properly initilized (enabled on global level)? As described in Section 6.2.1 Initialization Sequence of device TRM.

    You should set IRQ priority via the corresponding INTC_ILRm register  

    and enable the interrupt line through INTC_MIRn & INTC_MIR_SETn registers.  

    - Also check if interrupts/wakeups are enabled on GPIO level:

    GPIO_IRQSTATUS_SET_0/1 registers

    GPIO_IRQWAKEN_0/1 registers

    See if the GPIO_LEVELDETECT0/1, GPIO_RISINGDETECT & GPIO_FALLINGDETECT register values meet the requirements of your use case.

    Hope this helps.


    Best Regards,
    Yordan

  • Can you run "lsmod" to see what modules are running?  Running SDK 6.00 on the EVM I see the following:

    root@am335x-evm:~# cat /proc/interrupts
               CPU0
      4:          0      INTC  omap2_elm
     12:       3586      INTC  edma
     14:          0      INTC  edma_error
     16:          0      INTC  tsc, tiadc
     17:          0      INTC  cppi41_dma
     18:          0      INTC  musb-hdrc.0
     19:          1      INTC  musb-hdrc.1
     29:       1260      INTC  mmc1
     36:       2681      INTC  da8xx_lcdc
     37:          2      INTC  SGX ISR
     40:          0      INTC  cpsw
     43:          0      INTC  cpsw
     64:       8882      INTC  mmc0
     68:       2307      INTC  gp timer
     70:        230      INTC  omap_i2c
     71:         58      INTC  omap_i2c
     72:        223      INTC  OMAP UART0
     75:          0      INTC  rtc0
     76:          0      INTC  rtc0
     77:          0      INTC  wkup_m3
     78:          1      INTC  wkup_m3_txev
     93:          0      INTC  cpsw
     94:          0      INTC  cpsw
    109:        349      INTC  omap4-sham
    162:          0      GPIO  volume-up
    163:          0      GPIO  volume-down
    166:          0      GPIO  mmc0
    217:          0      GPIO  matrix-keypad
    218:          0      GPIO  matrix-keypad
    219:          0      GPIO  matrix-keypad
    273:          1      GPIO  wl12xx
    Err:          0

    root@am335x-evm:~# lsmod
    Module                  Size  Used by
    g_mass_storage         37599  0
    bufferclass_ti          5060  0
    omaplfb                11075  0
    pvrsrvkm              170641  2 omaplfb,bufferclass_ti
    wl12xx_sdio             3986  0
    wl12xx                202633  0
    mac80211              289010  1 wl12xx
    cfg80211              189234  2 mac80211,wl12xx

  • Hi Yordan,

    Please find the below reponses:

    root@am335x-evm:~# cat /proc/interrupts
    CPU0
    4: 0 INTC omap2_elm
    12: 1563 INTC edma
    14: 0 INTC edma_error
    16: 1 INTC tsc
    18: 0 INTC musb-hdrc.0
    19: 138 INTC musb-hdrc.1
    29: 13 INTC mmc1
    36: 7054 INTC da8xx_lcdc
    40: 0 INTC cpsw.0
    43: 0 INTC cpsw.0
    64: 5012 INTC mmc0
    68: 2727 INTC gp timer
    70: 197 INTC omap_i2c
    71: 0 INTC omap_i2c
    72: 294 INTC OMAP UART0
    75: 0 INTC rtc0
    76: 0 INTC rtc0
    77: 0 INTC wkup_m3
    78: 1 INTC wkup_m3_txev
    93: 0 INTC cpsw.0
    94: 0 INTC cpsw.0
    166: 0 GPIO mmc0
    Err: 0
    root@am335x-evm:~# lsmod
    Module Size Used by
    wl12xx_sdio 3898 0

    Thanks,
  • You're missing a bunch of modules. Did you manually insert wl12_sdio or did it show up by itself?

  • Hello,

    I've done a similar thing using AM3358 and I was able to get an interrupt from a GPIO. I think that in order for the interrupt to show under /proc/interrupts you should call the function:

    int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *dev_name, void *dev_id);

    where

    const char *dev_name - The string passed to request_irq is used in /proc/interrupts to show the owner of the interrupt.

  • The wl12xx module will inherently request a gpio.  I think he either needs to run "depmod -a" to properly setup all his modules so that they automatically are installed on boot, or else he needs to manually call "modprobe wl12xx".

  • Hi,

    After booting done calibrator script it has inserted all the modules, please check.

    root@am335x-evm:~# lsmod

    Module Size Used by
    uvcvideo 56763 0
    g_mass_storage 37599 0
    wl12xx 201275 0
    wl12xx_sdio 3898 0
    mac80211 276214 1 wl12xx
    cfg80211 176782 2 mac80211,wl12xx

    But i did't get the wlan0 interface in our board. also i am not seeing any wl12 interrupts

    Thanks,

  • Have you tried getting an interrupt from another pin from THE SAME GPIO port? (though your board may not allow such an experiment)