Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
10 years ago

Failed to generate MSI-X Interrupt on Cycleon-V FPGA Board

I am working on X86 PCIe Linux Driver to implement MSI-X Interrupt on Cycleon V FPGA board with reference design taken from Qsys.

I have followed below steps in linux driver to enable MSI-X interrupt.

1) Enabled PCIe Device

2) Executed pci_enable_msix with total number of 4 vectors which is successfully enabled without any fail-case.

3) After that, Disable Legacy Interrupt by setting 0 to 10th bit of PCI_COMMAND Configuration Space Register.

4) Enabled DMA Mask Bit of PCI Cnfiguration (PCI_Command) Register.

5) After that, Request IRQ based on getting vector value of MSIX Entries which allocated successfully without any issue.

6) Than, I have triggered IRQ by writing data into IRQ source which writes some data into TXS Port but not getting interrupt event.

Please find below sample code for more information.

status = pci_enable_msix(dev, msix_entries, nr_entries);
pci_read_config_dword(dev, PCI_COMMAND, &temp);
pci_write_config_dword(dev, PCI_COMMAND, (temp & 0xFFFFFBFF));         /// To Disble Legacy Interrupt (set 0 to 10th bit)
pci_read_config_dword(dev, PCI_COMMAND, &temp);
/* Enable DMA Mask Bit of PCI Cnfiguration (PCI_Command) Register */
if (dma_set_mask(&(dev->dev), DMA_BIT_MASK(32))) 
{
    dev_err(&dev->dev," No suitable DMA available for 32 Bit.\n");
}
else
    printk(KERN_INFO " Set 32 Bit DMA Mask Successfully...\n");
if (dma_set_mask(&(dev->dev), DMA_BIT_MASK(64))) 
{
    dev_err(&dev->dev," No suitable DMA available.\n");
}
else
    printk(KERN_INFO " Set 64 Bit DMA Mask Successfully...\n"); 
    
pci_set_master(dev);
    
dev->irq = msix_entries.vector;
if (request_irq(dev->irq, sls_sdhc_irq, 0, DRV_NAME, (void*)dev)) 
    printk(KERN_ERR "Error allocating interrupt.\n");
else
    printk(KERN_ERR "Interrupt allocated successfully.\n");

So, All above settings are configured successfully without any issue but I am no getting print from interrupt handler. so, it seems that interrupt is not generated yet.

Please let me know if anyone has any solution or any idea for this type of issue.

Regards,

Ritesh Prajapati http://www.alteraforum.com/forum/clear.gif edit post (http://www.alteraforum.com/forum/editpost.php?p=206055&do=editpost) http://www.alteraforum.com/forum/clear.gif reply (http://www.alteraforum.com/forum/newreply.php?do=newreply&p=206055&noquote=1) http://www.alteraforum.com/forum/clear.gif reply with quote (http://www.alteraforum.com/forum/newreply.php?do=newreply&p=206055) http://www.alteraforum.com/forum/images/buttons/multiquote_40b.png (http://www.alteraforum.com/forum/newreply.php?do=newreply&p=206055)

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi All,

    Does anyone has any idea or information to debug this type of issue on Cycleon V FPGA board in Linux Platform?

    Regards,

    Ritesh Prajapati
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi All,

    Does anyone has any idea or information to debug this type of issue on Cycleon V FPGA board in Linux Platform?

    Regards,

    Ritesh Prajapati