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.

TDA4VM: How to get a irqNum for GPIO0_118 on MCU2_0

Part Number: TDA4VM

Hi all, Now I have a questions.

I want to set GPIO0_118 as a interrupt input pin on mcu2_0, The pinmux has been finished. But when set the interrupt func, it returns -1;

I trace the code, and find that in function "GPIO_socConfigIntrPath()" which located in "pdk/packages/ti/drv/gpio/soc/j721e/GPIO_soc.c", something is wrong.

through the GPIO_socGetIrqRange(ir_id, dst_id, &irq_range_start, &irq_range_num); the irq_range_num = 4;

and my gpiopin is gpio0_118, means the banknum=7,so it return error;

the code is as below 

int32_t GPIO_socConfigIntrPath(uint32_t portNum, uint32_t pinNum,void *hwAttrs,bool setIntrPath)
{

    GPIO_v0_HwAttrs   *cfg = (GPIO_v0_HwAttrs *)hwAttrs;
    GPIO_IntCfg       *intCfg;
    
    ...
  
    if(CSL_PASS == retVal)
    {
        /* Get the valid range of valid interrupts based on the ir_id. */
        retVal = GPIO_socGetIrqRange(ir_id, dst_id, &irq_range_start, &irq_range_num);
        
    }
 
    ...
    if(CSL_PASS == retVal) 
    {
        if(bankNum <= irq_range_num)
        {
            dst_host_irq = irq_range_start + bankNum;
        #if defined (BUILD_C7X)
            intCfg[pinNum].eventId  = dst_host_irq; /* CLEC i/p Event Idx - Use Range from BoardCfg */ 
            intCfg[pinNum].intNum  += bankNum;      /* CLEC o/p to C7x core  */
        #elif defined (BUILD_C66X)
            /* On C66x, we use Event Combiner to map the interrupt to the CPU Intc.  To
            * do this, OSAL expects that event number holds the interrupt number and we
            * use the macro for interrupt number to specify we wish to use Event
            * Combiner.
            */
            intCfg[pinNum].eventId  = dst_host_irq; /* The interrupt number is initialized with the required Offset */ 
            intCfg[pinNum].intNum   = OSAL_REGINT_INTVEC_EVENT_COMBINER;      /* OSAL expects the Combiner macro at the interrupt number  */
        #else
            intCfg[pinNum].intNum   = dst_host_irq; /* Core Interrupt Idx - Use Range from BoardCfg */ 
        #endif
        }
        else
        {
            retVal = CSL_EFAIL;
        }
    }

   ...


  return(retVal);
}

I want to know:

1. where define the irq_range_num to be 4; and why?

2. How can I get a irq_num for GPIO0_118, and How can I config the Interrupt router?