I have a FPGA. You can see the following information:
0002:01:00.0 Memory controller: Xilinx Corporation Device 7022
Subsystem: Xilinx Corporation Device 0007
Flags: bus master, fast devsel, latency 0, IRQ 17
Memory at c80000000 (64-bit, prefetchable) [size=1G]
Memory at ce0000000 (64-bit, prefetchable) [size=64K]
Capabilities: [40] Power Management version 3
Capabilities: [48] MSI: Enable- Count=1/4 Maskable- 64bit+
Capabilities: [60] Express Endpoint, MSI 00
Capabilities: [100] Device Serial Number 00-00-00-00-00-00-00-00
As you can see, it has MSI properties. I am building a driver in order to activate MSI interrupt. In kernel 3.12.37 I do the following:
PCIret = pci_enable_msi_block(pcidev,64);
printk(KERN_ALERT "pci_enable_block=%i\n",PCIret);// the result is PCIret =4.
PCIret = request_irq(pcidev->irq, InterrupcionFPGA_Virtex1, 0, "FPGA_0", pcidev);
if (PCIret==0)
{
printk(KERN_ALERT "everything right\n");
}
else
{
printk(KERN_ALERT "error: %i\n",PCIret);
}
PCIret = request_irq(pcidev->irq+1, InterrupcionFPGA_Virtex2, 0, "FPGA_1", pcidev);
if (PCIret==0)
{
printk(KERN_ALERT "everything right\n");
}
else
{
printk(KERN_ALERT "error: %i\n",PCIret);
}
But is not working. I do not have 2 MSI interrupt. I am only able to get one MSI interrupt with:
PCIret = pci_enable_msi(pcidev);
Should I type anything in my dtb? Are there any error in my driver?
BR