How to generate MSI interrupt on i.MX6 in PCIe EP/endpoint mode

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to generate MSI interrupt on i.MX6 in PCIe EP/endpoint mode

4,334件の閲覧回数
matevzlangus
Contributor III

Hi,

 

 

I am sharing the information that should be documented in the RM but was not and it was very annoying to get thru the issues to use i.MX6 in EP mode. We managed to use the chip to support inbound transactions, outbound transactions and MSI generation.

 

 

To generate MSI from i.MX6 in EP mode to the RC you need to do:

1) let the Linux on RC enumerate all PCIe endpoints

2) on RC Linux load the driver for EP that initializes all required interrupt settings for RC and EP

     pci_enable_device(dev);

     pci_set_master(dev);

     pci_enable_msi(dev);

     .... and all the usuall PCI stuff. Attached example of very ugly driver we used to test the MSI.

3) manually modify settings on RC:

     cd /unit_tests/

     ./memtool -32 0x1ffc828=0xFFFFFFFF

     ./memtool -32 0x1ffc82c=0x0

 

  This unmasks all MSI interrupt vectors. It is not nice, but you can check which one should really be unmasked. It looks Linux by default enables wrong vectors.

4) on the EP issue interrupt by writing 1 to the address assigned by RC for the MSI (you can get this address in 0x1FFC054

     ./memtool 0x1ff8000=1

 

 

This generates MSI to RC:

 

5) check interrupt counters on RC

     cat /proc/interrupts | grep MSI

     497:          2          0          0          0  PCIe-MSI

 

Regards,

Matevz

Original Attachment has been moved to: imx6-as-pci-ep.c.zip

ラベル(5)
0 返答(返信)