linux - How can I get the corresponding MSI message in an interrupt? -
we using fpga on pcie card. able reserve proper resources , msi interrupt fires correctly. problem discerning interrupt sources from: linux driver receives single msi interrupt different interrupt sources fpga. therefore fpga guys sending reason coded in msi message on bus.
questions:
- is there possibility access message in order information out of frame in isr? (i know check fpga's interrupt status register, using msi message more elegant , avoid additional bus access.)
- if 1 not possible, switching msi-x solve problem, information directly? (i know msi-x preferred solution, fpga guys specified msi)
thank help!
hopefully have got answer need now, attempt contribute based on understanding of msi in the windows driver, since pcie 2.2 standard behavior , should not different. writing windows pcie driver handle msi interrupts originating ti dm8168 configured pcie endpoint.
when fpga device signals regular (non msi-x) msi interrupt, not send 'message' in sense data structure must filled , transmitted somewhere. msi achieved having fpga write data word value 1 specific memory location shared on pcie between host , device. particular memory location , data value must written selected host's bus manager, can't arbitrary value.
a pointer msi memory location , specific, pre-defined data value use set bus manager in pcie config space, device , host can both see them. msi memory location physical bus address, must translated virtual address space both on device , host.
the maximum number of messages regular (non msi-x) msi can support must integral power of 2 maximum of 32 (i.e. 1, 2, 4, 8, 16, 32). example if fpga supports 8 messages, copy data value (from pcie config space) , set lowest 3 bits indicate messageid number (0-7), , write new value msi pointer location. if fpga supports 16 messages, must modify lower 4 bits of data value indicate messageid number (0-15). higher bits of data value must not changed.
on receiving end in isr, check same lowest bits see msi signaled. there no other data or ack associated msi itself; further data implementation-specific , must read memory locations or registers agreed between , hardware team. in windows wdf framework drivers, messageid value masked , provided parameter evtinterruptisr callback function. i'm sure different in linux.
i'm bit late on response, might useful in future else crossing topic did in last few weeks.
Comments
Post a Comment