pci 无空间错误

pci 无空间错误

我有一张 Xilinx FPGA pcie 卡(vcu1525),并对其进行了编程以具有 2 个 BAR,分别定义 64KB 和 4MB 内存空间。

02:00.0 Serial controller: Xilinx Corporation Device 903f (prog-if 01 [16450])
    Subsystem: Xilinx Corporation Device 0007
    Physical Slot: 4
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 32 bytes
    Interrupt: pin A routed to IRQ 26
    Region 0: Memory at ee400000 (32-bit, non-prefetchable) [size=64K]
    Region 1: Memory at ee000000 (32-bit, non-prefetchable) [size=4M]

我还可以在 /proc/iomem 看到内存层次结构。

90000000-f7ffbfff : PCI Bus 0000:00
  ee000000-f20fffff : PCI Bus 0000:02
    ee000000-ee3fffff : 0000:02:00.0
      ee000000-ee3fffff : xdma
    ee400000-ee40ffff : 0000:02:00.0
      ee400000-ee40ffff : xdma

但是当我将第二个 BAR 更改为 1GB 大小时,xdma 驱动程序会抛出错误。这是 dmesg 输出的一部分。

[16608.863027] pci 0000:02:00.0: [10ee:903f] type 00 class 0x070001
[16608.863065] pci 0000:02:00.0: reg 0x10: [mem 0x00000000-0x0000ffff]
[16608.863074] pci 0000:02:00.0: reg 0x14: [mem 0x00000000-0x3fffffff]
[16608.863112] pci 0000:02:00.0: Max Payload Size set to 256 (was 128, max 1024)
[16608.867923] xdma:xdma_mod_init: Xilinx XDMA Reference Driver xdma v2017.1.47
[16608.867930] xdma:xdma_mod_init: desc_blen_max: 0xfffffff/268435455, sgdma_timeout: 10 sec.
[16608.870517] pci 0000:02:00.0: BAR 1: no space for [mem size 0x40000000]
[16608.870524] pci 0000:02:00.0: BAR 1: failed to assign [mem size 0x40000000]
[16608.870529] pci 0000:02:00.0: BAR 0: assigned [mem 0xee000000-0xee00ffff]
[16608.870540] ast 0000:08:00.0: BAR 6: [??? 0x00000000 flags 0x2] has bogus alignment
[16608.870633] serial 0000:02:00.0: enabling device (0100 -> 0102)
[16608.870880] xdma:xdma_device_open: xdma device 0000:02:00.0, 0xffff882031e43000.
[16608.871018] xdma:map_single_bar: BAR0 at 0xee000000 mapped at 0xffffc9000d0a0000, length=65536(/65536)

我的问题是

  1. 我要怎么做才能成功分配 1GB 内存?
  2. 我怎样才能将条形位置 0xee000000 移动到更高的地址?(我观察到 GPU 内存位置具有更高的地址并且其窗口足够大)

我在 BIOS 中启用了上述 4G 解码选项。

如果你能帮助我的话我就很有帮助了。

相关内容