Skip to content

Commit 55089b1

Browse files
committed
xdma: use MSI decode mode
1 parent 52a67a6 commit 55089b1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/scala/ip/xilinx/xdma/xdma.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ trait HasXDMABus {
4444

4545
// I
4646
val interrupt_out = Output(Bool())
47+
val interrupt_out_msi_vec0to31 = Output(Bool())
48+
val interrupt_out_msi_vec32to63 = Output(Bool())
4749

4850
// M.AW
4951
val m_axib_awready = Input(Bool())
@@ -244,6 +246,7 @@ class XDMABlackBox(c: XDMAParams) extends BlackBox
244246
| CONFIG.ref_clk_freq {100_MHz} \\
245247
| CONFIG.pl_link_cap_max_link_width {X${c.lanes}} \\
246248
| CONFIG.pl_link_cap_max_link_speed {${pcieGTs}} \\
249+
| CONFIG.msi_rx_pin_en {true} \\
247250
| CONFIG.axisten_freq {${axiMHzStr}} \\
248251
| CONFIG.axi_addr_width {${c.addrBits}} \\
249252
| CONFIG.axi_data_width {${busBytes*8}_bit} \\
@@ -258,7 +261,7 @@ class DiplomaticXDMA(c: XDMAParams)(implicit p:Parameters) extends LazyModule
258261
{
259262
val (busBytes, _) = XDMABlackBox.busConfig(c)
260263

261-
val device = new SimpleDevice("pci", Seq("xlnx,axi-pcie-host-1.00.a")) {
264+
val device = new SimpleDevice("pci", Seq("xlnx,xdma-host-3.00")) {
262265
override def describe(resources: ResourceBindings): Description = {
263266
val Description(name, mapping) = super.describe(resources)
264267
val intc = "pcie_intc"
@@ -269,6 +272,7 @@ class DiplomaticXDMA(c: XDMAParams)(implicit p:Parameters) extends LazyModule
269272
"#size-cells" -> ofInt(2),
270273
"#interrupt-cells" -> ofInt(1),
271274
"device_type" -> Seq(ResourceString("pci")),
275+
"interrupt-names" -> Seq("misc", "msi0", "msi1").map(ResourceString.apply _),
272276
"interrupt-map-mask" -> Seq(0, 0, 0, 7).flatMap(ofInt),
273277
"interrupt-map" -> Seq(1, 2, 3, 4).flatMap(ofMap),
274278
"ranges" -> resources("ranges").map(x =>
@@ -306,7 +310,7 @@ class DiplomaticXDMA(c: XDMAParams)(implicit p:Parameters) extends LazyModule
306310
id = IdRange(0, 1 << c.mIDBits),
307311
aligned = false)))))
308312

309-
val intnode = IntSourceNode(IntSourcePortSimple(resources = device.int))
313+
val intnode = IntSourceNode(IntSourcePortSimple(num = 3, resources = device.int))
310314

311315
lazy val module = new LazyRawModuleImp(this) {
312316
// The master on the control port must be AXI-lite
@@ -343,6 +347,8 @@ class DiplomaticXDMA(c: XDMAParams)(implicit p:Parameters) extends LazyModule
343347

344348
// I
345349
i(0) := blackbox.io.interrupt_out
350+
i(1) := blackbox.io.interrupt_out_msi_vec0to31
351+
i(2) := blackbox.io.interrupt_out_msi_vec32to63
346352

347353
// M.AW
348354
blackbox.io.m_axib_awready := m.aw.ready

0 commit comments

Comments
 (0)