cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bent93
Participant
Participant
497 Views
Registered: ‎10-17-2018

Interrupts from Zedboard fabric to linux not working

Jump to solution

Hi,
I want to have my logic fabric interrupt my kernel module.

What I did:

  • Generate a peripheral with 4x32bit registers
  • Add a std_logic out port "Interrupt" to that peripheral
  • Configure that port to be an Interrupt modifying the .mpd file:
    PORT Interrupt = "", DIR = O, SIGIS = INTERRUPT, SENSITIVITY = LEVEL_HIGH, INTERRUPT_PRIORITY = MEDIUM, ISVALID = (C_INTERRUPT_PRESENT == 1)
  • Drive a constant '0' on that Port
  • Connect that Port to IRQ_F2P, it shows up as Interrupt 87
  • Write a simple interrupt handler:
    static irqreturn_t irq_handler(int irq, void* dev_id)
    {
    	printk("Interrupt!\n");
    	return IRQ_HANDLED;
    }
  • Write a driver that registers a handler for Interrupt 87 using:
    request_irq(87,irq_handler,IRQF_DISABLED, DRIVER_NAME, NULL)
  • Add the device to the devicetree:
                    mycore {
                            compatible = "soclab,mycore-1.00.a";
                            reg = <0x7e410000 0x1000>;
                            interrupts = <0x0 0x37 0x04>;
                            interrupt-parent = <&gic>;
                    };
    (0x37 = 55, add 32 and you get 87. I read that I have to do this)
  • Insmod my driver

Unfortunately, the interrupt routine is called at about 400Hz, although the Interrupt Signal carries a constant '0'. I tried with a constant '1', just for the sake of trying, with no success.

I also tried to set it to EDGE_RISING both in the .mpd and the devicetree (setting the last number in the 4th line from 0x04 to 0x01), but to no avail.

What am I doing wrong?

0 Kudos
1 Solution

Accepted Solutions
bent93
Participant
Participant
481 Views
Registered: ‎10-17-2018

I found out XPS at some point decided to change the path of the output bitstream. The .bif file I used to generate the BOOT.BIN used the old file, therefore I did not see any changes.

I updated the paths and am now receiving the desired Interrupts, and only the desired Interrupts!

So the method described in the original post actually worked!

View solution in original post

0 Kudos
1 Reply
bent93
Participant
Participant
482 Views
Registered: ‎10-17-2018

I found out XPS at some point decided to change the path of the output bitstream. The .bif file I used to generate the BOOT.BIN used the old file, therefore I did not see any changes.

I updated the paths and am now receiving the desired Interrupts, and only the desired Interrupts!

So the method described in the original post actually worked!

View solution in original post

0 Kudos