2014/09/23

PCI MSI Setup

The Root Complex(RC) controller receives the MSI messages send from PCI device, then RC raise an interrupt to CPU.

During the startup, software tells PCI device the address to where MSI message should be written. The address is mapped to RC controller IO space.

An example implementation:
http://lxr.free-electrons.com/source/arch/arm/mach-iop13xx/msi.c

The call stack:
__write_msi_msg
write_msi_msg
arch_setup_msi_irq

in arch_setup_msi_irq(), the address (to where MSI message is written) is defined as below.
  msg.address_hi = 0x0;
  msg.address_lo = IOP13XX_MU_MIMR_PCI;

in __write_msi_msg(), the address is actually written to device configuration register (message address register).
http://lxr.free-electrons.com/source/drivers/pci/msi.c#L327

No comments:

Post a Comment

Post Code on Blogger

Simplest way to post code to blogger for me: <pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black;overflow-x:...