FPGA (PCIe) and NXP chip (USB) - driver development suggestions

Background:

  • On Rev1 of our custom board, we have an NXP chip that collects a bunch of data from peripherals, and connects to the Windows host over USB.
  • On Rev 2 of our custom board, I am working on the digital logic design (RTL) for a Lattice based FPGA, to enable PCIe Gen 3 for its P2P functionaility and other reasons the NXP chip is unable to handle, and it connects in the M.2 slot.

We want to send config from a Windows host and collect data continuously from the peripherals.

We will need to create a Windows device driver to handle these protocols.

Initially for Rev1, we want to read/write data to the NXP chip using USB (the firmware for the chip is built by other devs and functions).
For Rev2 we want to read/write data over M.2 PCIe to the FPGA.
(N.b. I have experience developing a Linux PCIe Gen4 driver for a Xilinx FPGA with success, mostly using skeleton code and enabling MSIX interrupts and sending data via DMA, and older Windows WDM experience).

Can you recommend me a plan on how to create this multi-protocol driver (WDM, KMDF? Sample codes? Architecture design, etc).

The reason it’s split up in this way is because Rev1 is showcased to stakeholders and has acceptance, thus I have to get data to and from this device. However, in a couple of months, a POC wants to be done on the FPGA I am designing as this will be the final target (or designed and taped-out as an ASIC if all goes well). Hence there is this multi-tiered approach.

Bonjour Avalon,

For the USB project, you can use a simple user mode library to control the USB link from the user mode. No need for a kernel mode driver. This makes thing simple. That said, depending on how the USB device presents itself, you can need to create an INF file and get it signed. This INF file simply indicates windows to load the default USB driver for your device.

For the PCIe device, if you want to use DMA transfer, you need a kernel mode device driver. Xilinx. Visite page

65444 - Xilinx PCI Express DMA Drivers and Software Guide

https://adaptivesupport.amd.com/s/article/65444?language=en_US

This page describes the information Xilinx gives you to help you to create a driver. On Linux, the driver sources are publicly available. In fact, the driver is event part of the Linux kernel source now.

For the Windows driver, you need to request access to the sources. Xilinx states that the sources are demonstration code only. I have access to the sources, but I am not legally allowed to share it with you. I can tell you that these sources are not “production” level but are a good source of information.

Some people seem to have leaked these sources on GitHub, but I will clearly not share links here.

If you compile the Xilinx sources, or even if you create your own driver and compile it, you still need to get the driver signed by Microsoft before being able to load it on Windows 11 without disabling the signature verification. To get the driver signed, you first need to:

1. Get an EV code signing certificate from a vendor Microsoft approve.

2. Enroll in the Microsoft partner program.

3. Signe your driver

4. Submit your signed driver to Microsoft through the Microsoft Partner Center

Step 1 is a little bit long. The certificate provider is forced by Microsoft to do extended validation (EV) about your identity.

Step 2 is also a little bit long. Microsoft does many verifications to also validate your identity.

The other possibility is to use a production-ready driver already developed, compiled and signed by a third party. I know 2 third party driver for Xilinx DMA.

A. XDMA Driver Samples - WinDriver
https://windriver.jungo.com/direct-memory-access/xilinx-xdma-drivers/
I do not have any experience with this driver or library and I do not know the price.

B. 0066_en.pdf
https://www.kms-quebec.com/Cards/0066_en.pdf
This is the driver I developed myself and the price is very reasonable.
0051_en.pdf
https://www.kms-quebec.com/Cards/0051_en.pdf

Martin Dubois

mdubois@kms-quebec.com