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.

Host-to-CPU Interrupt via HPI to DM365

Could you tell me the interrupt number of Host-to-CPU interrupt (ARMINT) mentioned in document [1], paragraph 2.9.1 ?

I think it could be interrupt number 30 from "Table 54. AINTC Interrupt Connections", document [2]. Could you confirm it ?

[1] sprufi4a - TMS320DM36x Digital Media System-on-Chip (DMSoC) Universal Host Port Interface (HPI)

[2] sprufg5 - TMS320DM36x Digital Media System-on-Chip (DMSoC) ARM Subsystem

  • HiPer,

    I confirm that Interrupt #30 is the HPI interrupt to the CPU.  However you have to ensure that the ARM_INTMUX register bit 11 selects this for HPI since it is multiplexed with AEMIF interrupt.

    A little extra details: The SPRUFI4A (HPI UG) document refers to it as the 'ARMINT' and 'HINT' from its stand point as follows:

    ARMINT-->(HOST to DM365 interrupt generation, in which DM365 interrupt #30 gets set if enabled (after the HOST writes to the ARMINT bit in HPIC register), in which case DM365 needs to know when someone interrupted him)

    HINT  -> (DM365 sends an interrupt to the external host by setting the HINT bit (HPIC register) and toggles HINT pin, in which case the DM365 does not need to acknowledge an interrupt in its interrupt controller mapping)

     

    regards,

    miguel

     

  • HiPer said:

    Could you tell me the interrupt number of Host-to-CPU interrupt (ARMINT) mentioned in document [1], paragraph 2.9.1 ?

    I think it could be interrupt number 30 from "Table 54. AINTC Interrupt Connections", document [2]. Could you confirm it ?

    You are correct, interrupt 30 to the ARM can be configured to be the interrupt event from the HPI. This is selected by bit 11 of the ARM_INTMUX register (shown in table 86 of SPRUFG5), which if set provides the HPI interrupt on that line.

    EDIT: I didn't see Miguel's post until after posting, but we seem to agree on this one :).

  • Thank you Miguel and Bernie,

    with your help I was able to obtain and handle HOST to DM365 interrupt signal.

    For those who are interested in details here is a code snippet:

     /**
     * MODULE hpik
     */

    ...
    #define ARM_INTMUX 0x01C40018
    #define HPIC       0x01C69830
    #define IRQ_HOST2CPUINT 30
    ...

    static irqreturn_t hpi_isr(int irq, void *arg)
    {
     unsigned int hpic = (unsigned int)IO_ADDRESS(HPIC);
      
     printk("Hello from hpi_isr handler!\n");
     
     // acknowledge interrupt
     // set ARMINT=1 to allow generation of subsequent interrupts by Host
     outl(1<<1, hpic);
     
     return IRQ_RETVAL(IRQ_HANDLED);
    }

    int __init hpi_init(void)
    {
     int err = 0;
     int result = 0;
     unsigned int arm_intmux = (unsigned int)IO_ADDRESS(ARM_INTMUX);
     unsigned int hpic       = (unsigned int)IO_ADDRESS(HPIC);
     unsigned int value = 0;
    ...
     // set bit 11 in ARM_INTMUX register to enable HPI interrupts
     value = inl(arm_intmux);
     value |= (1<<11);
     outl(value, arm_intmux);
     
     // set ARMINT=1 to allow generation of subsequent interrupts by Host
     if (inl(hpic) & (1<<1))
      outl(1<<1, hpic);

     // setup interrupt handler
     result = request_irq(IRQ_HOST2CPUINT, hpi_isr, 0, "hpi", NULL);
     if (result != 0) {
      __E("Failed to assign irq %i error %i\n", IRQ_HOST2CPUINT, result);
      err = result;
      goto fail_after_create;
     }
    ...
    }

    Interrupt is generated by simply setting bit ARMINT to 1 in HPIC register from the host side.

  • Could you provide the entire hpik module that you created?  I'm trying something similar and I'm having some issues, and I suspect it's because I have an error in the rest of the module that i created.  Any help would be appreciated.

  • Dear Brian,

    I stripped the module's code of unnecessary implementation specific details. I hope it is much more easy for reading now. You may use this version as a reference.

    1738.hpik.c.tar.gz

    Please do not hesitate to ask module-related questions.

    Also, since HPI communication is a little tricky and I myself have some difficulties with it, I would appreciate if you post your observations in relation to AEMIF or HPI.