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.

Interrupt from PRU1 to ARM linux kernel module

Part Number: AM3358

I have a problem sending an interrupt from PRU to linux kernel module
on a am335. I tried on beaglebone with TI debian and bullseye images.
Any help would be appreciated as i'm stuck...

Context: A fairly common and simple scenario of writing a double buffer
to PRU memory from kernel module and read it with PRU1. PRU sends an
interrupt when it starts reading a buffer.

What i have done:
- I use IEP for timing purposes in PRU. Interrupt mapping and catching works.
- Instead mapping to host 6/7 to interrupt arm i temporarily mapped to
host 0/1 to check correctness. I can catch it with the other PRU.
- I can write PRU memory from user space and kernel module (both
verified with scope on io pins written with pru)
- irq_request in kernel module returns 0. Kernel module shows up in
/proc/interrupts

Literally everthing works except the interrupt signal from PRU to ARM.

The commented sections where tryouts. The unspecific FFFF settings are
also tryouts. I also tried only setting specific bits.
I also tried other events/channels/interrupts...

ko

result = request_irq(24,
  pru_output0_irq_handler,
  IRQF_TRIGGER_RISING,
  "testirq",
  NULL);

result = request_irq(25,
  pru_output1_irq_handler,
  IRQF_TRIGGER_RISING,
  "testirq",
  NULL);


pru1

CT_INTC.SIPR0 = 0xFFFFFFFF;
CT_INTC.SIPR1 = 0xFFFFFFFF;

CT_INTC.SITR0 = 0;
CT_INTC.SITR1 = 0;

CT_INTC.SECR0 = 0xFFFFFFFF;
CT_INTC.SECR1 = 0xFFFFFFFF;
CT_INTC.ESR0 = 0xFFFFFFFF;
CT_INTC.ESR1 = 0xFFFFFFFF;

CT_INTC.CMR1_bit.CH_MAP_7 = 1;
CT_INTC.CMR4_bit.CH_MAP_16 = 6;
CT_INTC.CMR4_bit.CH_MAP_17 = 7;
    
CT_INTC.HMR0_bit.HINT_MAP_1 = 1;
CT_INTC.HMR1_bit.HINT_MAP_6 = 6;
CT_INTC.HMR1_bit.HINT_MAP_7 = 7;

//CT_INTC.SICR = 16;
//CT_INTC.SICR = 17;

//CT_INTC.EISR = 16;
//CT_INTC.EISR = 17;

//CT_INTC.HIEISR = 0;
CT_INTC.HIEISR = 1;
CT_INTC.HIEISR = 6;
CT_INTC.HIEISR = 7;
    
CT_INTC.HIER = 0xFFFFFFFF;


//CT_INTC.ECR0 = 0xFFFFFFFF;
//CT_INTC.ECR1 = 0xFFFFFFFF;

//CT_INTC.ESR0 = 0xFFFFFFFF;
//CT_INTC.ESR1 = 0xFFFFFFFF;

//CT_INTC.GER_bit.EN_HINT_ANY = 0x1;
CT_INTC.GER = 1;

while(1)
{
  CT_INTC.SECR0 = (1 << 16);
  __R31 = 0b100000;
  WRITE_OUTPUT(output0);

  CT_INTC.SECR0 = (1 << 17);
  __R31 = 0b100001;
  WRITE_OUTPUT(output1);
}

Thanks