Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Linux version: v4.19
Platform: Xilinx Ultrascale+ Zynq

In the Xilinx programmable logic I've created a memory mapped device. I'm using uio_pdrv_genirq as my device driver. The device shows up as uio0 and I'm able to read and write to it without any issues.

Up until now I have not had an interrupt associated with this device. As my design matures, I'm wanting to add an interrupt to the device. So I've created the appropriate logic, connected the interrupt to the CPU, and updated the device tree configuration to tell Linux about the interrupt's existence. I've checked thoroughly and I'm quite certain that I am specifying the correct interrupt ID in the device tree.

However as soon as I specify the interrupt, I start having problems. My user space program hangs when I try to open the device. I've verified with printf():s that I'm no longer exiting this function.

fid = open("/dev/uio0", O_RDWR | O_SYNC);

Clearly this has something to do with the interrupt. Perhaps there is some additional device tree configuration of the interrupt controller that I'm missing? Or something I have to do in user space before opening the device?

Here is the device tree configuration for my device and the interrupt controller:

my_device@a0040000 {
    compatible = "generic-uio";
    reg = <0x0 0xa0040000 0x0 0x40000>;
    interrupt-parent = <&gic>;
    interrupts = <0 89 4>;
};

gic: interrupt-controller@f9010000 {
    compatible = "arm,gic-400", "arm,cortex-a15-gic";
    #interrupt-cells = <3>;
    reg = <0x0 0xf9010000 0x10000>,
          <0x0 0xf9020000 0x20000>,
          <0x0 0xf9040000 0x20000>,
          <0x0 0xf9060000 0x20000>;
    interrupt-controller;
    interrupt-parent = <&gic>;
    interrupts = <1 9 0xf04>;
};
question from:https://stackoverflow.com/questions/65946379/uio-device-no-longer-opens-when-an-interrupt-is-added

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
384 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...