简体   繁体   English

Linux驱动程序PCI突发传输

[英]Linux driver PCI Burst transfer

i have a question about read and write using bursts on PCIe. 我有一个关于在PCIe上使用突发读取和写入的问题。 I have a fpga which is connected through PCIe to the cpu. 我有一个通过PCIe连接到CPU的fpga。 I have a simple driver which is just for testing. 我有一个简单的驱动程序,仅用于测试。 The driver writes and reads data to and from the fpga. 驱动程序向fpga读写数据。 The fpga includes an sram core where the datas are written to and read from. fpga包含一个sram核心,数据可在其中写入和读取。 The read and writes are working well, but without bursts if i read from the device. 读取和写入运行良好,但如果我从设备读取,则不会出现突发现象。 If i write data to the fpga, bursts working well if i map the BAR with ioremap_wc(). 如果我将数据写入fpga,并且使用ioremap_wc()映射BAR,则突发工作良好。 But if i read from the fpga, the cpu just make single access without bursts. 但是,如果我从fpga读取,则cpu只会进行单次访问而不会突发。 I found out that i have to mark the memory as write-back to be able to cache the datas on read an write transfers, but if i mark my adress write-back using /proc/mtrr there is no burst on read and write. 我发现我必须将内存标记为写回,以便能够在读和写传输时缓存数据,但是如果我使用/ proc / mtrr标记我的地址写回,则在读和写时不会爆发。 The BAR in the PCI header is marked prefetchable. PCI标头中的BAR被标记为可预取。 Does anybody of you know how to implement bursts for read and write on pci bus ? 你们中有人知道如何实现突发以在pci总线上进行读写吗? I hope anybody of can help me. 我希望任何人都可以帮助我。

The best way to get burst transfers on the PICe bus it to use a DMA controller instead of processor I/O. 在PICe总线上获得突发传输的最佳方法是使用DMA控制器而不是处理器I / O。 If your FPGA is a PCIe bus master, you may be able to program it to transfer the data. 如果您的FPGA是PCIe总线主控器,则可以对其进行编程以传输数据。 Otherwise there are DMA controllers built into most platforms. 否则,大多数平台都内置了DMA控制器。

I'd expect write combining to perform reads the same as uncached. 我希望写合并执行与未缓存读取相同的读取。 But even if you use ioremap_cache(), your platform may not burst PIO reads. 但是,即使您使用ioremap_cache(),您的平台也可能不会突发PIO读取。 It can depend on your processor, the instruction doing the read and system logic. 它可能取决于您的处理器,执行读取的指令和系统逻辑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM